# Hiawatha webserver and aliases



## ckester (Feb 18, 2010)

I installed the latest www/hiawatha from ports and enabled it in /etc/rc.conf

Since I want to use it with tinderbox, I followed the instructions in tinderbox's pkg-message and edited /usr/local/etc/hiawatha/hiawatha.conf,
adding the following lines after the ones describing the default website:


```
Alias = /tb/logs:/usr/local/tinderbox/logs
Alias = /tb/packages:/usr/local/tinderbox/packages
Alias = /tb/errors:/usr/local/tinderbox/errors
Alias = /tb/:/usr/local/tinderbox/scripts/webui
```

With these lines, and no other changes to the config file as it was installed by the port, hiawatha refuses to start.  I always get a syntax error from the first "Alias" line found.  

I tried commenting out each of the four lines one by one and it made no difference; as long as there was any such line in the configuration file, I got the syntax error.

I tried removing the spaces around the "=" sign.  Nope.

I tried adding spaces around the colon ":" separating the alias from the target.  Nope.

I also tried adding a Virtual Host section and specifying the aliases there.  Same problem.

With all of the alias lines commented out, hiawatha starts up without complaint.

tinderbox is installed, and the targets of the aliases do exist.

Unfortunately the error message doesn't give any information beyond the linenumber in the configuration file.  I.e., it doesn't tell me what it thinks is wrong with my syntax.  As far as I can see, I'm using the exact same syntax as found on the manpage and in the examples given on the Hiawatha website.  So I'm stumped.

I'm running 8.0-STABLE on an i386-class machine.  But I also tried it on a 7.2-RELEASE i386 machine and have the same problem.

Has anyone had any success with this?    The tinderbox port certainly seems to be saying that it *should* work...


----------



## ckester (Feb 21, 2010)

*Solved!  How to create aliases in hiawatha.conf*

After browsing the hiawatha sourcecode I believe I've solved this myself.

The pkg-message from the tinderbox port is mistaken.

The syntax for an alias in the hiawatha.conf file is:


```
Alias = Key:Value
```

The key must begin with a '/' and there must not be any other '/' characters in the string.  I.e., keys like "/foo/" or "/foo/bar" are not allowed.  But "/foo" is OK.

The value in the key:value pair must also begin with a '/'.  It may contain additional '/' characters to separate the subdirectories along the path, but a final or trailing '/' is not allowed.  I.e., values like "/a/b/c" are OK, but "/a/b/c/" are not.

Therefore, to configure hiawatha for the tinderbox web interface, only one alias is needed:


```
Alias = /tb:/usr/local/tinderbox/scripts/webui
```

Then, in the webui directory, add symlinks to the logs. packages and errors directories.

_This is for Hiawatha 6.19.  Other versions might behave differently._


----------

