Auto Shutdown and Restart Apache HTTPD Service Daemon at Preset Time Auto Shutdown and Restart Apache httpd שירות שדים בכל זמן קבוע מראש
The core component of any websites, blogs, web services and web applications is the web server. רכיב הליבה של כל אתרי אינטרנט, בלוגים, שירותי אינטרנט ויישומי אינטרנט הוא שרת אינטרנט. And Apache is the most popular HTTP server that powers the websites worldwide. ואת אפצ 'י הוא שרת ה-HTTP הפופולרי ביותר כי כוחות אתרי אינטרנט ברחבי העולם. It's important to ensure that the uptime and continuous running of Apache service or daemon on the server, as if HTTPD service is down, your website will be unaccessible to the visitors. זה חשוב כדי להבטיח זמן פעולה תקינה ורציפה של מפעיל שירות אפאצ 'י או השד על השרת, כאילו שירות httpd הוא למטה, האתר שלך יהיה unaccessible למבקרים. Other than using monitoring service, script or utility to check if the HTTPD daemon is up, server administrator also has a choice to restart the Apache service periodically. למעט באמצעות שירות ניטור, בכתב או השירות כדי לבדוק אם הוא httpd daemon של עד, מנהל השרת גם יש ברירה להפעיל מחדש את שירות אפאצ 'י מעת לעת.
Shutdown and restart Apache periodically at specific interval helps to ensure that Apache web service is always running in top notch condition, without effect of possible memory leak and resource hogging by persistent connections. כיבוי והפעלה מחדש אפאצ 'י תקופתי במרווח מסוים מסייעת להבטיח כי שירות האינטרנט Apache הוא תמיד פועל במצב ברמה הגבוהה ביותר, ללא השפעה של דליפת זיכרון אפשרי משאב hogging ידי קשרים מתמיד. It also ensure that the web sites downtime is limited to the next restart schedule, just in case it's so unlucky that Apache hangs indefinitely and your monitoring service can't pick up the incident. כמו כן, להבטיח כי באתרי אינטרנט השבתה מוגבלת הבא מחדש את לוח הזמנים, רק למקרה זה כל כך חסר מזל כי אפאצ 'י נתקע ללא הגבלת זמן שירות ניטור שלך לא יכול להרים את האירוע.
To shutdown and start Apache automatically, we can make use of crontab (or Scheduled Task or Task Scheduler in Windows Server) to schedule the task at the time prefer. כדי הכיבוי ולהתחיל אפאצ 'י באופן אוטומטי, אנחנו יכולים לעשות שימוש של crontab (או משימות מתוזמנות או מתזמן המשימות ב-Windows Server) כדי לתזמן את המשימה בזמן מעדיף. Simply edit the cron jobs with a root or whell user, and add in the following line: פשוט לערוך את עבודות cron עם שורש או המשתמש whell, וכן להוסיף את השורה הבאה:
mhdmw /usr/local/apache/bin/apachectl restart mhdmw / usr / local / apache / bin / apachectl מחדש
Replace m, h, d, m and w with value of your preference, where they represent the following meaning: החלף מ, ש, ד, ו מ W עם ערך של העדפה שלך, שם הם מייצגים את המשמעות הבאה:
m: min (0 – 59) מ: דקות (0 - 59)
h: hour (0 – 23) ש: שעה (0 - 23)
d: day of month (1 – 31) D: יום בחודש (1 - 31)
m: month (1 – 12) מ: חודש (1 - 12)
w: day of week (0 – 6) (Sunday=0) W: יום בשבוע (0 - 6) (ראשון = 0)
For variables that you want to happen every time, set it as * (asterisk). עבור משתנים כי אתה רוצה שיקרה בכל פעם, להגדיר את זה בתור * (כוכבית).
For example, to kill the Apache daemon and start it immediately at 1 AM every night, set the crontab line to: לדוגמה, כדי להרוג את השד אפאצ 'י להתחיל אותה מיד 1 בכל לילה, להגדיר את קו crontab ל:
0 1 * * * /usr/local/apache/bin/apachectl restart 0 1 * * * / usr / local / apache / bin / apachectl מחדש
To restart Apache HTTPD service on weekend, such as Sunday 12 noon, use the following cron job: הפעלה מחדש של אפאצ 'י שירות httpd בסופי שבוע, כגון 12 יום ראשון בצהריים, להשתמש עבודה cron הבאים:
0 12 * * 0 /usr/local/apache/bin/apachectl restart 0 12 * * 0 / usr / local / apache / bin / apachectl מחדש
You can input “man crontab” to learn more about cron jobs in Linux/Unix/FreeBSD/CentOS. אתה יכול "crontab קלט האיש" כדי ללמוד עוד על עבודות cron ב לינוקס / יוניקס / FreeBSD / CentOS. To edit the crontab job list, simply enter “crontab -e” on the shell. כדי לערוך את רשימת העבודה crontab, פשוט להזין "crontab-E" על הקליפה. Existing crontab will appear on a text editor, such as GNU nano. Crontab קיימות יופיעו על עורך טקסט, כגון ננו גנו. If this is the case, make the necessary changes, then press “Ctrl-X”, follow by “Y” to save the file, and follow by Enter press to accept the default file name. אם זה המקרה, לבצע את השינויים הדרושים, ולאחר מכן הקש "Ctrl-X", פעל לפי "Y" לשמור את הקובץ, ופעל על ידי לחץ על ENTER כדי לקבל את שם קובץ ברירת המחדל. The new crontab will be installed and in effect immediately. Crontab חדש יותקן ולמעשה מיד.
Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors. שים לב כי הדרך apachectl עשויים להיות שונים על גרסה אחרת של יוניקס, לינוקס או BSD טעמים. Use one of the following command to find out where is Apache installed: השתמש אחד של הפקודה הבאה כדי לגלות איפה הוא מותקן אפאצ 'י:
find / apachectl | grep apachectl מצא / apachectl | grep apachectl
whereis 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. כמה אפאצ 'י יכול להתקין ב usr / sbin / apachectl, או שאתה יכול להשתמש בקישורים סמליים httpd apachectl או ב / etc / rc.d / init.d / apachectl או etc / rc.d / init.d / httpd.
IMPORTANT : The page is machine translated and provided "as is" without warranty. חשוב: הדף מכונת תירגם מתפרסם "כמות שהוא" ללא אחריות. Machine translation may be difficult to understand. תרגום מכונה יכול להיות קשה להבין. Please refer to נא עיין original English article המאמר המקורי באנגלית whenever possible. בכל הזדמנות אפשרית.
Related Articles מאמרים קשורים
- Start, Stop and Restart Crond Daemon in Linux התחל, עצור הפעל מחדש Crond שדים ב-Linux
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files החל Apache httpd נכשלה עקב אין אפשרות לפתוח או לא mod_log_bytes כאלה mod_bwlimited, או mod_bandwidth קבצים
- Automatically Shutdown Computer With Auto Shutdown Genius כיבוי המחשב באופן אוטומטי עם גאון Auto Shutdown
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 4 התקנת שרת אינטרנט ב FreeBSD 6.0 עם Apache 2.2, MySQL 5.0 ו-PHP 5 - חלק 4
- How to Disable Linux and Unix Cron Jobs (Crontab) Email Sending איך השבת Linux ו-Unix Cron Jobs (crontab) שליחת דוא"ל
- How to Restart (Stop or Start) cPanel Service (cpsrvd) via Telnet or SSH איך להפעיל מחדש (עצור או התחלה) cPanel שירות (cpsrvd) דרך Telnet או SSH
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 5 התקנת שרת אינטרנט ב FreeBSD 6.0 עם Apache 2.2, MySQL 5.0 ו-PHP 5 - חלק 5
- Request URL /server-status or 404 Page Not Found Apache Error בקשת כתובת / שרת מעמד או 404 דף לא נמצא שגיאה אפאצ 'י
- Restart or Shutdown Windows (XP, 2000 and Vista) from Command Line or One-Click Shortcut הפעלה מחדש או כיבוי של Windows (XP, 2000 ו-Vista) מתוך שורת הפקודה או קיצור One-Click
- cPanel Unable or Cannot Start or Restart POP3 Mail Service cPanel אין אפשרות או אין אפשרות להפעיל מחדש או POP3 Mail Service









































