Section 5.2. Installing Apache


5.2. Installing Apache

Apache is available with nearly every Linux distribution. In the case of Fedora, you probably installed the RPM version of the software during the installation of your operating system.

5.2.1. Requirements

Apache requires the following of your Linux machine:

  • 50MB free temporary disk space. This is necessary only for the installation of Apache. Once installed, Apache will only use about 10MB of disk space.

  • An accurate clock on your server. Pieces of the HTTP protocol are expressed as time of day. In order to assure the proper operation and logging of your server, it's recommended that you utilize the Network Time Protocol (NTP) daemon to maintain system time. You can configure this using the Date/Time Properties tool , available from Desktop > System Settings > Date & Time.

All in all, the requirements for building the Apache server are minimal and can be met by most Linux systems.

When installing Apache on Fedora Core, you have several options: the installation can be accomplished via the RPM packages included with the Fedora Core distribution, or you can download the source code from the Apache site, compiling and building the server to suit your specific needs. Compiling and installing the server yourself, though, is unlikely to constitute a good use of your time; the packaged version of Apache will probably meet all your needs, unless you're running a very high-volume or complex site. We won't discuss self-compilation of Apache in this book.

5.2.2. Installing Apache from RPM Packages

Apache 2 is included in the Fedora Core distribution, which makes for an easy installation. However, you're not bound to the version that's included on the installation CDs. Apache's open source nature allows for a constant stream of improvements and fixes, and the software is always moving forward through incremental releases. By the time you're ready to install the Fedora distribution, it's likely that the Apache server will have reached another incremental release. And, like the source distributions of the server, the incremental RPM releases are available for download.

One easy way to acquire and install the latest version of Apache is to use the updating tool, yum , which downloads updates directly from Red Hat. First, we'll check if any Apache updates are available.

[kermit@swinetrek ~]$ su Password: [root@swinetrek kermit]# yum check-update httpd Setting up repositories updates-released   100% |=========================|  951 B   00:00 extras             100% |=========================| 1.1 kB   00:00 base               100% |=========================| 1.1 kB   00:00 Reading repository metadata in from local files primary.xml.gz     100% |=========================| 307 kB   00:04 updates-re: ############################################ 949/949 Added 949 new packages, deleted 0 old in 18.67 seconds primary.xml.gz     100% |=========================| 751 kB   00:10 extras    : ############################################ 2119/2119 Added 2119 new packages, deleted 0 old in 51.33 seconds primary.xml.gz     100% |=========================| 824 kB   00:12 base      : ############################################ 2772/2772 Added 2772 new packages, deleted 0 old in 37.78 seconds httpd.i386                    2.0.54-10.2         updates-released [root@swinetrek kermit]# 

The first time you run yum, it will need to download information about the available packages from Red Hat. Once it's analyzed the list of available packages, it will present a note of the packages for which updates are available. Above, we see that the httpd.i386 package has been updated to version 2.0.54-10.2. Getting and installing this latest Apache package is as simple as entering yum update httpd at the command prompt:

[root@swinetrek kermit]# yum update httpd Setting up Update Process Setting up repositories updates-released   100% |=========================|  951 B   00:00 extras             100% |=========================| 1.1 kB   00:00 base               100% |=========================| 1.1 kB   00:00 Reading repository metadata in from local files Resolving Dependencies --> Populating transaction set with selected packages.         Please wait. ---> Package httpd.i386 0:2.0.54-10.2 set to be updated --> Running transaction check --> Processing Dependency: httpd = 2.0.54-10 for package: mod_ssl --> Processing Dependency: httpd = 2.0.54-10 for package:         httpd-manual --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages.         Please wait. ---> Downloading header for httpd-manual to pack into          transaction set. httpd-manual-2.0.54 100% |=========================|  91 kB  00:01 ---> Package httpd-manual.i386 0:2.0.54-10.2 set to be updated ---> Downloading header for mod_ssl to pack into transaction set. mod_ssl-2.0.54-10.2 100% |=========================|  23 kB  00:00 ---> Package mod_ssl.i386 1:2.0.54-10.2 set to be updated --> Running transaction check Dependencies Resolved ==================================================================   Package          Arch    Version           Repository       Size ================================================================== Updating:  httpd            i386    2.0.54-10.2       updates-released 935 k Updating for dependencies:  httpd-manual     i386    2.0.54-10.2       updates-released 1.7 M  mod_ssl          i386    1:2.0.54-10.2     updates-released  92 k Transaction Summary ================================================================== Install      0 Package(s) Update       3 Package(s) Remove       0 Package(s) Total download size: 2.7 M Is this ok [y/N]:  

yum will display a summary of the packages to be downloaded, and ask you to confirm that you would like to download them . If the download is very large, you may want to wait until a time at which plenty of bandwidth is available on your network, but since this download is only 2.7MB, we'll go ahead and download it now.

Is this ok [y/N]: y Downloading Packages: (1/3): httpd-2.0.5 100% |=========================| 935 kB  00:12 (2/3): httpd-manua 100% |=========================| 1.7 MB  00:22 (3/3): mod_ssl-2.0 100% |=========================|  92 kB  00:01 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID     4f2a6fd2 public key not available for httpd-2.0.54-10.2.i386.rpm Retrieving GPG key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora Importing GPG key 0x4F2A6FD2 "Fedora Project <fedora@redhat.com>" Is this ok [y/N]: 

The RPM packages used to keep Fedora up-to-date are encrypted using GNU Privacy Guard (GPG) , an open source implementation of the PGP (Pretty Good Privacy) cryptographic system. At this prompt, yum asks if it can download the Fedora Core public key that will allow it to decrypt the RPM. We'll be looking at cryptography again later in this chapter; for now, just answer y:

Is this ok [y/N]: y Key imported successfully Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction   Updating  : httpd                ######################### [1/6]   Updating  : httpd-manual         ######################### [2/6]   Updating  : mod_ssl              ######################### [3/6]   Cleanup   : httpd                ######################### [4/6]   Cleanup   : httpd-manual         ######################### [5/6]   Cleanup   : mod_ssl              ######################### [6/6] Updated: httpd.i386 0:2.0.54-10.2 Dependency Updated: httpd-manual.i386 0:2.0.54-10.2     mod_ssl.i386 1:2.0.54-10.2 Complete! [root@swinetrek kermit]# 

Once yum is finished, restart your new Apache server with the following command, again as root:

[root@swinetrek kermit]# /sbin/service httpd restart Stopping httpd:                                           [  OK  ] Starting httpd:                                           [  OK  ] [root@swinetrek kermit]#  



Run Your Own Web Server Using Linux & Apache
Run Your Own Web Server Using Linux & Apache
ISBN: 0975240226
EAN: 2147483647
Year: 2006
Pages: 92

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net