To install Apache on Linux (CentOS6.5), first make sure that the following programs are installed beforehand
Apr: The mission of the Apache Portable Runtime (APR) project is to create and maintain
Software libraries that provide a predictable and consistent interface to underlying
Platform-specific implementations. The primary goal is to provide a API to which
Software developers may code and is assured of predictable if not identical behaviour
Regardless of the platform on which their software are built, relieving them of the need
To code special-case conditions to work around or take advantage of platform-specific
Deficiencies or features.
Reference: http://blog.csdn.net/jmshl/article/details/6773731
Apr-util
Pcre: The Perl Compatible Regular Expressions (PCRE) library is a set of functions that implement
Regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE
Have its own native API with addition to a set of POSIX compatible wrapper functions.
Reference: http://www.pcre.org/
The installation steps are as follows:
1. Install Apr
Download : http://apr.apache.org/download.cgi
TAR-ZXVF apr-1.5.2.tar.gz
CD apr-1.5.2
./configure--prefix=/usr/local/apr/
Make
Make install
2, Installation Apr-util
Download: http://apr.apache.org/download.cgi
TAR-ZXVF apr-util-1.5.4.tar.gz
CD apr-util-1.5.4
./configure--prefix=/usr/local/apr-util/--with-apr=/usr/local/apr/
Make
Make install
3, Installation Pcre
Download: Http://sourceforge.net/projects/pcre
Unzip-o Pcre-8.39.zip
CD pcre-8.39
./configure--prefix=/usr/local/pcre
Make
Make install
4. Installing Apache
Download: http://httpd.apache.org/download.cgi
TAR-ZXVF httpd-2.4.20.tar.gz
CD httpd-2.4.20
./configure--prefix=/usr/local/apache2.4.20/--with-apr=/usr/local/apr/--with-apr-util=/usr/local/apr-util/-- With-pcre=/usr/local/pcre
Make
Make install
5. Configuration
Vi/usr/local/apache2.4.20/conf/httpd.conf
6. Start and close
Cd/usr/local/apache2.4.20/bin
./apachectl-k Start
./apachectl-k Stop
./apachectl-k Restart
If listen is defined in the configuration file as the default 80 port (or less than 1024), starting Apache will require root privileges to bind it to a privileged port.
Linux under compile and install Apache