Webbege Blog

How to Start/Stop Apache Using Centos Linux

Written by Frank Geraci | 25 Mar

Let's set the scene: Maybe you reconfigured your virtual hosts, or maybe you have a memory leak that is killing resources and you need to restart the server. Instead of rebooting the VM, you can simply restart Apache! Using terminal (MAC OS) or Putty (Windows), you can begin by logging into your server via ssh.

Assuming you have permissions, let's get started! It's as simple as using the service command to get the job done.

Linux Centos

Starting Apache

service httpd start

Stopping Apache

service httpd stop

Restart Apache

service httpd restart

Sometimes restarting apache will give you errors. This could be from a misconfiguration of your virtual host or something more serious. It is always good practice to check your configuration before you restart!

Check Syntax for Config Files

httpd -t

Check Syntax and showed parsed settings for virtual hosts

httpd -t DUMP_VHOSTS

You may see an output of "Syntax OK"- this is great! You can safely restart apache.

 Have any questions? Don't hesitate to call and ask for guidance!

 

Remember for the best San Diego SEO and San Diego Web Design, trust Webbege with your work!