The/etc/httpd/conf/httpd.conf and/usr/local/apache2/conf/httpd.conf differences between Apache

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.