您的位置:首页 > 运维架构 > Apache

编译apache2.4.7

2014-03-17 00:00 246 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  编译apache2.4.7