Forum

Need help configuring

Duke Normandin
20 November 2010, 21:33
Hello folks:

I'm using:
Hiawatha version: 7.4
Operating System: Xubuntu 9.10

At the moment, I want to use Hiawatha to test various CGI scripts using a new (to me) programming language. All this is happening on an Xubuntu box.

I'm in /etc/hiawatha.conf, and wanting to define the "default website" and a few "Virtual Hosts". In another window, I'm reading http://www.hiawatha-webserver.org/howto/websites.

OK! Hostname should be an IP address. In my /etc/hosts I have 2 IPs - 127.0.0.1 and 192.168.0.blah. How do I deal with that in hiawatha.conf? Or does it matter?

Hiawatha ships with a hiawatha.conf file that specifies the WebsiteRoot as "/var/www/hiawatha". I take it that this is suppose to be the "default" site? However, the above HOWTO suggests to have the WebsiteRoot as "/var/www/dummy". How should I proceed?

I take it that I'll have to "sudo" into the WebsiteRoot directories to load up the required html/cgi files?

All tips, suggestions, warnings will be much appreciated.
--
Duke
Søren Enevoldsen
20 November 2010, 22:31
I just started using the server, and I did the following (although I don't know whether it is secure or not).

Set the default hostname to my ip and redirect to a blank page in /var/www/blank
The file was blank.html

Made a virtual host with my hostname (DNS kind) with root set to
/var/www/html
In retrospect html is probably not a good name since it gives the assumption that only html files are served. However I have .php files and .cgi scripts in there too.
Regarding CGI there is pretty straightforward in the config, just remember to pust ExecuteCGI-something-something in your Virtual Host. The CGI extension one works by using the shebang of the extension your choose, eg. ".cgi", you don't have to use that if all your scripts file have the same extension/uses the same interpreter.
Hugo Leisink
21 November 2010, 00:09
If it's for testing only, just use your default host. Give it the 192.168 address. A hostname can also be a real hostname.

Point the WebsiteRoot to any directory you want.

To place files in /var/www, you probably need to have the right access rights. Sudo will very likely do the trick.
Duke Normandin
21 November 2010, 04:44
@soren
Thanks for the tips - especially the CGI setup stuff.

@Hugo
Yep! For the time being, Hiawatha will be used for testing CGI scripts using a new language (to me) that I'm learning.

So I can use a directory outside the default /var/www? Like $HOME/Sites/virtualhost1/ , for example?

You bet - I can sudo into /var/www/whatever, but if I can use $HOME/Sites/, that would be easier.
Hugo Leisink
21 November 2010, 11:57
Yes, you can use any directory you want. Note that Hiawatha doesn't understand $HOME.
Duke Normandin
22 November 2010, 05:41
Very cool! Thanks.

This topic has been closed.