Configuration of files : The best way to understand httpd.conf is to read through it. Most entries can be left the way they are. We'll look at the ones that may need to be changed, depending on your setup. * ``ServerAdmin" is the mail ID of the system administrator. It's set to your@your.address, which I am sure you can see that it needs to be changed. * You don't need to set ``ServerName", but it may be a good idea. * The parameters ``MinSpareServers, MaxSpareServers,StartServers,MaxClients and MaxRequestperChild" are used for server tuning. The default values should work initially, but if you have alot of Web traffic, you should consider changing them.
Virtual Hosts : Running and maintaining a web server is enough work that you might want to use the same server to host several sets of web pages, for example for a number of different organizations. For example, at example.orf you may run your own web pages and also a set of pages for buguser.com. To do this, you add the following section to /usr/local/etc/apache/httpd.conf : <VirtualHost www.biguser.com> ServerAdmin greg@example.org DocumentRoot /usr/local/www/biguser ServerName www.biguser.com ErrorLog /var/log/biguser/error_log TransferLog /var/log/biguser/access_log <VirtualHost>
The log files don't contain any information about the names by which the data was invoked, so it's important to have separate log files for each virtual domain. In this case we've put them in a sub directory of var/log, /var/log/biguser/ You must first create this directory before restarting the server. After restarting apache, it handles any requests to www.biguser.com with these parameters. If you don't define a virtual host, the server will access the main web pages (Defined by the entry ``DocumentRoot" in /usr/local/etc/apache/access.conf).
Running Apache : The server is stored in the rather unusual location /usr/local/www/server/httpd. You can run it with no parameters. # /usr/local/www/server/httpd
It Automatically starts 7 other processes.
To start apache automatically at boot time, add the following entry to /etc/rc.local : echo -n `starting local daemons:' # put your local stuff here echo `` httpd"; /usr/local/www/server/httpd
|