More Questions Than Answers

Dan Atrill's blog site

Name-based virtual hosting and Webmin

Shifting from a basic hosting package to a more flexible system has a lot of advantages as well as providing some headaches. The new system is a Virtual Dedicated Server hosted by Lycos. The admin for this is Webmin and the webserver is Apache. It’s cheap, but needs quite a lot of work to set it up.
I’ve put a few sites on now with stats. The directives part of the config file was simpler than some places would have you believe. I followed some notes on setting directives and logfiles per virtual host from Unix Girl who usefully annotated everything too.
Something I discovered rather painfully was a simple slip in the Apache config file and the whole thing stops. Make a typo, restart Apache from Webmin and all that appears is the message Error. Not very helpful when trying to get things moving. After a few of these I resorted to a SSH session and ran /usr/local/apache/bin/apachectl restart [change path to apachectl where appropriate] this has the effect of restarting the webserver but will flag up any errors too. ie a directory / access_log that doesn’t exist. It’s then possible to go back, fix the missing item and do the restart again. If everything’s OK the Apache server is back and sites are being served again.
With logfiles, to ensure useful information, use the combined per virtual host logging which gives details of referrers, search terms (ie from Google, etc) and what type of browser was used to access the site. Recipe 4.9 in O’Reilly’s Apache Cookbook helped with this. These logs can then be analyzed with Webalizer or something else depending on the server setup.
Finally, password protecting each logfile directory can either be setup using htpasswd, following Apache’s instructions on .htaccess and types of authorisation, or from the Others tab in Webmin select “Protected Web Directories”, select ‘Add protection for a new directory.’ add a directory (that already exists), choose the automatic password file and enter the realm – this is the wording that appears on the pop-up login window ie Enter password here. After this all that needs adding is a username and secure password for the directory.
After a month of configuring in spare moments it is lucky none of the sites need email enabling at present as qmail is still not completely done, though squirrelmail looks like a good candidate as the web mail client. But not before a weeks skiing, starting tomorrow.

Tue, February 28 2006 » Apache

Leave a Reply

*