First, the experimental environment
Install Apache on Linux system and test
Second, the operation of the script
1. CD mount
Cd/mnt
Ls
Mount/dev/sr0/mnt
2. Create a Yum repository
Cd/etc/yum.repos.d
Vim Aaa.repo
---[AA]
---name=test
---baseurl=file:///mnt
---enabled=1
---gpgcheck=0
Ls
Rm-rf
Yum List
3. File Share mount
Smbclient-l//192.168.119.2/
mkdir/bbb
Mount.cifs//192.168.119.2/JOHN/BBB
4. Decompression of compressed packets
cd/bbb
Ls
Tar xzvf httpd-2.4.2.tar.gz-c/opt
Tar xzvf apr-1.4.6.tar.gz-c/opt
Tar xzvf apr-util-1.4.1.tar.gz-c/opt
5. Recursive replication
Cd/opt
Cp-r APR-1.4.6/OPT/HTTPD-2.4.2/SRCLIB/APR
Cp-r Apr-util-1.4.1/opt/httpd-2.4.2/srclib/apr-util
6. Install the Environment pack
Yum install gcc gcc-c++ make pcre-devel-y
7. Perform a manual compilation of the installation configuration
cd/opt/httpd-2.4.2
./configure \--prefix=/usr/local/apache \ \ \
--ENABLE-SO \ \
--enable-rewrite \ \
--enable-mods-shared=most \ \
--with-mpm=worker \ \
--disable-cgid \ \
--disable-cgi
Make
Make install
8. Enable manual compilation of installation script files
Grep-v "#"/usr/local/apache/bin/apachectl >/ETC/INIT.D/HTTPD
Vim/etc/init.d/httpd
> #!/bin/sh
> > ##### # chkconfig:2345 85 15
> > ##### # Description:apache is a world Wide Web server.
9. Increase the execution authority of/ETC/INIT.D/HTTPD
chmod +x/etc/init.d/httpd
10. Add httpd service and turn on
Chkconfig--add httpd
Chkconfig--list httpd
Chkconfig--level httpd on
11. Establish a soft connection for easy management
Ln-s/usr/local/apache/conf/httpd.conf/etc/httpd.conf
12. Go to/etc/httpd.conf Profile Editor
Vim/etc/httpd.conf
> Listen 192.168.119.101:80
> ##### # Listen 80
> ServerName www.benet.com:80
13. Turn on httpd service
Service httpd Start
14. Turn off firewall and enhanced security features
Service Iptables Stop
Setenforce 0
15. View Home Content
Vim/usr/local/apache/htdocs/index.html
16. Access virtual machine (Linux) with 360 browser
Http://192.168.119.101
Three, the experimental steps illustrated
Iv. Results of the experiment
The results show that: manually compiled and installed Apache is successful, such as
Manually compile and install Apache