This section describes the packages you need to install and provides references for the programs covered in this chapter. The "Notes" section on page 788 introduces terminology and other topics that will help you make better sense of this chapter. "JumpStart I" (page 789) gets Apache up and running as quickly as possible. Prerequisites
Minimal installation Install the following packages:
Starting Apache Run chkconfig to cause httpd to start when the system enters multiuser mode: # /sbin/chkconfig httpd on After you configure Apache, use service to start httpd: # /sbin/service httpd start After changing the Apache configuration, restart httpd with the following command, which will not disturb clients connected to the server: # /sbin/service httpd graceful
Optional packages You can install the following optional packages:
More Information
Local The Apache Reference Manual and Users' Guide /var/www/manual Point a browser at http://localhost/manual if httpd is running or at /var/www/manual/index.html if httpd is not running. The manual is available online only if the httpd-manual package is installed.
Web Apache documentation RHEL httpd.apache.org/docs/2.0, FEDORA httpd.apache.org/docs/2.2 Apache directives list RHEL httpd.apache.org/docs/2.0/mod/directives.html, FEDORA httpd.apache.org/docs/2.2/mod/directives.html Apache Software Foundation (newsletters, mailing lists, projects, module registry, and more) www.apache.org mod_perl perl.apache.org mod_php www.php.net mod_python www.modpython.org mod_ssl www.modssl.org MRTG mrtg.hdl.com/mrtg.html SNMP net-snmp.sourceforge.net SSI RHEL httpd.apache.org/docs/2.0/howto/ssi.html, FEDORA httpd.apache.org/docs/2.2/howto/ssi.html webalizer www.mrunix.net/webalizer Notes
Terms: Apache and httpd Apache is the name of a server that serves HTTP and other content. The Apache daemon is named httpd because it is an HTTP server daemon. This chapter uses the terms Apache and httpd interchangeably.
Terms: server and process An Apache server is the same thing as an Apache process. An Apache child process exists to handle incoming client requests, hence it is referred to as a server.
Firewall An Apache server normally uses TCP port 80; a secure server uses TCP port 443. If the Apache server system is running a firewall, you need to open one or both of these ports. To get started you just need to open port 80 (HTTP). Using the Red Hat graphical firewall tool (page 768), select WWW (HTTPD) and/or Secure WWW (HTTPS) from the Trusted services frame to open these ports. For more general information, see Chapter 25, which details iptables.
SELinux When SELinux is set to use a targeted policy, httpd is protected by SELinux. You can disable this protection if necessary. For more information refer to "Setting the Targeted Policy with system-config-securitylevel" on page 402.
Running as root Because Apache serves content on privileged ports, you must start it as root. For security reasons, the processes that Apache spawns run as the user and group apache.
Locale The httpd daemon is started using the C locale by default. You can modify this behavior, for example, to use the configured system locale, by setting the HTTPD_LANG variable in the /etc/sysconfig/httpd file.
Document root The root of the directory hierarchy that Apache serves content from is called the document root. As shipped by Red Hat, the document root is /var/www/html. You can use the DocumentRoot directive (page 796) to change the location of the document root.
Modifying content As shipped by Red Hat, only root can add or modify content in /var/www/html. To avoid having people work as root when they are manipulating content, create a group (webwork, for example), put people who need to work with Web content in this group, and make the directory hierarchy starting at /var/www/html (or another document root) writable by that group. In addition, if you make the directory hierarchy setgid (chmod g+s filename), all new files created within this hierarchy will belong to the group, which facilitates sharing files. See page 539 for more information about working with groups.
Versions RHEL runs Apache version 2.0. FEDORA runs version 2.2. |