码迷,mamicode.com
首页 > Web开发 > 详细

源码包Apache的shell安装脚本

时间:2018-10-09 17:06:42      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:apr   util   install   idf   pid   sasl   network   exe   config   

#!/bin/bash
#安装apache
rpm -e httpd --nodeps
yum -y install apr apr-devel cyrus-sasl-devel expat-devel libdb-devel openldap-devel apr-util-devel apr-util pcre-devel pcre
tar zxf /httpd- -C /usr/src
#必须将httpd-
放在/下
cd /usr/src/httpd-
./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi
make && make install
ln -s /usr/local/httpd/bin/
/usr/local/bin
echo "[Unit]" > /lib/systemd/system/httpd.service
echo "Description=The Apache HTTP Server" >> /lib/systemd/system/httpd.service
echo "After=network.target" >> /lib/systemd/system/httpd.service
echo "[Service]" >> /lib/systemd/system/httpd.service
echo "Type=forking" >> /lib/systemd/system/httpd.service
echo "PIDFile=/usr/local/httpd/logs/httpd.pid" >> /lib/systemd/system/httpd.service
echo "ExecStart=/usr/local/bin/apachectl $OPTIONS" >> /lib/systemd/system/httpd.service
echo "ExecReload=/bin/kill -HUP $MAINPID" >> /lib/systemd/system/httpd.service
echo "KillMode=process" >> /lib/systemd/system/httpd.service
echo "Restart=on-failure" >> /lib/systemd/system/httpd.service
echo "RestartSec=42s" >> /lib/systemd/system/httpd.service
echo "[Install]" >> /lib/systemd/system/httpd.service
echo "WantedBy=graphical.target" >> /lib/systemd/system/httpd.service
systemctl enable httpd.service
sed -i ‘200c ServerName www.aaa.com:80‘ /usr/local/httpd/conf/httpd.conf
systemctl restart httpd.service

源码包Apache的shell安装脚本

标签:apr   util   install   idf   pid   sasl   network   exe   config   

原文地址:http://blog.51cto.com/14010760/2296266

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!