编译apache2.4.7

1.下载httpd-2.4.7.tar.gz
[root@gyf soft]# wget http://apache.dataguru.cn//httpd/httpd-2.4.7.tar.gz
2.解压
[root@gyf soft]# tar xvf httpd-2.4.7.tar.gz
[root@gyf soft]# cd  httpd-2.4.7
[root@gyf httpd-2.4.7]# vim INSTALL

  $ ./configure --prefix=PREFIX
     $ make
     $ make install
     $ PREFIX/bin/apachectl start

3.编译安装apr
[root@gyf soft]# wget http://mirrors.cnnic.cn/apache//apr/apr-1.5.0.tar.gz
[root@gyf soft]# cd apr-1.5.0
[root@gyf apr-1.5.0]# ./configure --prefix=/etc/apr
 [root@gyf apr-1.5.0]#make && make install
4.编译安装apr-util
[root@gyf soft]# wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.5.3.tar.gz
[root@gyf soft]# cd apr-util-1.5.3
[root@gyf soft]#./configure --prefix=/etc/apr-util --with-apr=/etc/apr
 [root@gyf soft]#make && make install
5.编译安装httpd
[root@gyf httpd-2.4.7]# ./configure  --prefix=/usr/local/httpd --sysconfdir=/usr/local/httpd/conf/  --enable-so --enable-rewirte --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mpms-shared=all --with-apr=/etc/apr --with-apr-util=/etc/apr-util
[root@gyf httpd-2.4.7]#make && make install

--prefix= :指定安装目标路径
--sysconfdir= :指定配置文件安装位置
--enable-so :支持动态共享模块,如果没有这个模块PHP将无法与apache结合工作
--enable-rewirte :支持URL重写
--enable-ssl :启用支持ssl
--enable-cgi :启用支持cgi
--enable-cgid :启用支持带线状图形的CGI脚本 MPMs
--enable-modules=most :安装大多数模块
--enable-modules-shared=most :安装大多数共享模块
--enable-mpms-shared=all :支持全部多道处理方式
--with-apr=/etc/apr :指定apr路径
--with-apr-util=/etc/apr-util :指定apr-util路径

6.apache自启动
#cp /usr/local/httpd/bin/apachectl /etc/rc.d/init.d/httpd      #把apache加入到系统启动
cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd   
#!/bin/sh
#chkconfig:2345 10 90
#descrption:Activates/Deactivates Apache Web Server
chmod +x /etc/init.d/httpd  
chkconfig --add httpd
/etc/init.d/httpd start
#设置开机启动
chkconfig httpd on  

转载于:https://my.oschina.net/u/1458120/blog/209042

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值