Runtime Server Configuration Settings


Running Apache with its default settings should suit most uses. There are some tweaks you can make to customize Apache to your own liking or needs. If you installed Apache using YaST, Apache's standard configuration file is stored in /etc/Apache2/httpd.conf. If you installed Apache manually, the httpd.conf file will reside in the etc subdirectory of whatever you specified as Apache's base directory using configure's prefix option. You can either use SUSEConfig or edit this file directly to customize your server.

The SUSEConfig editor is located on the YaST System page. To configure Apache, go to Network, WWW, Apache2. Open the tree (click the + sign) to view the settings. These include the following:

  • APACHE_HTTPD_CONF Use this setting to specify a different configuration file than the default httpd.conf.

  • APACHE_MPM Multiprocessing modules are compiled into Apache and handle tasks such as network and process management. Remember, Apache can use only one MPM at a time. You can have both MPMs installed, but this setting determines which MPM is used. By default, SUSE Linux installs the prefork MPM.

  • APACHE_SERVERADMIN Useful only if APACHE_SERVERSIGNATURE is set to email. This setting lists the administrator's email address. The default is webmaster@<hostname>, where <hostname> is taken from the HOSTS file.

  • APACHE_SERVERNAME This is an important setting, especially if the server is open to the Internet and not just your LAN. Use this to define your fully qualified domain name, such as www.susefan.com, because this is the name your server will return when pinged. You don't need to set this if the machine's canonical name (that is, what SUSE calls your machine) is fine with you; Apache will use this by default. If you administer your own DNS (see the next chapter for information on how to do that), be sure to add an alias for your host. Otherwise, ask the manager of your DNS (your ISP, for example) to set this name.

  • APACHE_CONF_INCLUDE_FILES Create a custom configuration file and name it httpd.conf.local. Use this setting to have Apache use the custom configuration file in addition to the default. You can add multiple files separated by spaces.

  • APACHE_CONF_INCLUDE_DIRS Suppose you have a server application and its configuration file installs to a directory other than /etc/Apache2. Use this setting to allow Apache to read this configuration file. You can add multiple directories separated by spaces.

  • APACHE_MODULES This is where modules installed by YaST are activated. Look over the Description text for hints on various modules.

  • APACHE_SERVER_FLAGS This is the equivalent of starting Apache from the command line with various switches to turn features on and off. Review the Apache man page to see a list of switches/flags you can enter here.

  • APACHE_START_TIMEOUT By default, if the kernel tries to start Apache during boot, and Apache does not start in 2 seconds, it will report a timeout. You can extend this time (if, for example, you have some security features added that will slow response time) here.

  • APACHE_SERVERSIGNATURE This starts a footer at the bottom of any server-generated error page. By default, this includes the server name and Apache version number. If you want to include a contact point for the user to find you, set this to email and enter an email address at APACHE_SERVERADMIN. If you prefer that nothing appear, set this to no.

  • APACHE_LOGLEVEL This defines what gets entered into the server logs by setting the minimum level. By default, this is set at warn, so only problems that generate warnings (or worse) are entered. Informational messages are screened out. You should change this only if you are trying to troubleshoot a problem that might generate a lower-level message.

  • APACHE_ACCESS_LOG The location of your access log. Who is visiting?

  • APACHE_USE_CANONICAL_NAME This is turned off by default; turn it on so Apache delivers the ServerName listed earlier. Use the DNS setting to let the domain name server handle requests for the server name.

  • APACHE_SERVERTOKENS This tells Apache how much information it delivers about itself when asked. The default is the OS it is running on. You can set this higher or lower.

  • APACHE_EXTENDED_STATUS You can get additional information in your server status reports with this option turned on, but recording it will slow the server down some.

  • APACHE_BUFFERED_LOGS Use this to get Apache to store several log entries in memory and write them together to disk, rather than writing them after each request. On some systems, this may result in more efficient disk access and hence higher performance. It may be set only once for the entire server; it cannot be configured per virtual host.

  • APACHE_TIMEOUT How long, in seconds, Apache attempts to process a request before giving up. By default, this is set at 300 seconds (5 minutes).

Additional Settings in httpd.conf

Most important Apache settings can be configured in /etc/sysconfig, but some must be edited in Apache's own configuration file, /etc/Apache2/httpd.conf. Consult the Apache documentation for a listing of all the settings, also called directives, but you should consider changing the following defaults:

  • DocumentRoot This should be set to the top directory that you want to serve files from. The default is /srv/www/htdocs.

  • MaxClients The maximum number of concurrent clients (that is, visiting browsers). The default is 150, but it probably should be set with consideration to the amount of traffic you expect.

  • Port Where Apache listens for traffic. This is set by default at port 80, the assigned port for HTTP traffic. This may also be set to port 8080 depending on your intended setup.

  • Directory Set directory permissions with this directive.

  • DirectoryIndex The file(s) Apache looks for when a request is made for the index or listing of a directory. Several documents can be listed (so you can list such files as index.php, index.shtml, index.htm, index.txt, and so on) and the server will return the first one in the list that it finds. If none of the documents exist, then, depending on how you've configured things, Apache may try to generate its own directory listing.

  • UserDir In every user's home directory, there is a subdirectory called public_html. To have Apache recognize files in this directory, set it here. The address for these pages would be http://<servername>/~<username>.



SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net