How do I start / stop or restart Apache web sever via SSH (secure shell) under Linux or UNIX operating systems?
Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following command to login to remote server called server1.cyberciti.biz using the ssh client:
Once logged in switch to the root user by typing su - and entering the root password, when prompted:
To restart Apache 2 web server over the ssh, enter:
To stop Apache 2, enter:
To start Apache 2, enter:
If you are using RHEL / CentOS / Fedora based server, enter:
To stop RHEL / CentOS / Fedora based Apache server, enter:
To start RHEL / CentOS / Fedora based Apache server, enter:
$ ssh user@server1.cyberciti.bizOnce logged in switch to the root user by typing su - and entering the root password, when prompted:
$ su -To restart Apache 2 web server over the ssh, enter:
# /etc/init.d/apache2 restartTo stop Apache 2, enter:
# /etc/init.d/apache2 stopTo start Apache 2, enter:
# /etc/init.d/apache2 startIf you are using RHEL / CentOS / Fedora based server, enter:
# service httpd restartTo stop RHEL / CentOS / Fedora based Apache server, enter:
# service httpd stopTo start RHEL / CentOS / Fedora based Apache server, enter:
# service httpd start
Aucun commentaire:
Enregistrer un commentaire