I’m using Apache server in CentOS / RHEL / Debian / Ubuntu and I’d like to start, stop or restart my apache server after making some changes to configuration settings. How do I start/stop/restart apache server ?
CentOS / RHEL
If you are using CentOS / RHEL then type the following commands
Start Apache server
# service httpd start
Stop Apache server
# service httpd stop
Restart Apache server
# service httpd start
You can also use following commands:
# /etc/init.d/httpd start # /etc/init.d/httpd stop # /etc/init.d/httpd restart
Please note that restart option is a shorthand way of stopping and then starting the Apache Server. You need to restart server whenever you make changes to configuration settings. It is also good idea to check configuration error before typing restart option:
# httpd -t
Sample outputs
Syntax OK
Debian / Ubuntu
If you are using Debian / Ubuntu then type the following commands
Start Apache server
# service apache2 start
Stop Apache server
# service apache2 stop
Restart Apache server
# service apache2 start
You can also use following commands:
# /etc/init.d/apache2 start # /etc/init.d/apache2 stop # /etc/init.d/apache2 restart
Related Posts:
- How Do I Configure Apache Server To Listen Multiple Ports ?
- How To Install Memcache PHP Extension
- How To Limit File Upload Size On Apache
- How To Enable/Disable Firewall On Centos / RedHat / Fedora
- How to install IPTables on RedHat / Centos Linux