About Apache


About Apache

This section describes the packages you need to install and provides references for the programs covered in this chapter. The "" section on page introduces terminology and other topics that will help you make better sense of this chapter. "JumpStart I" (page ) gets Apache up and running as quickly as possible.

Prerequisites

Minimal installation

Install the following packages:

  • httpd

  • apr (Apache portable runtime)

  • apr-util

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:

  • httpd-manual The Apache manual

  • webalizer Web server log analyzer (page )

  • mod_perl Embedded Perl scripting language

  • mod_python Embedded Python scripting language

  • mod_ssl Secure Sockets Layer extension (page )

  • php Embedded PHP scripting language, including IMAP & LDAP support

  • mrtg MRTG traffic monitor (page )

  • net-snmp and net-snmp-utils SNMP, required for MRTG (page ).

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)

mod_perl

mod_php

mod_python

mod_ssl

MRTG

SNMP

SSI RHEL , FEDORA

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 ), select WWW (HTTPD) and/or Secure WWW (HTTPS) from the Trusted services frame to open these ports. For more general information, see , 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 "" on page .

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 ) 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 for more information about working with groups.

Versions

RHEL runs Apache version 2.0. FEDORA runs version 2.2.