7.5.1. How Do I Do That?
Before configuring Apache, it's a good idea to make a backup copy of the original configuration file:
# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf-original
7.5.1.1. Starting Apache
Apache is not enabled by default. To start it, use the Services tool or enter this command:
# service httpd start
To ensure that Apache starts each time the system is booted, enable the
Whenever the Apache configuration is changed, you must instruct Apache to reload its configuration:
# service httpd reload
Alternately, you can use the Restart button in the Services tool.
7.5.1.2. Testing Apache
Using a web browser on the machine running Apache, access the web location
Figure 7-16. Apache test page confirming operation of the web server
Once you can view this web page on the server, you can attempt to access the page from a remote system using the IP address of the server (such as
If you can access the web page on the server but not from a remote system, then the firewall configuration may require adjustment.
7.5.1.3. Installing your own web content
Once the web server is running, place the content you wish to serve in the directory
Create subdirectories within
# mkdir /var/www/html/
That directory will be accessible using the URI
7.5.1.4. Changing the default configuration
The default Apache configuration serves all web content from one directory:
Apache can be configured by using Fedora's graphical configuration tool or by editing configuration files, but you can't alternate between the two approaches. Most experienced Apache administrators prefer to directly edit the configuration file because it provides direct access to all of Apache's features and because it is more convenient when accessing a remote server. However, Fedora's graphical configuration tool is quite powerful and is a good place to start if you're not familiar with Apache setup.
7.5.1.5. Configuring Apache graphically
To configure Apache graphically, select System>Administration>Server Settings>HTTP (or in KDE, Administration>Server Settings>HTTP). The
Figure 7-17. Graphical configuration tool for Apache httpd
Start with the Main tab and enter the server name and webmaster's email address. The server name must contain only alphanumeric characters; it will be used as a hostname and combined with the current domain name to build a fully qualified domain name (FQDN).
The webmaster's address is displayed in server error messages and could be harvested by web spiders, so it is a good idea to use a disposable email alias and change it frequently to thwart spammers.
The Available Addresses area is used only if you wish to prevent the web server from using some network interfaces, or if you wish to use a nonstandard TCP/IP port (the default for HTTP is port 80). This is usually left at the default setting.
The Virtual Hosts tab shown in Figure 7-18 is used to configure Apache to respond to requests for multiple web sitesfor example,
Figure 7-18. Virtual host configuration
To edit an existing entry or add a new entry, use the Edit or Add buttons. In either case, the window shown on the right of Figure 7-18 will appear, with these tabs:
General Options
Enter the name of the virtual host (this information is only for your reference, so you can be as descriptive