Auto Shutdown and Restart Apache HTTPD Service Daemon at Preset Time Automatisk avstängning av datorn och starta om Apache httpd tjänst demonen på förinställd tid
The core component of any websites, blogs, web services and web applications is the web server. Den centrala komponenten i alla webbplatser, bloggar, webbtjänster och webbapplikationer är webbservern. And Apache is the most popular HTTP server that powers the websites worldwide. Och Apache är den mest populära HTTP-server som driver webbplatser världen över. 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. Det är viktigt att se till att upptid och kontinuerlig drift av Apache tjänst eller demonen på servern, som om httpd tjänsten är nere, din webbplats kommer att saknar tillgång till besökarna. 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. Annat än med hjälp av övervakning tjänst, skript eller verktyg för att kontrollera om httpd demonen upp, systemadministratör också har ett val att starta om Apache tjänst regelbundet.
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. Avsluta och starta om Apache regelbundet på specifika intervall bidrar till att säkerställa att Apache Web Service alltid körs i vass villkor, utan effekterna av eventuella minnesläcka och resurs KORTKLIPPNING av beständiga anslutningar. 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. Det också se till att webbplatser ligger nere är begränsad till nästa omstart schema, ifall det är så olycklig att Apache hänger på obestämd tid och din övervakning tjänst kan inte ta upp händelsen.
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. Att lägga ned och börja Apache automatiskt, kan vi använda oss av crontab (eller schemalagd aktivitet eller Schemaläggaren i Windows Server) för att planera uppgiften vid föredrar. Simply edit the cron jobs with a root or whell user, and add in the following line: Helt enkelt redigera cron jobb med en rot eller whell användare och lägga till i följande rad:
mhdmw /usr/local/apache/bin/apachectl restart mhdmw / usr / local / apache / bin / apachectl starta
Replace m, h, d, m and w with value of your preference, where they represent the following meaning: Ersätt m, h, d, m och w med värdet av din smak, där de utgör följande innebörd:
m: min (0 - 59) m: min (0 - 59)
h: hour (0 - 23) H: timme (0 - 23)
d: day of month (1 - 31) d: dagen i månaden (1 - 31)
m: month (1 - 12) m: månad (1 - 12)
w: day of week (0 - 6) (Sunday=0) w: veckodag (0 - 6) (söndag = 0)
For variables that you want to happen every time, set it as * (asterisk). För variabler som ska hända varje gång, som det som * (asterisk).
For example, to kill the Apache daemon and start it immediately at 1 AM every night, set the crontab line to: Till exempel att döda Apache daemon och börja genast på 1 AM varje natt, som den crontab linje till:
0 1 * * * /usr/local/apache/bin/apachectl restart 0 1 * * * / usr / local / apache / bin / apachectl starta
To restart Apache HTTPD service on weekend, such as Sunday 12 noon, use the following cron job: För att starta Apache httpd tjänst på helgen, till exempel söndag 12 kl Använd följande cronjobb:
0 12 * * 0 /usr/local/apache/bin/apachectl restart 0 12 * * 0 / usr / local / apache / bin / apachectl starta
You can input “man crontab” to learn more about cron jobs in Linux/Unix/FreeBSD/CentOS. Du kan mata in "man crontab" att lära sig mer om cron jobb i Linux / Unix / FreeBSD / CentOS. To edit the crontab job list, simply enter “crontab -e” on the shell. Om du vill redigera crontab jobb listan genom att ange "crontab-e" på skalet. Existing crontab will appear on a text editor, such as GNU nano. Befintliga crontab kommer att visas på en textredigerare, till exempel GNU nano. 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. Om så är fallet, göra nödvändiga ändringar, tryck på "Ctrl-X", följa med "Y" för att spara filen och följ av Enter tryck att acceptera standard filnamnet. The new crontab will be installed and in effect immediately. Den nya crontab kommer att installeras och i kraft omedelbart.
Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors. Observera att sökvägen till apachectl kan vara olika på olika varianter av Unix, Linux eller BSD varianter. Use one of the following command to find out where is Apache installed: Använd någon av följande kommando för att få reda på var är Apache installerat:
find / apachectl | grep apachectl find / 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. Vissa Apache får installera i / usr / sbin / apachectl, eller så kan du använda httpd eller apachectl symboliska länkarna i / etc / rc.d / init.d / apachectl eller / etc / rc.d / init.d / httpd.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. VIKTIGT: Detta är en maskin som översatt sida som tillhandahålls "i befintligt skick" utan garanti. Machine translation may be difficult to understand. Maskinöversättning kan vara svårt att förstå. Please refer to Se original English article ursprungliga engelska artikeln whenever possible. när så är möjligt.
Share and contribute or get technical support and help at Dela och bidra eller få teknisk support och hjälp vid My Digital Life Forums Mitt digitala liv forum .
Related Articles Relaterade artiklar
- Automatically Shutdown Computer With Auto Shutdown Genius Automatisk avstängning dator med automatisk avstängning geni
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files Starta Apache httpd misslyckades på grund av Kan inte öppna eller Nej Sådan mod_bwlimited, mod_log_bytes eller mod_bandwidth filer
- Start, Stop and Restart Crond Daemon in Linux Starta, stoppa och återstarta Crond Daemon i Linux
- Restart or Shutdown Windows (XP, 2000 and Vista) from Command Line or One-Click Shortcut Starta eller avstängning Windows (XP, 2000 och Vista) från kommandoraden eller ett klick Genväg
- cPanel Unable or Cannot Start or Restart POP3 Mail Service cPanel gick inte eller går inte att starta eller starta POP3 Mail Service
- Schedule Windows Shutdown with Vista Shutdown Sleep Timer Schema Windows Avsluta med Vista avstängning vilotimer
- Disable Auto-Run and Auto-Play of U3 Smart Drives Launchpad Avaktivera Auto-Run och Auto-Play av U3 Smart Drives Launchpad
- Auto Clean Up Your Folders Periodically Via Auto-Delete Auto rensa upp dina mappar regelbundet via Auto-Ta bort
- Fix Hotspot Shield Bandwidth Exceeded, TCP Connect Wait, Auth Failure or Daemon Start Error Fixa Hotspot Shield bandbredd överskrids, TCP connect vänta, myndig fel eller Daemon Start fel
- Quick Shutdown Your Computer Quick Avsluta din dator

























