Auto Shutdown and Restart Apache HTTPD Service Daemon at Preset Time Auto Shutdown ja Käynnistä Apache httpd Service Daemon klo Preset Time
The core component of any websites, blogs, web services and web applications is the web server. Keskeisiä osa kaikki sivustot, blogit, web-palveluita ja web-sovellusten Web-palvelimeen. And Apache is the most popular HTTP server that powers the websites worldwide. Ja Apache on suosituin HTTP-palvelin, joka toimivaltuuksia sivustot maailmassa. 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. On tärkeää varmistaa, että käytettävyyttä ja jatkuvissa Apache palvelun tai daemon-palvelimella, niin kuin httpd palvelu ei ole käytössä, sivustosi on unaccessible että vierailijoille. 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. Muu kuin käyttämällä seuranta palvelun komentosarja tai apuohjelma tarkistaa jos httpd daemon on ylhäällä, palvelimen järjestelmänvalvojan on myös valinta käynnistää Apache palvelua säännöllisesti.
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. Sammuta ja käynnistä Apache määräajoin tietyille interval auttaa varmistamaan, että Apache-web-palvelu on aina käynnissä yläpäätä kunnossa, ilman vaikutusta mahdollista muistivuodon ja luonnonvarojen hogging jatkuva yhteys. 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. On myös varmistettava, että Web-sivustot seisokkiaikaa on rajoitettu seuraavan uudelleenkäynnistyksen aikataulussa, vain jos se on niin onneton, että Apache jumittuu loputtomiin ja seuranta palvelua ei voi poimia tapahtumasta.
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. Jos haluat pysäyttää ja käynnistää Apache automaattisesti, voimme hyödyntää crontab (tai Scheduled Task tai Task Scheduler Windows Server) Ajoita tehtävä tuolloin mieluummin. Simply edit the cron jobs with a root or whell user, and add in the following line: Yksinkertaisesti muokata cron työpaikkoja juuriin tai whell käyttäjä, ja lisätä seuraava rivi:
mhdmw /usr/local/apache/bin/apachectl restart mhdmw / usr / local / apache / bin / apachectl restart
Replace m, h, d, m and w with value of your preference, where they represent the following meaning: Korvaa m, h, d, m ja w kanssa arvo teidän parempana, jos ne ovat seuraavat:
m: min (0 - 59) m: min (0 - 59)
h: hour (0 - 23) h: tunti (0 - 23)
d: day of month (1 - 31) d: päivä kuukausi (1 - 31)
m: month (1 - 12) m: kuukausi (1 - 12)
w: day of week (0 - 6) (Sunday=0) w: viikonpäivä (0 - 6) (sunnuntai = 0)
For variables that you want to happen every time, set it as * (asterisk). Muuttujille, jotka haluat tapahtuu joka kerta, asettaa sen * (tähti).
For example, to kill the Apache daemon and start it immediately at 1 AM every night, set the crontab line to: Esimerkiksi tappaa Apache daemon ja käynnistä se heti 1 AM joka yö, aseta crontab rivi:
0 1 * * * /usr/local/apache/bin/apachectl restart 0 1 * * * / usr / local / apache / bin / apachectl restart
To restart Apache HTTPD service on weekend, such as Sunday 12 noon, use the following cron job: Jos haluat käynnistää Apache httpd palvelua viikonloppuna, kuten sunnuntai 12 noon, käytä seuraavaa cron työ:
0 12 * * 0 /usr/local/apache/bin/apachectl restart 0 12 * * 0 / usr / local / apache / bin / apachectl restart
You can input “man crontab” to learn more about cron jobs in Linux/Unix/FreeBSD/CentOS. Voit syöttää "mies crontab" oppia lisää cron työpaikkoja Linux / Unix / FreeBSD / CentOS. To edit the crontab job list, simply enter “crontab -e” on the shell. Voit muokata crontab työpaikkojen luettelo, kirjoita "crontab-e" on the shell. Existing crontab will appear on a text editor, such as GNU nano. Nykyiset crontab näkyvät tekstieditorissa, kuten 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. Jos näin on, tee tarvittavat muutokset ja paina sitten Ctrl-X-, seuranta on "Y", jos haluat tallentaa tiedoston, ja seuraa ja paina Enter painamalla Hyväksy oletusnimi tiedoston nimi. The new crontab will be installed and in effect immediately. Uusi crontab tulee olla asennettuna ja voimaan välittömästi.
Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors. Huomaa, että polun apachectl saattavat olla erilaiset eri versiossa, Unix-, Linux-tai BSD makuja. Use one of the following command to find out where is Apache installed: Käytä yhtä seuraavista komento selville, mistä on Apache asennettu:
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. Jotkut Apache saa asentaa hakemistoon / usr / sbin / apachectl, tai voit käyttää httpd tai apachectl symboliset linkit / etc / rc.d / init.d / apachectl tai / etc / rc.d / init.d / httpd.
IMPORTANT : The page is machine translated and provided "as is" without warranty. TÄRKEÄÄ: Sivua kone käännetään ja tarjotaan "sellaisenaan" ilman takuu. Machine translation may be difficult to understand. Machine translation voi olla vaikea ymmärtää. Please refer to Tutustu original English article alkuperäinen Englanti artikkeli whenever possible. aina kun mahdollista.
Related Articles Aiheeseen liittyviä artikkeleita
- Start, Stop and Restart Crond Daemon in Linux Start, stop ja Käynnistä Crond Daemon Linux
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files Lähtölista Apache httpd epäonnistui johtuen ei voi avata tai ei tällaista mod_bwlimited, mod_log_bytes tai mod_bandwidth Tiedostot
- Automatically Shutdown Computer With Auto Shutdown Genius Automaattisesti Sammuta tietokone Auto Shutdown Genius
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4 Asentaminen Web Server FreeBSD 6.0: n Apache 2.2, MySQL 5.0 ja PHP 5 - Osa 4
- How to Restart (Stop or Start) cPanel Service (cpsrvd) via Telnet or SSH Miten Uudelleenkäynnistysvaatimus (Stop tai Käynnistä) cPanel Service (cpsrvd) via Telnet-tai SSH
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 5 Asentaminen Web Server FreeBSD 6.0: n Apache 2.2, MySQL 5.0 ja PHP 5 - Osa 5
- Request URL /server-status or 404 Page Not Found Apache Error URL-osoitteen / server-status tai 404 Page Not Found Apache Virhe
- Restart or Shutdown Windows (XP, 2000 and Vista) from Command Line or One-Click Shortcut Restart or shutdown Windows (XP, 2000 ja Vista) alkaen Command Line tai One-Click Oikotie
- cPanel Unable or Cannot Start or Restart POP3 Mail Service cPanel ei onnistu tai ei voi alkaa tai Uudelleenkäynnistysvaatimus POP3 Mail Service
- Improve Apache Web Server Security: Use ServerTokens and ServerSignature to Disable Header Parantaa Apache Web Server Security: Käytä ServerTokens ja ServerSignature poistaminen Header









































