One: Experimental requirements
1: Learn to compile and install HTTPD server
2: Familiar with the deployment process and common configuration of httpd service
3: Learn to build Awstats Log Analysis System
Access Control for 4:HTTPD services
Address restrictions for clients
User Authorization Restrictions
5: Building a virtual web host
Domain-based virtual host
Virtual host based on IP address, port
Second: Experimental environment
1. Installation package
Apr-util-1.4.1.tar
Apr-1.4.6.tar
Httpd-2.4.2.tar
2. Server
Linux6.5
Yum Warehouse
Three: Experimental steps
- Uninstall the original HTTPD service
Yum Remove httpd
2. Share host Folder
3. Mount the shared folder for Linux use
4. Unzip
5. Copy the compressed package for easy invocation
6. Install the build Environment gcc-c++ make and regular expression packages
Process=image/watermark,size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_ zmfuz3pozw5nagvpdgk= "alt=" build one of the lamp architecture, Apache build. "/>
7. Execute the Configure script and related commands under httpd-2.4.2
Order explained in detail
--prefix=/usr/local/apache \ Setting Installation location
--ENABLE-SO \ Let Apache core to be installed in DSO
--enable-rewrite \ Enable override feature
--enable-mods-shared=most \ Dynamic Compilation of most commonly used modules
--with-mpm=worker \--with-mpm=prefork|worker|event Apache's three MPM models
--disable-cgid \ Prohibit execution of CGI scripts with an external CGI daemon
--disable-cgi Disable compiling CGI versions of PHP
8. Turn the compilation program into an executable program and install
make && make install
9. Create an executable httpd script
10. Grant permissions, add httpd service, open port
11. Set the soft link and modify the configuration
12. Turn on httpd service
13. Turn off security components and firewalls
14 Modify page display text and access
In this way, a successful Apache service is built on Linux.
Now let's share some of the relevant contents of the script.
Yum Remove httpd
SUMCLIENT-L//Host binding Vmnet address/
MOUNT.CIFS//host-bound Vmnet address/shared folder/opt/lamp
Tar xzvf http-2.4.2.tar.gz-c/opt
Tar xzvf apr-1.4.6.tar.gz-c/opt (supports Apache upper application cross-platform, provides the bottom interface library)
Tar xzvf apr-util-1.4.1.tar.gz-c/opt
Cp-r Apr (unpacked folder)/OPT/HTTPD-2.4.2/SRCLIB/APR
Cp-r Apr-util (unzipped folder)/opt/httpd-2.4.2/srclib/apr-util
Installation of GCC, gcc-c++, make, pcre-devel four packs
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
Grep-v "#"/usr/local/apache/bin/apachectl >/ETC/INIT.D/HTTPD
Vi/etc/init.d/httpd
Insert the following line at the front of the file
#!/bin/sh
chkconfig:2345 85 15
# description:Apache is a World Wide Web server.
chmod +x/etc/init.d/httpd
Chkconfig--add httpd
Chkconfig--list httpd
Chkconfig--level httpd on
Establish a soft connection for easy management
Ln-s/usr/local/apache/conf/httpd.conf/etc/httpd.conf (Note: A soft connection uses an absolute path)
Listen:ipv4
ServerName: hostname. Domain Name
Service httpd Stop
Service httpd Start
Setenforce 0
Service Iptables Stop
Home Store Path is/usr/local/apache/htdocs/index.html
Build one of the lamp architecture, Apache build.