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
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 4 comments… read them below or add one }
great resource. Thank you for helping us out.
regards,
sysvconfig deb pkg is now not available for Debian Squeeze!
Anyone tried the old lenny stable v0,81 on squeeze?
and about CentOS we use this
/sbin/service httpd start
Thanks a lot man!!!! It really helped me a lot!!!
Thank you!!
:)