linux要求关闭httpd服务,Apache2.4.4的安装及实现service和chkconfig系统控制httpd开启关闭...
Apache2.4.4的安裝及實現service和chkconfig系統控制httpd開啟關閉
不廢話了,根據apache2.4.4的手冊我們知道還要有三個準備包,如下
:? apr-1.4.6.tar.bz2? apr-uti-1.5.1.tar.bz2和pcre-8.32.tar.bz2
安裝apr
# tar -jxvf apr-1.4.6.tar.bz2
# cd apr-1.4.6
# ./configure --prefix=/usr/local/apr
# make
# make install
# make clean all
安裝apr-util
# tar -jxvf apr-util-1.5.1.tar.bz2
# cd apr-util-1.5.1
# ./configure --prefix=/usr/local/apr-util
--with-apr=/usr/local/apr
# make
# make install
# make clean all
安裝pcre
# tar jxvf pcre-8.32.tar.bz2
# cd pcre-8.32
# ./configure --prefix=/usr/local/pcre
# make
# meke install
安裝apache2.4.4
# tar -jxvf httpd-2.4.4.tar.bz2
將apr-1.4.6 拷貝到httpd-2.4.4/srclib/apr文件夾
將apr-util-1.5.1 拷貝到httpd-2.4.4/srclib/apr-util文件夾
# cp -rf apr-1.4.6 httpd-2.4.4/srclib/apr
# cp -rf apr-util-1.5.1 httpd-2.4.4/srclib/apr-util
# ./configure --prefix=/usr/local/apache2.4.4 --enable-so --enable-mods-shared=most --with-mpm=worker --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --with-included-apr
# make && make install && make clean all
下面是將lib庫加入到系統自動查找的默認庫當中:
root@rhel5 ld.so.conf.d]# ll /etc/ld.so.conf.d
-rw-r--r-- 1 root root 20 Sep? 5? 2007 qt-i386.conf
[root@rhel5 ld.so.conf.d]# vim apache2.4.4.conf //在上面的目錄下新建一個文件并編輯洗出庫路徑
/usr/local/apache2.4.4/lib
然后進入到、etc/init.d/ 下編寫一個httpd的腳本,別忘了把它變成可執行
哦(chmod a+x httpd),就是實現service和chkconfig系統控制httpd開啟關閉的腳本:
#!/bin/bash
#description: httpd server
#chkconfig: - 90 90? ? ? ? ? ? ? ? ? ? ? ? ? //這兩行是實現chkconfig控制的關鍵
#difine path
HTTP='/usr/local/apache2.4.4/bin/httpd'
CONF='/usr/local/apache2.4.4/conf/httpd.conf'
. /etc/init.d/functions
#start
start () {
echo -n "httpd is starting...."
sleep 1
$HTTP? -f $CONF
[? $? -eq 0 ] &&touch /var/lock/subsys/http && echo -e "It is \033[31m OK \033[0m" || echo -e "It is \033[31m? FAIL \033[0m"
}
#stop
stop (){
echo -n "httpd is stoping...."
sleep 1
killproc $HTTP && rm -rf /var/lock/subsys/http || echo -e "It is \033[31m FAIL \033[0m "
}
#restart
restart (){
[ -f /var/lock/subsys/http ] && echo "httpd is runing" && exit
stop
start
}
case $1 in
start )
start
;;
stop )
stop
;;
restart )
restart
;;
* )
echo "Usag:? start|stop|restart"
;;
esac
到這就結束了,小編沒有截圖,相信有點基礎的都能看懂吧
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的linux要求关闭httpd服务,Apache2.4.4的安装及实现service和chkconfig系统控制httpd开启关闭...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux 挂载多余空间,linux 空
- 下一篇: spring 整合quartz