标签:start sha http 方法 bin module 添加 root profile
**centos6 编译安装httpd-2.4方法一5.编译安装httpd-2.4
cd ../httpd-2.4.29
[root@CentOS6 /app/httpd-2.4.29 67]# ./configure --prefix=/app/httpd24 \
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-rewrite \
--with-zlib \
--with-pcre \
--with-apr=/app/apr/ \
--with-apr-util=/app/apr-util/ \
--enable-modules=most \
--enable-mpms-shared=all \
--with-mpm=prefork \
make -j 4 && make instal6.导出环境变量:
echo ‘PATH=/app/httpd24/bin/:$PATH‘ > /etc/profile.d/httpd24.sh
. /etc/profile.d/httpd24.sh8.ps aux 查看因为是编译安装默认apache是以daemon用户的身份运行;
创建账号:
useradd -r -s /sbin/nologin apache
修改配置文件:
vim /app/httpd24/conf/httpd.conf
170 User apache
171 Group apache
wq
重启服务9.设置开机启动:
确定本机是否有httpd开机自启服务有的话需要停止否则会冲突;
chkconfig --list httpd
chkconfig httpd On /Off
echo "/app/httpd24/bin/apachectl start" >> /etc/rc.d/rc.local (免写脚本)
测试:
vim /etc/init.d/httpd(修改启动脚本:建议自己写)
42 apachectl=/app/httpd24/bin/apachectl
43 httpd=${HTTPD-/app/httpd24/bin/httpd}
44 prog=httpd
45 pidfile=${PIDFILE-/app/httpd24/logs/httpd.pid}
46 lockfile=${LOCKFILE-/var/lock/subsys/httpd24}
编译安装区别改名:
mv httpd httpd24
添加服务:chkconfig --add httpd24
查看:
chkconfig --list
设置开机启动:
chkconfig httpd24 on**
标签:start sha http 方法 bin module 添加 root profile
原文地址:http://blog.51cto.com/37003839/2066745