自動停工和再開始亞帕基印第安人HTTPD服務邪魔在被預先設定的時刻
所有網站、blogs、網服務和Web應用程序核心組分是網絡服務器。 并且亞帕基印第安人是供給網站動力全世界的最普遍的http服務器。 保證是重要的亞帕基印第安人服務或邪魔正常運行時間和連續運行在服務器,好像HTTPD服務下降,您的網站將是unaccessible對訪客。 除使用監視服務、劇本或者公共事業之外檢查HTTPD邪魔是否是,服務器管理員也有一個選擇週期性地重新開始亞帕基印第安人服務。
停工和再開始亞帕基印第安人在具體間隔時間週期性地幫助保證亞帕基印第安人網服務在頂面山谷情況總跑,不用可能的拱起由堅持連接的內存洩漏和資源的作用。 它也保證網站停工期被限制到下再開始日程表,萬一它是很不幸的亞帕基印第安人不確定地垂懸,并且您的監視服務不可能拾起事件。
到停工和開始自動亞帕基印第安人,我們可以利用crontab (或預定的任務或者任務調度程序在窗口服務器)預定任務當時更喜歡。 簡單地編輯cron工作與根或whell用戶,并且增加在以下線:
m h d m w /usr/local/apache/bin/apachectl再開始
用您的特選的價值替換m、h、d、m和w,他們代表以下意思:
m : 分鐘(0 - 59)
h : 小時(0 - 23)
d : 天月(1 - 31)
m : 月(1 - 12)
w : 天星期(0 - 6) (Sunday=0)
為您要每次發生的可變物,設置它和* (星號)。
例如,殺害亞帕基印第安人邪魔和立刻開始它於上午1點每晚,設置crontab線對:
0 1 ** * /usr/local/apache/bin/apachectl再開始
要重新開始亞帕基印第安人HTTPD服務在週末,例如星期天中午,使用以下cron工作:
0 12 ** 0 /usr/local/apache/bin/apachectl再開始
您在Linux能輸入「人crontab」學會更多關於cron工作或Unix或者FreeBSD/CentOS。 要編輯crontab工作名單,簡單地進入「crontab - e」在殼。 現有的crontab在文本編輯程序將出現,例如GNU nano。 如果這是實際情形,做必要的變化,則按「Ctrl-X」,被「Y」跟隨保存文件,并且跟隨進入新聞接受缺省文件名字。 將安裝新的crontab和實際上立刻。
Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors. Use one of the following command to find out where is Apache installed:
find / apachectl | grep apachectl
whereis apachectl
Some Apache may install in /usr/sbin/apachectl, or you can use the httpd or apachectl symbolic links in /etc/rc.d/init.d/apachectl or /etc/rc.d/init.d/httpd.
IMPORTANT: This is a machine translated page which is provided "as is" without warranty. Machine translation may be difficult to understand. Please refer to original English article whenever possible.
Share and contribute or get technical support and help at My Digital Life Forums.
Related Articles
- Start, Stop and Restart Crond Daemon in Linux
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files
- Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start
- Install mod_evasive for Apache to Prevent DDOS Attacks
- Restart or Shutdown Windows (XP, 2000 and Vista) from Command Line or One-Click Shortcut
- Improve Apache Web Server Security: Use ServerTokens and ServerSignature to Disable Header
- cPanel WHM Failed to Receive Status Information From Apache Error
- Automatically Shutdown Computer With Auto Shutdown Genius
- Apache Status (whm-server-status) in cPanel WebHost Manager Returns Blank Page
































