#!/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
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
shell脚本之sed的使用
sed的具体使用方法
sed 正则 bash -
shell脚本源码编译安装apache
安装lrzsz命令上传压缩包至root用户下rz编辑文件访问网页
shell脚本 源码编译 apache服务 -
rpm包搭建apache的shell脚本
apache的脚本
apache 搭建 shell脚本 -
Apache(httpd)源码包安装
apache(httpd)的源码包安装与编译,以及告错处理;
Apache apache httpd -
shell脚本自动编译安装Apache
shell脚本自动安装Apache
shell apache linux -
LAMP中的apache源码包安装
Linux中LAMP的apache的源码包安装
Linux apache LAMP -
监控apache的shell脚本
#!/bin/bash service httpd status|grep "run">/dev/null &nbs
linux shell 休闲 apache 监控 -
centos下源码包安装Apache
centos下源码包安装Apache
apache CentOS LAMP