Start / Stop / Restart Apache Web Server Via SSH or root
Posted: Thu Nov 26, 2015 7:50 pm
problems with your server apache..
follow first this script...
follow first this script...
Once logged in switch to the root user by typing su - and entering the root password, when prompted:
ubuntu users type sudo -i
$ su -
To restart Apache 2 web server over the ssh, enter:
# /etc/init.d/apache2 restart
To stop Apache 2, enter:
# /etc/init.d/apache2 stop
To start Apache 2, enter:
# /etc/init.d/apache2 start
If you are using RHEL / CentOS / Fedora based server, enter:
# service httpd restart
To stop RHEL / CentOS / Fedora based Apache server, enter:
# service httpd stop
To start RHEL / CentOS / Fedora based Apache server, enter:
# service httpd start
A Note About apachectl Command
You can also use the apachectl command as follows to restart the apache server:
# apachectl -k restart