361
Chapter 22:
Setting Up a Linux Web Server with Apache
Activating Apache Web Server Under Fedora
The simplest way to install Apache web server under Fedora Linux is to perform a default
installation using the Fedora Linux installation routine, as described in Chapter 20. After
Fedora is installed, you can start and test Apache with the following steps:
1. Open a terminal emulation window.
2. Change to the superuser (root):
su
3. Provide the root password when prompted.
4. Type the following command to start Apache:
apachectl start
5. Create a simple HTML file in the location /var/www/html/ and save the file
as index.html. (Note that, by default, you must be the root user to create or
modify files in /var/www/html.)
6. Open a web browser and navigate to the address http://localhost/. The file
you saved as index.html should appear in the web browser, showing that
Apache is up and running.
Downloading and Installing Apache Web Server
If you did not install Apache under Linux (for example, if you are using a distribution
of Linux that does not come with Apache), you can download the latest version and
install it manually.
www.apache.org/dist/httpd/. Open the Binaries folder, open the folder representing
the operating system you are using (Linux or RPM, for Red Hat Package Manager),
and then choose the appropriate package from the list that appears. The packages are
organized by the Apache version (which is also shown as part of the filenames), the
processor, and the operating system. For example, you might download a file called
httpd-2.2.3-i386.rpm (representing version 2.2.3 of Apache for 32-bit Intel-based systems
running Linux and that use the RPM installation format) into a temporary directory on
your Linux system.
After you've downloaded the package, you can install the Apache web server and
start it, as follows:
1. Open a terminal emulation window.
2. Type the following to change to the directory that contains the downloaded
Apache binary file:
cd / directory