编译安装apache
1、下载wget http://apache.dataguru.cn//httpd/httpd-2.4.4.tar.gz
2、下载编译安装apr
wget?http://mirror.bjtu.edu.cn/apache//apr/apr-1.4.8.tar.gz
./configure –prefix=/usr/local/apr-1.4.8?
3、下载编译安装apr-util ?with apr
wget?http://mirror.bjtu.edu.cn/apache//apr/apr-util-1.5.2.tar.gz
./configure –prefix=/usr/local/apr-util-1.5.2 –with-apr=/usr/local/apr-1.4.8
4、安装所需组件
yum install pcre-devel.i686?perl-devel.i686
5、编译安装./configure –enable-so –enable-mods-shared=all –with-mpm=worker –with-apr=/usr/local/apr-1.4.8/ –with-apr-util=/usr/local/apr-util-1.5.2/
6、服务安装
cp /usr/local/apache-2.4.4/bin/apachectl /etc/init.d/apache2
vi?/etc/init.d/apache2
#!/bin/sh后面添加
# chkconfig: 2345 85 15
# description: Apache2
chkconfig –add apache2
7、开端口
防火墙规则
vi /etc/sysconfig/iptables
编辑配置,在
-A INPUT -j REJECT –reject-with icmp-host-prohibited
之前加入
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
service iptables restart
?
常用命令:
<span style="fon