Come riavvio un server Web Apache 2 con Debian / Ubuntu / CentOS / RHEL / Fedora Linux o sistemi operativi simili a UNIX? Potete dirmi il comando per avviare o arrestare il server web Apache 2 in esecuzione su Linux?
| Dettagli tutorial | |
|---|---|
| Difficoltà | Facile (rss) | 
| Privilegi di root | Sì | 
| Requisiti | Apache 2 su Linux / Unix | 
| Tempo | 1 m | 
 Apache viene utilizzato principalmente per fornire contenuti statici e pagine Web dinamiche sul World Wide Web . Molte applicazioni Web sono progettate in base allambiente e alle funzionalità fornite da Apache. Apache può essere avviato o riavviato utilizzando uno qualsiasi dei seguenti metodi su sistemi Linux o Unix. 
  
 Per prima cosa, accedi al tuo server web utilizzando il client ssh , se il server non si trova nel tuo data center locale: 
 ssh [email protected] 
 Dopo aver effettuato laccesso, digita i seguenti comandi secondo la tua variante Linux o Unix. 
Comandi specifici di Debian / Ubuntu Linux per avviare / arrestare / riavviare Apache
Puoi utilizzare il servizio o il comando /etc/init.d/ come segue su Debian Linux versione 7.x o Ubuntu Linux versione Ubuntu 14.10 o precedente:
Riavvia il server web Apache 2, inserisci:
 # /etc/init.d/apache2 restart 
 OR 
 $ sudo /etc/init.d/apache2 restart 
 OPPURE 
 $ sudo service apache2 restart 
Per arrestare il server web Apache 2, inserisci:
 # /etc/init.d/apache2 stop 
 OPPURE 
 $ sudo /etc/init.d/apache2 stop 
 OPPURE 
 $ sudo service apache2 stop 
Per avviare il server web Apache 2, inserisci:
 OR 
 $ sudo /etc/init.d/apache2 start 
 OR 
 $ sudo service apache2 start 
Una nota sugli utenti di Debian / Ubuntu Linux systemd
 Utilizzare il seguente comando systemctl su Debian Linux versione 8.x + o Ubuntu Linux versione Ubuntu 15.04+ o successiva: 
 ## Start command ## 
systemctl start apache2.service
## Stop command ##
systemctl stop apache2.service
## Restart command ##
systemctl restart apache2.service
CentOS / RHEL (Red Hat) Linux versione 4.x / 5.x / 6.x o comandi specifici precedenti
 ## Start ## 
service httpd start
## Stop ##
service httpd stop
## Restart ##
service httpd restart
CentOS / RHEL (Red Hat) Linux versione 7.xo comandi specifici più recenti
 La maggior parte delle distribuzioni moderne ora utilizza systemd, quindi è necessario utilizzare il seguente systemctl comando: 
 ## Start command ## 
systemctl start httpd.service
## Stop command ##
systemctl stop httpd.service
## Restart command ##
systemctl restart httpd.service
Alpine Linux avvia / arresta / riavvia Apache 2 utilizzando openrc
 Dobbiamo utilizzare il comando di servizio come utente root: 
 # service apache2 start 
# service apache2 stop
# service apache2 status
# service apache2 restart
 Sessione: 
* Stopping apache2 ... * Starting apache2
Metodo generico per avviare / arrestare / riavviare Apache su Linux / Unix
🐧 Scarica i tutorial più recenti su Linux, Open S ource & DevOps tramite feed RSS o newsletter settimanale via email.
🐧 23 commenti finora … aggiungine uno ↓
| Categoria | Elenco di comandi Unix e Linux | 
|---|---|
| Gestione file | cat | 
| Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 | 
| Utilità di rete | dig • host • ip • nmap | 
| OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 | 
| Gestione pacchetti | apk • apt | 
| Gestione processi | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time | 
| Ricerca | grep • whereis • which | 
| Informazioni utente | gruppi • id • lastcomm • last • l id / libuser-lid • logname • membri • utenti • whoami • who • w | 
| WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |