close

(如果想立即開啟或關掉就要用service 或是直接到/etc/init.d/底下去操作)

以下是用來設定在系統開啟時預設要執行的service

在RedHat系列底下可以用chkconfig

啟用httpd(如果已經加到chkconfig裡了 就可以不用輸入第一行)

chkconfig httpd --add
chkconfig http on

 

停用httpd(第二行是把httpd從chkconfig的管理中移除 我的建議是輸入第一行就好了)

chkconfig httpd off
chkconfig httpd --del

 

在Debian或Ubuntu底下的話 可以用update-rc.d

開啟apache2

update-rc.d apache2 defaults

關掉apache2

update-rc.d -f apache2 remove

至於前面提到的service 這裡提供一些簡單的範例(找不到這個指令的話可以用套件管理找找看)

service開啟httpd

service httpd start

用service關閉httpd

service httpd stop

 

參考網址:

http://linuxhelp.blogspot.com/2006/04/enabling-and-disabling-services-during_01.html (設定較詳細)

arrow
arrow
    文章標籤
    linux
    全站熱搜

    卡卡 發表在 痞客邦 留言(0) 人氣()