How to Start/Stop Apache Using Centos Linux
  • By Frank Geraci
  • October 31, 2017

Our Blog

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!

Click to Contact Us

Frank Geraci
Frank Geraci
Frank started Webbege in 2010 after a lifetime of designing websites and online marketing campaigns. He loves to swim, bike, and run when he is not slaving away behind the computer. Frank’s commitment to standards, industry knowledge and ability to push through, until the job is done, is rare. The web has changed a lot since the late 90's and Frank takes a lifetime of experience to create effective online marketing campaigns.