First, the question
After installing Apache with Yum, the CentOS system will sometimes fail after restarting, and then go online to find the information, and some say that the restart command is:
/ETC/INIT.D/HTTPD restart
And some, say the restart command should be this:
Service httpd Restart
These two lines of command are different, but in fact the same thing, is to restart the httpd service.
But many times found to change the configuration file, restart does not take effect, and then the online information some let change/etc/httpd/conf/httpd.conf this file, and some let change/usr/local/apache2/conf/httpd.conf file. So which one of these two files is right? What is the difference between these two files?
Second, the difference
These two files are Apache configuration files, but one is the system comes with (/etc/httpd/conf/httpd.conf), one is the Yum installation generated (/usr/local/apache2/conf/httpd.conf).
Iii. Solutions
The above command does not work because the/ETC/INIT.D/HTTPD is used by the system to bring the Apache, but we changed the yum installed Apache configuration file. Now that you know the reason, the solution is simple, there are two ways:
1. Change Apache in/ETC/INIT.D/HTTPD to the one we want to use.
2. Launch Apache under the Apache installation directory to be used, such as executing commands under/usr/local/apache2/bin:
sudo apachectl restart
The/etc/httpd/conf/httpd.conf and/usr/local/apache2/conf/httpd.conf differences between Apache