Apache HTTP Server is an outstanding representative of open source software, which provides Web browsing services based on standard HTTP network protocols, and Apache servers can run on a variety of operating system platforms such as Linux UNIX windows. The main features of Apache
- Open Source Code
- Cross-platform applications
- Supports a variety of Web programming languages
- Modular design
- Very stable operation
- Good security
Environment deployment
- redhat6.5 system
- IP Address: 192.168.100.101
- Related packages: Baidu Cloud
1. Check if the system installs the HTTPD service, if it is uninstalled.
2. Create a directory to mount the shared Apache package on the host
# mkdir /abc# mount.cifs //192.168.100.3/linux /abc# ls /abc/LAMPapr-1.4.6.tar.gz apr-util-1.4.1.tar.gzhttpd-2.4.2.tar.gz
3. Unzip the Apache package to/opt
# tar zxvf httpd-2.4.2.tar.gz -C /opt# tar zxvf apr-1.4.6.tar.gz -C /opt# tar zxvf apr-util-1.4.1.tar.gz -C /opt
4. Copy the unpacked package to/opt/httpd-2.4.2/srclib and change the name to Apr and Apr-util respectively.
# cp -R apr-1.4.6/ httpd-2.4.2/srclib/apr# cp -R apr-util-1.4.1/ httpd-2.4.2/srclib/apr-util
5.yum Installation Related Environment pack
# yum install gcc gcc-c++ make perl pcre-devel expat-devel libxml2-devel -y
6. Configure the Software module
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
Configuration information
./configure --prefix=/usr/local/apache \ 安装路径--enable-so \ 启动内核--enable-rewrite \ 启动重写功能--enable-mods-shared=most \ 模块共享--with-mpm=worker \ 用户多进程--disable-cgid \ 通用网关接口--disable-cgi
7. Compiling the installation
# make && make install
8. Filter Apachectl # Redirect to/etc/init.d/httpd (startup script)
# grep -v "#" /usr/local/apache/bin/apachectl > /etc/init.d/httpd # vi /etc/init.d/httpd 在开头插入下面 #!/bin/sh # chkconfig:2345 85 15 # description:Apache is a World Wide Web server.
9. Turn on Execute permissions for httpd scripts, add services
# chmod +x /etc/init.d/httpd //给httpd开启执行权限# chkconfig --add httpd //添加httpd服务# chkconfig --list httpd //查看httpd服务# chkconfig --level 35 httpd on //把httpd服务的3 5开启
10. Create a soft connection for httpd.conf easy to manage
# ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf# vim /etc/httpd.confListen:192.168.100.101:80 //修改监听IP#Listen:80 #ipv6的需要关闭ServerName www.benet.com:80 //修改域名
11. Restart the httpd service, turn off the firewall
# service httpd stop# service httpd star# service iptables stop # setenforce 0
12. Modify the home page content test
echo "
Apache manually compiled installation (with package included)