自動停工和再開始亞帕基印第安人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.



Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

restart apache - restart httpd - apache shutdown - centos service autostart - apache restart - service apache restart - apache auto restart - centos autostart services - how to restart apache - restart apache service - auto restart apache - crontab restart apache - freebsd apache autostart - apache service restart - service restart apache - apache auto start - apache automatic restart - CentOS autostart httpd - centos httpd autostart - start apache service - auto start apache - shutdown httpd - restart apache centos - shutdown apache - reboot apache - schedule apache restart - cron restart apache - centos apache autostart - cronjob restart apache - centos autostart service - apache httpd shutdown - how to shutdown apache - centos auto restart - Linux Apache Memory Leak - start apache httpd - how to shutdown httpd - cron job to restart apache - cron auto restart apache - starting apache service - centos auto start - Apache restart service - autostart httpd centos - linux shut down apache - set apache to autostart - start apache service+unix+usr/sbin - centos auto start apache - crontab apachectl - httpd shutdown - plesk cron job restart apache - how to start httpd service in linux -