|
Open up the Apache configuration file (./apache/conf/httpd.conf)
in your favorite text editor.
First and foremost, you should set the KeepAlive parameter. If you
want to serve web pages containing more than 30 images, set KeepAlive
to On and KeepAliveTimeout to a value between 1 and 4.
Otherwise, set KeepAlive to Off - this will make your
web server less susceptible to denial-of-service attacks.
It is also important to set the critical MaxClients parameter to a
sane value (see the Apache documentation for details). We recommend that you
start with a low value and use the mod_status facility to fine-tune it.
Assuming you have compiled Apache with the prefork MPM (the default),
StartServers, MinSpareServers and MaxSpareServers need
to be tweaked as well. Too many processes will not necessarily improve
performance and bumping into your account's maximum process limit would cause
problems.
KeepAlive Off
StartServers 4
MinSpareServers 2
MaxSpareServers 3
MaxRequestsPerChild 0
MaxClients 20
Look for the Listen directive and replace it with your v-host
IP address (as shown by dns list in csoftadm). Specify 8080
for the port number (packets to port 80 will be redirected accordingly).
Listen w.x.y.z:8080
Now specify the location of your webpages with DocumentRoot.
The VirtualDocumentRoot directive allows you to configure new
domain names under your account (i.e., using the DNS section of the
web interface or the dns commands in the shell interface),
without having to edit httpd.conf every time. In this example,
the VirtualDocumentRoot directive dictates that any domain
domain.ext should simply point to /home/myself/www/domain.ext.
DocumentRoot /home/myself/www
VirtualDocumentRoot /home/myself/www/%0
We now need to allow access to the DocumentRoot:
<Directory "/home/myself/www">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
The Options string defines the default web server options.
Indexes enables directory listings and FollowSymLinks instructs
the web server to follow symbolic links.
Other commonly used options include MultiViews to turn on the
HTTP/1.1 language negotiation feature and ExecCGI for CGI script
execution.
The AllowOverride parameter defines the ability of .htaccess
files to override certain aspects of the server configuration on a per
directory basis. If you prefer, you can avoid editing .htaccess files
altogether and edit your httpd.conf instead.
|