Platform: virtual centos6.6 on VMware
Guest Host: Windows
Before installing Apache, prepare:
1. Check if the configuration file for the HTTPD service already exists in the environment, the default storage path:/etc/httpd/httpd.conf (This is an ENT version of the CentOS preinstalled Apache, typically we install the source code version of Apache). If/etc/httpd/httpd.conf is already present, uninstall or close the Web service that comes with the CentOS system, execute the command:chkconfig httpd off, or change the 80 port of the httpd service from CentOS to another port, as long as it does not conflict with the port of the Apache service we install.
Stop and uninstall the HTTPD service that comes with your Linux system:
1. Service httpd Stop
2, Ps-ef | grep httpd
3, kill-9 PID number (delete one by one)
4, Rpm-qa |grep httpd
5. RPM-E httpd Package
1 [root@bogon /]# Find/-name httpd.conf2 [root@bogon /]#
2, download Apache installation package (httpd-2.4.3.tar.gz or httpd-2.2.23.tar.gz),: http://httpd.apache.org/
When I installed Apache, I installed it separately for different versions, which were different at compile time and configure followed by different parameters.
httpd-2.2.23 version compile command:
1 ./configure--prefix=/usr/Local/apache2 (after installation directory parameters can be installed without any parameters, direct installation)2make 3 make install
httpd-2.4.3 version compile command:
1 ./configure--prefix=/usr/local/apache2--with-apr=/usr/local/apr--with-apr-util=/ usr/local/apr-util/--with-pcre=/usr/local/pcre (in addition to specifying Apache's installation directory, install APR, apr-util, Pcre, and specify parameters)2make3 make install
During the compilation of Apache (problems encountered when installing httpd-2.4.3), there were issues such as APR not found, apr-util not found, and pcre-config for Libpcre not found. The following is a httpd-2.4.3 of these problems solved to practical operation.
http://apr.apache.org/download.cgi Download apr-1.4.5.tar.gz, apr-util-1.3.12.tar.gz
Http://sourceforge.net/projects/pcre/files/latest/download Download Pcre-8.31.zip
1. Solving Apr not found problem
1 [Root @bogon /]# tar-zxf apr-1.4.5.tar.gz 2 [ Root @bogon apr-1.4 . 5 ]# /configure--prefix=/usr/local/ Apr 3 [Root @bogon Apr-1.4 . 5 ] # make 4 [Root @bogon apr-1.4 . 5 ] # make install
2. Solve Apr-util not found problem
1[Root@bogon/]#tar-zxf apr-util-1.3.12.tar.gz2[Root@bogonapr-util-1.3. A]#./configure--prefix=/usr/local/apr-util-with-apr=/usr/local/apr/bin/apr-1-config3[Root@bogonapr-util-1.3. A]# Make4[Root@bogonapr-util-1.3. A]#Make Install
3, solve pcre-config for libpcre not found problem
1 [root@bogon /]# unzip pcre-8.31.zip2 [root@bogon / ]# cd pcre-8.313 [root@bogon pcre-8.31]# . Configure--prefix=/usr/local/pcre4 [root@bogon pcre-8.31]# Make[[email protected] pcre-8.31]# make install
-bash:make:command not found occurs when performing make estimates,
is because the installation system is used to minimize the mini installation, the system does not install make, vim and other common commands, direct yum installation can be.
Yum-y install gcc automake autoconf libtool make
If/etc/httpd/httpd.conf is already present, uninstall or close the Web service that comes with the CentOS system, execute the command: Chkconfig httpd off, or change the 80 port of the httpd service from CentOS to a different port. As long as it does not conflict with the port of the Apache service we install.
• Starting Apache:/usr/local/apache2/bin/apachectl start
• Stop Apache:/usr/local/apache2/bin/apachectl Stop
• Restart Apache:/usr/local/apache2/bin/apachectl restart
The website is placed in the/usr/local/apache2/htdocs directory
In IE through http://localhost:80, if you see "It works!" displayed on the page The word, the Apache authentication is passed. If the index suffix of the Web site is in PHP format, modify the httpd.conf configuration file (/usr/local/apache2/conf) and add index.php to the DirectoryIndex.
# # Directoryindex:sets The file that Apache would serve if a directory# is requested.#<ifmodule dir_module>< c2> indexindex. PHP</IfModule>
Install, configure, and launch Apache under Linux