简体   繁体   中英

Is there a command to display apache vhost config?

I work on a development system that has hundreds of virtual hosts and vhost configs. Manually identifying which file path, hostname and vhost configs are related can be time consuming and may not always produce accurate or complete results.

Is there an Apache command that will display the vhost configurations related to a given hostname or path?

I am afraid there is no such command, but you can use 'apache2ctl -S' (or 'httpd -S', depending on your distribution) to have a list of every Virtual Hosts and where they are defined.

Note that -s is a shorter synonym for '-t -D DUMP_VHOSTS'.

鉴于您的虚拟主机被整齐地组织在文件中,并且这些文件在某种程度上代表了主机名,因此这可能在命令行上有效

grep "DocumentRoot" /etc/apache2/sites-enabled/*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM