涓€閿儴缃瞐pache
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了涓€閿儴缃瞐pache相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/c_1__1_' title='c++'>c++
lib httpd script 缂栬瘧 perl list pcr config 涓€閿儴缃瞐pache
#!/bin/bash
read -p "璇疯緭鍏ttpd婧愮爜鍖呮墍鍦ㄧ粷瀵硅矾寰?" a
cd $a
echo "----寮€濮嬪畨瑁?---"
tar xjvf httpd-2.4.29.tar.bz2
tar xzvf apr-1.6.2.tar.gz
tar xzvf apr-util-1.6.0.tar.gz
mv apr-1.6.2 httpd-2.4.29/srclib/apr
mv apr-util-1.6.0 httpd-2.4.29/srclib/apr-util
echo "----瀹夎缂栬瘧鍣ㄥ拰鍏跺畠宸ュ叿-----"
cd /var/run
rm -rf yum.pid
yum -y install gcc gcc-c++ make pcre-devel expat-devel perl
cd /opt/httpd-2.4.29/
./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi
make
make install
cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
sed -i 鈥?a# chkconfig: 35 85 21 //35绾у埆鑷姩杩愯 绗?5涓惎鍔?绗?1涓叧闂€?/etc/init.d/httpd
sed -i 鈥?a# description: Apache is a World Wide Web server鈥?/etc/init.d/httpd
chkconfig --add httpd
b=$(ifconfig ens33 |tr -s 鈥?鈥?: |cut -d: -f3 |sed -n 鈥?p鈥?
sed -i 鈥?1cListen 鈥?b鈥?80鈥?/usr/local/httpd/conf/httpd.conf
sed -i 鈥?2s/^/#/鈥?/usr/local/httpd/conf/httpd.conf
ln -s /usr/local/httpd/conf/httpd.conf /etc/
ln -s /usr/local/httpd/bin/* /usr/local/bin/
service httpd start > /dev/null
echo "apache鏈嶅姟宸插畨瑁呮垚鍔燂紒"
以上是关于涓€閿儴缃瞐pache的主要内容,如果未能解决你的问题,请参考以下文章