如何查看完整的httpd配置? [英] How can I view the complete httpd configuration?
问题描述
我想弄清楚什么是完整的httpd设置配置。
I'm trying to figure out what is the full complete configuration of an httpd setup.
所有配置文件分散在不同的文件中(/etc/httpd/conf.d,httpd.conf,各种mod配置)
All the configurations files are scattered in different files (/etc/httpd/conf.d, httpd.conf, various mod configs)
有没有办法列出最终的httpd配置?
像单个文件中整个运行的安装配置一样?
Is there a way to list the final httpd configuration?
Like the whole running setup configuration in a single file?
推荐答案
如arco444所述,您可以使用 apachectl -S
显示从配置当前运行的VirtualHosts的概述, code> apachectl -M 以显示所有当前加载的模块 - 我不知道在启动时显示所有已解析配置的详细输出(以及它们被解析的顺序)的工具的httpd,但我建议您熟悉 httpd配置文件的一般结构。
As noted by arco444, you can use apachectl -S
to display an overview of the VirtualHosts currently running from the configs, and apachectl -M
to display all currently loaded modules - I'm not aware of a tool to display the verbose output of all configs parsed (and which order they were parsed in) at launch of httpd, but I would recommend that you familiarise yourself with the general structure of the httpd config files.
您的问题特别注意:'main'apache配置文件位于 /etc/httpd/conf/httpd.conf
- 按字母顺序,所以你会想要熟悉自己的配置文件解析在某些时候的重要性,如果可能的话。 (在从包含在CentOS 6中的repos的默认httpd安装的第221行的区域中,我假设您使用的是基于您的帖子标签),并且'补充'配置文件位于
这是在子目录<$ c $中包含扩展 /etc/httpd/conf.d
并且需要明确包含在主配置文件中。例如,如果在 httpd.conf
文件中搜索术语' Include
', code> Include conf.d / *。conf .conf
c> conf.d
Of particular note to your question: the 'main' apache config file is located in /etc/httpd/conf/httpd.conf
(in the region of line 221 on a default httpd installation from the repos included in CentOS 6, which I assume you are using based on your post tags), and the 'supplementary' config files are located in /etc/httpd/conf.d
and require to be included explicitly in the main config file. For example, if you search the httpd.conf
file for the term 'Include
', you will find the line Include conf.d/*.conf
which is what includes all files of extension .conf
in the subdirectory conf.d
- in alphabetical order, so you will want to familiarise yourself with the importance of config file parsing at some point if possible.
另外,如果您使用的是基于shell的文本编辑器,如vim,我建议您启用行编号和语法高亮默认情况下,这样冗长的配置文件更容易解析自己和导航 - 在vim的情况下,您可以通过在您的主目录中创建一个名为 .vimrc
的文件(或附加到现有的)并添加以下行:
As an aside, if you are using a shell based text editor such as vim, I suggest that you enable line numbering and syntax highlighting by default so that such lengthy config files are a bit easier to parse yourself and navigate - in the case of vim, you'd do so by creating a file in your home directory called .vimrc
(or append to an existing one) and add the following lines:
set nu
syntax on
这篇关于如何查看完整的httpd配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!