Experimental objectives
1. Learn to build Awstats Log Analysis System
2. Learn to compile and install HTTPD server
3. Familiar with the deployment process and common configuration of httpd service
Experimental environment
1. Installation package
Apr-util-1.4.1.tar
Apr-1.4.6.tar
Httpd-2.4.2.tar
Package Baidu Web disk HTTP Link: Https://pan.baidu.com/s/1qrKgLVdeZ6xhnYZEd01KDA Password: a0ka
2. Server
System: Linux6.5 ip:192.168.100.10
The Yum Warehouse is installed
Shared folders mounted under Linux
Experimental steps
First, source code compilation and installation
1. Mount all packages under Linux, no reference to http://blog.51cto.com/13760351/2141215
mount.cifs//192.168.100.8/ww/opt/abc
2. Extract 3 packages to the/OPT directory
tar xzvf httpd-2.4.2.tar.gz-c/opt #解压源码包
tar xzvf apr-util-1.4.1.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, effectively alleviate the number of concurrent connection processes.
3. Replication package for easy invocation
cd/opt
cp-r Apr-util-1.4.1/httpd-2.4.2/srclib/apr-util
cp-r Apr-util-1.4.1/httpd-2.4.2/srclib/apr-util
4. Install the compilation environment and the regular expression package
yum-y Install gcc gcc-c++ pcre pcre-devel zlib-devel #安装组件包 Build a compilation environment
CD httpd-2.4.2/#进入到httpd目录下进行配置, compiling and installing
5. Configuration
--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
6. Compiling and installing
Make && make install #进行编译安装
cd/uar/local/httpd
7. Optimize Execution Path
grep-v "#" Bin/apachectl >/etc/init.d/httpd #优化启动方式, Apache services can be managed using service commands
ln-s/usr/local/httpd/conf/httpd.conf/etc/httpd.conf #在/etc directory to generate a link to the Apache master configuration file for easy management
8. Add httpd system service
vim/etc/init.d/httpd
#!/bin/sh
# chkconfig:2345 #服务识别参数
# Description:apache is a world Wide Web server. #服务描述信息
chmod +x/etc/init.d/httpd #给脚本添加可执行权限
chkconfig--add httpd #将httpd添加为系统服务
chkconfig--list httpd #查看httpd服务自启动状态
chkconfig--level httpd on # httpd level 3,5 start
II. Web Site Deployment
1. Determine the site name, IP address
2. Configure and start the httpd service, see http://blog.51cto.com/13760351/2158118
3. Through DNS resolution, use the domain name to access the Web site, see http://blog.51cto.com/13760351/2158118
4. Authentication (Domain access)
Manually compile and install Apache Web site (source package compilation installation)