Apache默认安装httpd.conf在哪里?

时间:2020-12-16 16:51:21

I thought Apache's httpd.conf is typically located at /etc/httpd/conf/httpd.conf. But for my installation as described below on Centos 6.4, it is located at /usr/local/apache2/conf/httpd.conf. On top of that, DocumentRoot is set to /usr/local/apache2/htdocs instead of the traditional /var/www/html.

我认为Apache的httpd.conf通常位于/etc/httpd/conf/httpd.conf。但对于我在Centos 6.4上所述的安装,它位于/usr/local/apache2/conf/httpd.conf。最重要的是,DocumentRoot设置为/ usr / local / apache2 / htdocs而不是传统的/ var / www / html。

Where is the most common location for these to be located? If different than what I am showing, what did I do wrong? Thank you

这些位置最常见的位置在哪里?如果与我所展示的不同,我做错了什么?谢谢

First I did the following:

首先,我做了以下事情:

  1. Unpack Apache 2.4.4 to /usr/local/src
  2. 将Apache 2.4.4解压缩到/ usr / local / src

  3. Unpack APR 1.4.6 to /usr/local/src/httpd-2.4.4/srclib/apr
  4. 将APR 1.4.6解压缩到/usr/local/src/httpd-2.4.4/srclib/apr

  5. Unpack APR-Util 1.5.2 to /usr/local/src/httpd-2.4.4/srclib /apr-util
  6. 将APR-Util 1.5.2解压缩到/usr/local/src/httpd-2.4.4/srclib / apr-util

  7. Unpack PCRE 8.33 to /usr/local/src
  8. 将PCRE 8.33打包到/ usr / local / src

Then I did the following

然后我做了以下

$ cd /usr/local/src/httpd-2.4.4/srclib/apr
$ ./configure
$ make
$ make install
$ cd /usr/local/src/httpd-2.4.4/srclib/ apr-util
$ ./configure --with-apr=../apr (verify if any other options are desired)
$ make 
$ make install 
$ cd /usr/local/src/pcre-8.33
$ ./configure
$ make 
$ make install 
$ cd /usr/local/src/httpd-2.4.4
$ ./configure --enable-so –enable-rewrite –enable-ssl –with-pcre
$ make 
$ make install 

2 个解决方案

#1


1  

What you did "wrong" was to not read the documentation, which clearly states:

你所做的“错误”是不阅读文档,其中明确指出:

PREFIX must be replaced with the filesystem path under which the server should be installed. If PREFIX is not specified, it defaults to /usr/local/apache2.

必须使用安装服务器的文件系统路径替换PREFIX。如果未指定PREFIX,则默认为/ usr / local / apache2。

However, I put "wrong" in quotes because I cannot find anything wrong with those directories. What's so bad about /usr/local?

但是,我在引号中加了“错误”,因为我找不到这些目录的任何错误。 / usr / local有什么不好的?

#2


0  

There will be no problem with httpd.conf in /usr/local. The only problem will be that others will not be expecting it there so they might become confused. Rest is okay. While compiling you should have mentioned /etc/httpd/conf/httpd.conf, but I will say still its not a problem.

/ usr / local中的httpd.conf没有问题。唯一的问题是其他人不会在那里期待它,所以他们可能会感到困惑。休息没关系。编译时你应该提到/etc/httpd/conf/httpd.conf,但我会说它不是问题。

Do you had any particular reason for compiling Apache and not using yum. If you have used yum, the file would have automatically landed in /etc/httpd/conf/httpd.conf.

你有没有特别的理由编译Apache而不使用yum。如果您使用了yum,该文件将自动登陆/etc/httpd/conf/httpd.conf。

#1


1  

What you did "wrong" was to not read the documentation, which clearly states:

你所做的“错误”是不阅读文档,其中明确指出:

PREFIX must be replaced with the filesystem path under which the server should be installed. If PREFIX is not specified, it defaults to /usr/local/apache2.

必须使用安装服务器的文件系统路径替换PREFIX。如果未指定PREFIX,则默认为/ usr / local / apache2。

However, I put "wrong" in quotes because I cannot find anything wrong with those directories. What's so bad about /usr/local?

但是,我在引号中加了“错误”,因为我找不到这些目录的任何错误。 / usr / local有什么不好的?

#2


0  

There will be no problem with httpd.conf in /usr/local. The only problem will be that others will not be expecting it there so they might become confused. Rest is okay. While compiling you should have mentioned /etc/httpd/conf/httpd.conf, but I will say still its not a problem.

/ usr / local中的httpd.conf没有问题。唯一的问题是其他人不会在那里期待它,所以他们可能会感到困惑。休息没关系。编译时你应该提到/etc/httpd/conf/httpd.conf,但我会说它不是问题。

Do you had any particular reason for compiling Apache and not using yum. If you have used yum, the file would have automatically landed in /etc/httpd/conf/httpd.conf.

你有没有特别的理由编译Apache而不使用yum。如果您使用了yum,该文件将自动登陆/etc/httpd/conf/httpd.conf。