You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Rose, John B" <jb...@utk.edu> on 2016/01/28 18:03:41 UTC

[users@httpd] Command line method to get virtual hosts and DocumentRoot?

Is there a command line method to list all the virtual hosts and each DocumentRoot?

Httpd -S

Just gives the name and the .conf file.

Thanks

Re: [users@httpd] Command line method to get virtual hosts and DocumentRoot?

Posted by Yehuda Katz <ye...@ymkatz.net>.
The best way I know of to do this is with mod_info and then you have two
options:
1. Run "httpd -DDUMP_CONFIG" and parsing the output. This has the downside
of not merging or overriding repeated directives.
2. curl (or similar) http://localhost/server-info and parse that output.

- Y

On Thu, Jan 28, 2016 at 12:03 PM, Rose, John B <jb...@utk.edu> wrote:

> Is there a command line method to list all the virtual hosts and each
> DocumentRoot?
>
> Httpd –S
>
> Just gives the name and the .conf file.
>
> Thanks
>

Re: [users@httpd] Command line method to get virtual hosts and DocumentRoot?

Posted by "Rose, John B" <jb...@utk.edu>.
Thanks Yehuda and Pete

On 1/28/16 1:31 PM, "Pete Houston" <ph...@openstrike.co.uk> wrote:

>On Thu, Jan 28, 2016 at 05:03:41PM +0000, Rose, John B wrote:
>> Is there a command line method to list all the virtual hosts and each
>>DocumentRoot?
>
>Should be pretty simple to construct with Apache::ConfigParser.
>https://metacpan.org/pod/Apache::ConfigParser
>
>Pete
>-- 
>Openstrike - improving business through open source
>http://www.openstrike.co.uk/ or call 01722 770036


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Command line method to get virtual hosts and DocumentRoot?

Posted by Pete Houston <ph...@openstrike.co.uk>.
On Thu, Jan 28, 2016 at 05:03:41PM +0000, Rose, John B wrote:
> Is there a command line method to list all the virtual hosts and each DocumentRoot?

Should be pretty simple to construct with Apache::ConfigParser.
https://metacpan.org/pod/Apache::ConfigParser

Pete
-- 
Openstrike - improving business through open source
http://www.openstrike.co.uk/ or call 01722 770036