How To Start / Stop and Restart Apache 2 Web Server Command

How To Start Stop and Restart Apache 2 Web Server Command
How To Start Stop and Restart Apache 2 Web Server Command
5/5 - (4 votes)

How do restart or enable an Apache2 in Debian / Ubuntu / CentOS / RHEL / Fedora Linux or UNIX-like operating systems? follow the command to start or stop Apache 2 web server running on Linux.

First, login to your web server using ssh client, if the server is not in your local data centre:
ssh [email protected] #elyspace box
ssh [email protected] # AWS
ssh [email protected] # My home dev server

Debian/Ubuntu Linux Specific Commands to Start/Stop/Restart Apache

You can either use service or /etc/init.d/ command as follows on Debian Linux version 7.x or Ubuntu Linux version Ubuntu 14.10 or older:

Restart Apache 2 web server, enter:

# /etc/init.d/apache2 restart
OR
$ sudo /etc/init.d/apache2 restart
OR
$ sudo service apache2 restart

To stop Apache 2 web server, enter:

# /etc/init.d/apache2 stop
OR
$ sudo /etc/init.d/apache2 stop
OR
$ sudo service apache2 stop

To start Apache 2 web server, enter:

# /etc/init.d/apache2 start
OR
$ sudo /etc/init.d/apache2 start
OR
$ sudo service apache2 start

Use the following systemctl command on Debian Linux version 8.x+ or Ubuntu Linux version Ubuntu 15.04+ or above:
## Start command ##
systemctl start apache2.service
## Stop command ##
systemctl stop apache2.service
## Restart command ##
systemctl restart apache2.service

We can view status using the following command:
$ sudo systemctl status apache2.service

Total
0
Shares
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Previous Post
How to Install IonCube Loader for WHMCS on Ubuntu

How to Install IonCube Loader for WHMCS on Ubuntu

Next Post
Install Apache2, PHP, and MySql in Ubuntu 21.10

Install Apache2, PHP, and MySql in Ubuntu 21.10

Related Posts
Total
0
Share
0
Would love your thoughts, please comment.x
()
x