?? 將后安裝的apache服務器設置為和缺省安裝一樣的自啟動和手工啟動(轉).txt
字號:
作者:snout
日期:2000-12-12 14:22:19
如何將后安裝的apache服務器設置為和缺省安裝一樣的自啟動和手工啟動:
在redhat6.2環境下,編輯文件/etc/rc.d/init.d/functions將:
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin“
修改為:
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/apache/bin"
其中后面的/usr/local/apache/bin為你的apache的安裝路徑
然后在/etc/rc.d/init.d中創建文件內容為:
#!/bin/sh
#
# Startup script for the Apache Web Server
#
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server. It is used to serve
# HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /etc/httpd/conf/access.conf
# config: /etc/httpd/conf/httpd.conf
# config: /etc/httpd/conf/srm.conf
# Source function library.
. /etc/rc.d/init.d/functions
# See how we were called.
case "$1" in
start)
echo -n "Starting httpd: "
daemon httpd
echo
touch /var/lock/subsys/httpd
;;
stop)
echo -n "Shutting down http: "
killproc httpd
echo
rm -f /var/lock/subsys/httpd
rm -f /var/run/httpd.pid
;;
status)
status httpd
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n "Reloading httpd: "
killproc httpd -HUP
echo
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
然后修改該文件的執行權限為:chmod +x httpd
然后就可以通過/etc/rc.d/init.d/httpd start 來察看是否能正確的啟動httpd
若可以,則通過命令chkconfig來設置apache自啟動:
chkconfig --level 35 httpd on
即可
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -