Installing Apache from Source Files On Linux
Installing Apache from Source Files
- Point your web browser to http.apache.org, the Apache home page.
- Click the form a mirror link under download on the left side of the page.
- Scroll down to the section labeled mirror.
A specific mirror is selected for you. If you do not want to use this mirror, select another. Or if you have problems downloading from this
mirror, return to this page and select another.
- Scroll farther down the same page to the section for Apache 2 or for the Apache 1.3, whichever you want to install. Locate and highlight the file you want to download.
For instance, at the time, the most recent version for Linux is http-2.0.47.tar.gz
- Click the latest version to download it.
- Select the option to save the file.
- Navigate to where you want to save the source code (for example, /usr/src). Then click Save.
- After download, change to the download directory (for example, cd-/usr/src).
You see a file named httpd-, followed by the version name and tar.gz. This file is called a tarball because it contains many files compressed into the tarball file by a program called tar.Be sure you’re using an account that has permission to write into /usr/src, such as root.
- Verify the downloaded file to be sure it hasn’t been tampered with. To verify the file, follow these steps.i. Download two files from www.apache.org/dist/httpd/: KEYS and a file with the same version number as the source with a filename that ends in .asc.ii. Type one of the following lines, depending on which version of PGP is installed on your computer:
pgp <KEYS
gpg — import KEYSSeveral lines of output are displayed.iii. Type one of the following lines, with the correct version number.pgp httpd-2.0.47.tar.gz.asc
gpg — verify httpd-2.0.47.tar.gz.asc
You should see something similar to the following.
Good signature from user “KS”This is what you’re looking for. Several may be displayed, but the preceding message is the important one. Your may also see a message stating that the relationship between the key and the signer of the key cannot be verified. This is okay.If you don’t get a message that the signature is good, the file may have been tampered with and may be dangerous. In this case, repeat the process starting with Step 1 and select a different mirror to download from.
- Unpack the tarball.The command to unpack the tarball for version 2.0.47 is the following: gunzip -c httpd-2.0.47.tar.gz | tar -xf -
A new directory called httpd-2.0.47 is created with several subdirectories containing all the files that you just unpacked from the tarball.
- Change to the new directory that was created when you unpacked the tarball.For example, you can user a command like the following:
cd httpd-2.0.47
- Type the configure command.The configure command consists of ./configure followed by all the necessary options. If you can all the default option, you can user configure as follows: ./configureOne of the more important installation options you may want to user is prefix, which sets a different location where you want Apache to be installed. By default, Apache is installed at /usr/local/apache or usr/local/apache2. You can change the installation location with the following line:./configure — prefix=/software/apache2Additional
installation options are discussed later in this chapter in the section “Installation Options”. You can see a list of all the available options
by typing the following line:./configure –helpThis scripts may take a while to finish running. As it runs, it displays output. When the script is done, the system prompt is displayed. If configure encounters a problem, it displays a descriptive error message.
- Type the following command: makeThis
command builds the Apache server. It may take several minutes to finish running. As it runs, it displays message telling you what it’s doing. There may be occasional longer pauses as it completes some action. When it’s finished, it returns to the system prompt. If it has a problem, it displays a descriptive error message.
- Type the following command: make installThis command installs the Apache software in the proper locations, based on the configure command you use in Step 11.
- Start the Apache Web Server.See the section “starting Apache” later in next lesson for details.
- Type the URL for your web site (for example, www.configureinstallsetup.com or localhost)
into a browser to test Apache.If all goes well, you can see the Apache message telling you that Apache is working. If don’t see this message,something is amiss, and you should read the section “Troubleshooting Apache” later in next lesson for detail.
- 164 reads
Recent popular content



















