我的 httpd.conf 是空的 [英] My httpd.conf is empty
问题描述
我最近在 ubuntu 上安装了 apache2,但出现问题,我的 httpd.conf 为空.有人可以给我一份 ubuntu 上 apache2 的 httpd.conf 的干净副本吗?谢谢!
I recently installed apache2 on ubuntu but I have a problem, my httpd.conf is empty. Can someone give me a clean copy of httpd.conf for apache2 on ubuntu? Thanks!
我看到了您的答案,但在 wampserver 上 httpd.conf 不是空的,正如您提到的,它用于用户选项.所以我该怎么做?
I saw your answers but on wampserver httpd.conf is not empty and as you mentioned it is for user options. SO what should I do?
Edit2 :这就是我在 apache2.conf 中得到的内容,如何添加模块、启用 gzip 等等?
Edit2 : That's what I got on my apache2.conf, how I add modules, enable gzip and all of that?
[删除内容,因为它们使问题不可读且无用,因为这是 Ubuntu 下的默认 Apache2 配置.]
推荐答案
/etc/apache2/httpd.conf
在 Ubuntu 中是空的,因为 Apache 的配置驻留在 /etc/apache2/apache2.conf
!
The /etc/apache2/httpd.conf
is empty in Ubuntu, because the Apache configuration resides in /etc/apache2/apache2.conf
!
httpd.conf 用于用户选项."不,它不是,它的存在是出于历史原因.
"httpd.conf is for user options." No it isn't, it's there for historic reasons.
使用 Apache 服务器,所有用户选项都应该放入一个新的 *.conf
文件中 *.conf
代码>/etc/apache2/conf.d/.此方法应该是更新安全的",因为 httpd.conf
或 apache2.conf
可能会在下一次服务器更新时被覆盖.
Using Apache server, all user options should go into a new *.conf
-file inside /etc/apache2/conf.d/
. This method should be "update-safe", as httpd.conf
or apache2.conf
may get overwritten on the next server update.
在/etc/apache2/apache2.conf
里面,你会发现下面一行,其中包含了这些文件:
Inside /etc/apache2/apache2.conf
, you will find the following line, which includes those files:
# Include generic snippets of statements
Include conf.d/
从 Apache 2.4+ 开始,用户配置目录是 /etc/apache2/conf-available/
.使用 a2enconf FILENAME_WITHOUT_SUFFIX
启用新的配置文件或在 /etc/apache2/conf-enabled/
中手动创建符号链接.请注意,从 Apache 2.4 开始,配置文件必须具有后缀 .conf
(例如 conf-available/my-settings.conf
);
As of Apache 2.4+ the user configuration directory is /etc/apache2/conf-available/
. Use a2enconf FILENAME_WITHOUT_SUFFIX
to enable the new configuration file or manually create a symlink in /etc/apache2/conf-enabled/
. Be aware that as of Apache 2.4 the configuration files must have the suffix .conf
(e.g. conf-available/my-settings.conf
);
这篇关于我的 httpd.conf 是空的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!