Manually compile and install Apache Lab Preparation: 1.VMwore 12 Red Hat 6.5 virtual machine one 2. Related packages: Apr, apr-util, httpd Note: Apache official website Download http://www.apache.org/ Download the required packages for the experiment and extract them to the specified folder
``
I. Apache installation 1. First unpack the package HTTP, Apr, apr-util (support Apache Upper application cross-platform, provide the underlying interface library) to the/OPT directory
Tar xzvf http-2.4.2.tar.gz-c/opt
Tar xzvf apr-1.4.6.tar.gz-c/opt
(Support Apache Upper application cross-platform, provide the bottom interface library)
Tar xzvf apr-util-1.4.1.tar.gz-c/opt
2. Go to the package directory and copy the APR and Apr-util packets to the HTTPD directory
Cp-r APR/OPT/HTTPD-2.4.2/SRCLIB/APR
Cp-r Apr-util/opt/httpd-2.4.2/srclib/apr-util
3. Installation of GCC, gcc-c++, make, Pcre, pcre-devel four packs
Yum install gcc gcc-c++ make pcre pcre-devel-y
4. Enter the HTTPD directory and configure the Configure
cd/opt/httpd-2.4.2
5. Configuration
./configure \
--prefix=/usr/local/apache \
--ENABLE-SO \
--enable-rewrite \
--enable-mods-shared=most \
--with-mpm=worker \
--disable-cgid \
--disable-cgi
6. Compiling and installing
Make && make install
7. Filter out the comment lines (#) and copy the httpd service file to/etc/init.d/
Grep-v "#"/usr/local/apache/bin/apachectl >/ETC/INIT.D/HTTPD
8. Modify the configuration file vim/etc/init.d/httpd insert the following line at the bottom of the article
#!/bin/sh
chkconfig:2345 15description:apache is a world Wide Web server
9. Add execute permissions to the httpd file
chmod +x/etc/init.d/httpd
10. Add the HTTDP service, set to Init3, init5 to boot from.
Chkconfig--add httpd
Chkconfig--list httpd
Chkconfig--level httpd on
11. Create soft links for/etc/httpd.conf files for post-management purposes
Ln-s/usr/local/apache/conf/httpd.conf/etc/httpd.conf
12. Modify the configuration file httpd.conf
vim/etc/httpd.conf
Listen: #监听IP地址, modify this to your local IP address.
ServerName: hostname. Domain Name
13. Restart the httpd service
Service httpd Shop
Service httpd Start
14. Turn off the firewall
Service Iptables Stop
Setenforce 0
Final Test if the interface shows that Apache has been installed successfully, and the Home store path is/usr/local/apache/htdocs/index.html can edit this file to modify the content on the home page
Install Apache manually under Linux environment