You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by jeff00seattle <je...@earthlink.net> on 2009/04/24 22:13:48 UTC

[users@httpd] Understand "httpd -t -D DUMP_VHOSTS"

Presented is the output of httpd -t -D DUMP_VHOSTS. 

Why does every NameVirtualHost reference its configuration twice; one for
the default server and the other for the port #### namevhost?
And why do all NameVirtualHost(s) have a default server reference, which
seems conflicting.

httpd -t -D DUMP_VHOSTS Output:
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443          localhost (/etc/httpd/conf.d/ssl.conf:81)
*:8085                 is a NameVirtualHost
         default server project_site.admin.8085
(/etc/httpd/conf/extras/virtual-host.project_site.admin.8085.conf:23)
         port 8085 namevhost project_site.admin.8085
(/etc/httpd/conf/extras/virtual-host.project_site.admin.8085.conf:23)
*:8080                 is a NameVirtualHost
         default server project_site.dev.8080
(/etc/httpd/conf/extras/virtual-host.project_site.dev.8080.conf:28)
         port 8080 namevhost project_site.dev.8080
(/etc/httpd/conf/extras/virtual-host.project_site.dev.8080.conf:28)
*:80                   is a NameVirtualHost
         default server project_site.demo.80
(/etc/httpd/conf/extras/virtual-host.project_site.demo.80.conf:35)
         port 80 namevhost project_site.demo.80
(/etc/httpd/conf/extras/virtual-host.project_site.demo.80.conf:35)

Thanks

Jeff in Seattle
-- 
View this message in context: http://www.nabble.com/Understand-%22httpd--t--D-DUMP_VHOSTS%22-tp23224080p23224080.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Understand "httpd -t -D DUMP_VHOSTS"

Posted by Krist van Besien <kr...@gmail.com>.
On Fri, Apr 24, 2009 at 10:13 PM, jeff00seattle
<je...@earthlink.net> wrote:
>
> Presented is the output of httpd -t -D DUMP_VHOSTS.
>
> Why does every NameVirtualHost reference its configuration twice; one for
> the default server and the other for the port #### namevhost?
> And why do all NameVirtualHost(s) have a default server reference, which
> seems conflicting.
>
> httpd -t -D DUMP_VHOSTS Output:
> VirtualHost configuration:
> wildcard NameVirtualHosts and _default_ servers:
> _default_:443          localhost (/etc/httpd/conf.d/ssl.conf:81)
> *:8085                 is a NameVirtualHost
>         default server project_site.admin.8085
> (/etc/httpd/conf/extras/virtual-host.project_site.admin.8085.conf:23)
>         port 8085 namevhost project_site.admin.8085
> (/etc/httpd/conf/extras/virtual-host.project_site.admin.8085.conf:23)
> *:8080                 is a NameVirtualHost
>         default server project_site.dev.8080
> (/etc/httpd/conf/extras/virtual-host.project_site.dev.8080.conf:28)
>         port 8080 namevhost project_site.dev.8080
> (/etc/httpd/conf/extras/virtual-host.project_site.dev.8080.conf:28)
> *:80                   is a NameVirtualHost
>         default server project_site.demo.80
> (/etc/httpd/conf/extras/virtual-host.project_site.demo.80.conf:35)
>         port 80 namevhost project_site.demo.80
> (/etc/httpd/conf/extras/virtual-host.project_site.demo.80.conf:35)

You have three ports with one host one each. You're not using name
based virtual hosts at all, but have defined "NameVirtualHost" for
each of your ports.
Therefore apache will list for each port:
- De default vhost
- All defined vhosts.

Because you only have one virtualhost defined per port it gets
menioned twice, that is all.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Understand "httpd -t -D DUMP_VHOSTS"

Posted by André Warnier <aw...@ice-sa.com>.
jeff00seattle wrote:
> Presented is the output of httpd -t -D DUMP_VHOSTS. 
> 
> Why does every NameVirtualHost reference its configuration twice; one for
> the default server and the other for the port #### namevhost?
> And why do all NameVirtualHost(s) have a default server reference, which
> seems conflicting.
> 
...
Jeff,
I think your question as asked is too complex, there are too many things 
at once, and you do not provide enough information to answer.
(First, can you tell what Apache version this is, on which platform, and 
initially installed how ?)

Another part that is a bit mysterious (to me at least), is why you would 
have Apache answering on several ports, specially if some of these ports 
do not even appear to be accessible from anywhere else but localhost.
(A reference to your other post "Remote Browsing of Other Ports than 
Port 80")
That greatly complicates the issue, maybe for no reason.
Can you eliminate these other ports, and just leave Apache answering on 
port 80, or is there some reason for the other ones ?
(If your sites have different DNS names, it is not really necessary to 
also have different ports)

An example :
evm2:~# /usr/sbin/apache2ctl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
          default server evm2.domain1.com 
(/etc/apache2/sites-enabled/.default:1)
          port 80 namevhost evm2.domain1.com 
(/etc/apache2/sites-enabled/.default:1)
          port 80 namevhost maf.domain1.com 
(/etc/apache2/sites-enabled/MAF:1)
          port 80 namevhost bsp.domain2.net 
(/etc/apache2/sites-enabled/MIR:1)
          port 80 namevhost qa.domain2.net 
(/etc/apache2/sites-enabled/NYC:1)
          port 80 namevhost sales.domain3.net 
(/etc/apache2/sites-enabled/WIS:1)
Syntax OK

The same, commented :

All these virtual hosts answer requests on port 80.

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost

(means that Apache has found a line "NameVirtualHosts *:80"


          default server evm2.domain1.com 
(/etc/apache2/sites-enabled/.default:1)

That is the "default" server (the one used for requests to port 80, 
where Apache cannot really figure out for which hostname it is. It 
corresponds either to a section explicitly saying
<VirtualHost _default_:80>
or just to the first-occurring <VirtualHost *:80> section
)

          port 80 namevhost evm2.domain1.com 
(/etc/apache2/sites-enabled/.default:1)

corresponds to a section like
<VirtualHost *:80>
ServerName evm2.domain1.com
...
</VirtualHost>
It defines the Virtual Host handling requests to "evm2.domain1.com"

          port 80 namevhost maf.domain1.com 
(/etc/apache2/sites-enabled/MAF:1)

corresponds to a section like
<VirtualHost *:80>
ServerName maf.domain1.com
...
</VirtualHost>
It defines the Virtual Host handling requests to "maf.domain1.com"

etc...

          port 80 namevhost bsp.domain2.net 
(/etc/apache2/sites-enabled/MIR:1)
          port 80 namevhost qa.domain2.net 
(/etc/apache2/sites-enabled/NYC:1)
          port 80 namevhost sales.domain3.net 
(/etc/apache2/sites-enabled/WIS:1)
Syntax OK


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org