Auto Shutdown and Restart Apache HTTPD Service Daemon at Preset Time Auto shutdown e reiniciar o Apache httpd serviço daemon a hora predefinida
The core component of any websites, blogs, web services and web applications is the web server. O componente central de qualquer sites, blogs, web services e aplicações web é o servidor web. And Apache is the most popular HTTP server that powers the websites worldwide. E Apache é o mais popular servidor HTTP poderes que os sites em todo o mundo. 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. É importante assegurar que o uptime e contínuo funcionamento do Apache serviço ou daemon no servidor, como se HTTPD serviço é baixo, seu site será inacessível aos visitantes. 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. Diferentemente de acompanhamento utilizando serviço, ou script utilitário para verificar se o daemon é HTTPD up, servidor administrador também tem a opção para reiniciar o serviço Apache periodicamente.
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. Encerrar e reiniciar o Apache periodicamente em intervalos específicos contribui para assegurar que o Apache web serviço é sempre a correr em cima entalhe condição, sem efeito de uma eventual fuga de memória e de recursos hogging por conexões persistentes. 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. Importa também garantir que os web sites de paralisação está limitado a reiniciar o próximo calendário, no caso de os sorte que é assim que trava Apache indefinidamente e seu acompanhamento serviço não pode pegar o incidente.
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. Para desligar automaticamente e iniciar o Apache, podemos fazer uso de crontab (ou tarefa programada ou Agendador de tarefas do Windows Server) para agendar a tarefa no momento em que preferir. Simply edit the cron jobs with a root or whell user, and add in the following line: Basta editar o cron empregos com uma raiz ou whell usuário, e em acrescentar a seguinte linha:
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: Substituir m, h, d, m e w com valor de sua preferência, onde representam o seguinte significado:
m: min (0 - 59) m: min (0 - 59)
h: hour (0 - 23) h: hora (0 - 23)
d: day of month (1 - 31) d: dia do mês (1 - 31)
m: month (1 - 12) m: meses (1 - 12)
w: day of week (0 - 6) (Sunday=0) w: dia da semana (0 - 6) (domingo = 0)
For variables that you want to happen every time, set it as * (asterisk). Para as variáveis que você deseja que aconteça a cada momento, defini-lo como * (asterisco).
For example, to kill the Apache daemon and start it immediately at 1 AM every night, set the crontab line to: Por exemplo, para matar o daemon Apache e inicia-lo imediatamente em 1 AM todas as noites, para definir a linha crontab:
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: Para reiniciar o Apache HTTPD serviço no fim de semana, tais como a domingo às 12 horas, use o seguinte cron job:
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. Você pode introduzir "man crontab" para saber mais sobre cron postos de trabalho em Linux / Unix / FreeBSD / CentOS. To edit the crontab job list, simply enter “crontab -e” on the shell. Para editar o crontab trabalho lista, basta digitar "crontab-e" sobre o shell. Existing crontab will appear on a text editor, such as GNU nano. Crontab existentes serão exibidos em um editor de texto, tais como 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. Se for esse o caso, fazer as mudanças necessárias e, em seguida, pressione "Ctrl-X", siga em "Y" para salvar o arquivo, e siga por pressione Enter para aceitar a omissão do nome do ficheiro. The new crontab will be installed and in effect immediately. O novo crontab e serão instalados em vigor imediatamente.
Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors. Note que o caminho para apachectl podem ser diferentes em diferentes variante do Unix, Linux ou BSD sabores. Use one of the following command to find out where is Apache installed: Use um dos seguintes comando para descobrir onde está instalado o Apache:
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. Alguns Apache pode instalar em / usr / sbin / apachectl, ou você pode usar o httpd ou apachectl links simbólicos em / etc / rc.d / init.d / apachectl ou / etc / rc.d / init.d / httpd.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Esta é uma página traduzida máquina que é fornecida "como está" sem garantia. Machine translation may be difficult to understand. A tradução automática pode ser difícil de compreender. Please refer to Por favor, consulte a original English article Inglês original article whenever possible. sempre que possível.
Share and contribute or get technical support and help at Compartilhe e contribuir ou obter suporte técnico e ajudar a My Digital Life Forums Minha vida digital Fóruns .
Related Articles Artigos relacionados
- Start, Stop and Restart Crond Daemon in Linux Iniciar, parar e reiniciar Crond Daemon no Linux
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4 Instalando Web Server no FreeBSD 6,0 a 2,2 Apache, MySQL e 5,0 PHP 5 - Parte 4
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files Iniciando o Apache HTTPD falhou devido a Não consigo abrir ou no Tais mod_bwlimited, mod_log_bytes ou mod_bandwidth Files
- Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start Apache avisar NameVirtualHost *: 80 não tem qualquer erro ao iniciar VirtualHosts
- Install mod_evasive for Apache to Prevent DDOS Attacks Mod_evasive para instalar o Apache para Prevenir Ataques DDoS
- Restart or Shutdown Windows (XP, 2000 and Vista) from Command Line or One-Click Shortcut Reiniciar ou Encerrar o Windows (XP, 2000 e Vista) partir da linha de comando ou One-Click Atalho
- Improve Apache Web Server Security: Use ServerTokens and ServerSignature to Disable Header Melhorar o servidor web Apache segurança: Use ServerTokens e ServerSignature para desativar cabeçalho
- cPanel WHM Failed to Receive Status Information From Apache Error cPanel WHM falhou estado a receber informações de erro Apache
- Apache Status (whm-server-status) in cPanel WebHost Manager Returns Blank Page Status Apache (whm-server-status), em cPanel WebHost Manager Retorna página em branco
- Automatically Shutdown Computer With Auto Shutdown Genius Encerrar computador automaticamente com desligamento automático Genius
































