Page 1 of 1

Start / Stop / Restart Apache Web Server Via SSH or root

Posted: Thu Nov 26, 2015 7:50 pm
by mach
problems with your server apache..

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

Re: Start / Stop / Restart Apache Web Server Via SSH or root

Posted: Fri Nov 27, 2015 7:12 am
by skurudo
Ehm... what's it it? FAQ or problem? ;-)

If FAQ, then will be helpfull teach use sudo than command... fro

Code: Select all

sudo service apache2 status