1. Go to the/usr/local/src/directory and download the Apache installation package httpd-2.2.29.tar.gz
[Email protected] support-files]# CD/USR/LOCAL/SRC
[[email protected] src]# ls
Httpd-2.2.9.tar.gz
2. Unzip the installation package
[Email protected] src]# tar zxvf httpd-2.2.9.tar.gz
3. Go to the installation directory
[Email protected] src]# CD httpd-2.2.9
[[email protected] httpd-2.2.9]# ls
About_apache changes include modules Srclib
ACINCLUDE.M4 config.layout INSTALL NOTICE Support
APACHE.DSW Configure INSTALLBIN.DSP Nwgnumakefile test
Apachenw.mcp.zip configure.in LAYOUT os VERSIONING
Build Docs libhttpd.dsp README
BUILDALL.DSP Emacs-style LICENSE readme.platforms
BUILDBIN.DSP HTTPD.DSP makefile.in Roadmap
buildconf httpd.spec Makefile.win Server
4. View the installation instructions file install to see the installation steps
......
$./configure--prefix=prefix
$ make
$ make Install
$ prefix/bin/apachectl Start
......
5. Use the following parameters to configure the installation options, enter
[Email protected] httpd-2.2.9]#/configure--prefix=/usr/local/apache2--with-included-apr--enable-so-- enable-deflate=shared--enable-expires=shared--enable-rewrite=shared--with-pcre
which
--prefix Specifying the installation directory
--WITH-INCLUDE-APR relies on packet Apr, supports HTTPD, can operate across platforms
--with-pcre Regular related libraries
Shared means to be installed in a dynamic shared manner
Error error, missing what library to install:
such as checking whether to enable Mod_deflate ... configure:error:mod_deflate have been requested but can isn't be built due to PR Erequisite Failures
Yum Install Zlib-devel
6. Until the configuration is no problem then start compiling
[[email protected] httpd-2.2.9]# echo $?
0
[[email protected] httpd-2.2.9]# make
7. Compile no problem and start the installation
[[email protected] httpd-2.2.9]# echo $?
0
[[email protected] httpd-2.2.9]# make install
8. Successful Installation
[[email protected] httpd-2.2.9]# echo $?
0
[Email protected] httpd-2.2.9]# ls/usr/local/apache2/
Bin Cgi-bin error icons lib man modules
Build conf htdocs include logs manual
9. It is not yet possible to run directly, you need to edit the Apache master configuration file httpd.conf:
[Email protected] httpd-2.2.9]# vim/usr/local/apache2/conf/httpd.conf
Change the servername to localhost:80 and remove the previous comment symbol #
......
# ServerName gives the name and port, the server uses to identify itself.
# This can often is determined automatically, but we recommend you specify
# It explicitly to prevent problems during startup.
#
# If Your host doesn ' t has a registered DNS name, enter its IP address here.
#
ServerName localhost:80
......
10. Add Apache to the system environment variable:
[Email protected] support-files]# vim/etc/profile.d/path.sh
#!/bin/bash
Export path= $PATH:/etc/init.d/:/usr/local/mysql/bin/:/usr/local/apache2/bin/
[Email protected] support-files]# source/etc/profile.d/path.sh
11. Check that the configuration is correct and start Apache correctly
[Email protected] httpd-2.2.9]# apachectl-t
Syntax OK
[[email protected] httpd-2.2.9]# apachectl start
HTTPD (PID 22581) already running
12. View Apache's processes and ports
[Email protected] httpd-2.2.9]# PS aux|grep httpd
[Email protected] httpd-2.2.9]# NETSTAT-LNP
Lamp Construction 2:apache Installation