• 欢迎访问VPS岛网站,国外VPS,国内VPS,国外服务器,国内服务器,服务器主机,测评及优惠码,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站 QQ群

apache安装脚本

Apache技术 俗人linux 79次浏览 已收录 0个评论

#!/bin/bash

tar xf /usr/local/src/apr-1.5.2.tar.gz

tar xf /usr/local/src/apr-util-1.5.4.tar.gz

tar xf /usr/local/src/zlib-1.2.8.tar.gz

tar xf /usr/local/src/pcre-8.39.tar.gz

tar xf /usr/local/src/openssl-1.0.1u.tar.gz

tar xf /usr/local/src/httpd-2.4.23.tar.gz

cd /usr/local/src/apr-1.5.2/

echo  "install apr"

./configure –prefix=/usr/local/apr &> /dev/null

make &> /dev/null && make install &> /dev/null

echo "install apr-until"

cd /usr/local/src/apr-util-1.5.4

./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr &> /dev/null

make &> /dev/null && make install &> /dev/null

echo "install zlib"

cd /usr/local/src/zlib-1.2.8/ 

./configure –prefix=/usr/local/zlib &> /dev/null

make &> /dev/null && make install &> /dev/null

echo "install pcre"

cd /usr/local/src/pcre-8.39

./configure –prefix=/usr/local/pcre &> /dev/null

make &> /dev/null && make install &> /dev/null

# echo "install openssl"

# cd /usr/local/src/openssl-1.0.1u 

# ./config -fPIC –prefix=/usr/local/openssl enable-shared &> /dev/null

# make &> /dev/null && make install &> /dev/null

# mv /usr/bin/openssl /usr/bin/openssl.1.0.1e 

# ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

echo "install httpd"

cd /usr/local/src/httpd-2.4.23

./configure –prefix=/usr/local/http –enable-so –enable-cgi –enable-cgid  –enable-ssl –with-ssl=/usr/local/openssl –enable-rewrite –with-pcre=/usr/local/pcre –with-z=/usr/local/zlib –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util –enable-modules=most –enable-mods-shared=most –enable-mpms-shared=all –with-mpm=event –enable-proxy –enable-proxy-fcgi –enable-expires –enable-deflate &> /dev/null

make &> /dev/null && make install &> /dev/null

ln -s /usr/local/http/bin/* /usr/local/bin

cp /usr/local/http/bin/apachectl /etc/init.d/httpd

sed -i ' 200c ServerName www.benet.com:80' /usr/local/http/conf/httpd.conf

sed -i '2c  # chkconfig: 35 85 15' /etc/init.d/httpd

sed -i '2a # description: apache 2.4.23' /etc/init.d/httpd

/etc/init.d/httpd start 

ps -ef |grep httpd

systemctl  daemon-reload

systemctl restart httpd

systemctl enable httpd

firewall-cmd –add-port=80/tcp –permanent

firewall-cmd –reload


VPS岛 的文章和资源来自互联网,仅作为参考资料,如果有侵犯版权的资源请尽快联系站长,我们会在24h内删除有争议的资源。丨 转载请注明apache安装脚本
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址