How to stop/start/restart apache server using command [Ubuntu]


Stop Start or Restart Apache Server on Ubuntu

If you have web application hosted on apache HTTP web server on a Linux server (say Ubuntu) and you want to know how to stop/start or restart the server, you can follow the below commands,

1. Command to start apache server:

# sudo service apache2 start

 * Starting Apache httpd web server apache2

AH00558: apache2: Could not reliably determine the server's 
fully qualified domain name, using 172.17.0.2. 
Set the 'ServerName' directive globally to suppress this message *

2. Command to stop apache server:

# sudo service apache2 stop 

 * Stopping Apache httpd web server apache2 *

3. Command to restart apache server:

# # sudo service apache2 restart

 * Restarting Apache httpd web server apache2

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, 
using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[ OK ]
Advertisements
Try Out Code2care Dev Tools:

Advertisements

Advertisements
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.