Restart Httpd Server
Q. I'm using CentOS / RHEL / Fedora Linux server and I'd like to restart my httpd server after making some changes to httpd.conf file. How do I restart httpd?
A. You can use service command to restart httpd. Another option is use /etc/init.d/httpd service script.
Login as root user and type the following commands:
Task: Start httpd server:
# service httpd start
Task: Restart httpd server:
# service httpd restart
Task: Stop httpd server:
# service httpd stop
Please note that restart option is a shorthand way of stopping and then starting the Apache HTTPd Server. You need to restart server whenever you make changes to httpd.conf file. It is also good idea to check configuration error before typing restart option:
# httpd -t
# httpd -t -D DUMP_VHOSTS
Sample output:
Syntax OK
Now restart httpd server:
# service httpd restart
Where,
- -t : Run syntax check for config files
- -t -D DUMP_VHOSTS : Run syntax check for config files and show parsed settings only for vhost.
/etc/init.d/httpd script
You can also use following command:
# /etc/init.d/httpd restart
# /etc/init.d/httpd start
# /etc/init.d/httpd stop
A note about Debian / Ubuntu Linux
Type the following command under Debian / Ubuntu Linux:
# /etc/init.d/apache2 restart
# /etc/init.d/apache2 stop
# /etc/init.d/apache2 start
You can also use service command under Debian / Ubuntu Linux:
# service apache2 restart
# service apache2 stop
# service apache2 start
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- Use sudo or sudoers to start, stop & restart Apache
- LimitRequestBody: Apache Limiting User Upload File Size
- Disable SELinux for only Apache / httpd in Linux
- Apache name based VirtualHost example
- Apache Web Server .htaccess File Configuration Not working
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: /etc/init.d/httpd, apache httpd server, configuration error, fedora linux, restart apache web server, restart httpd, server service, service command, stop apache web server, stop httpd, syntax check ~ Last updated on: April 18, 2008




Recent Comments
Today ~ 17 Comments
Today ~ 2 Comments
Today ~ 37 Comments
Today ~ 46 Comments
Yesterday ~ 2 Comments