You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ra...@itdz-berlin.de on 2006/02/28 17:18:23 UTC

[users@httpd] Why doesn't Apache bind socket to vhost's IP addr.?

Hello,

I think I have a flaw in my httpd.conf somewhere,
but the httpd syntax check isn't complaining.

I use this httpd release on Fedora 3

# /usr/sbin/httpd -v
Server version: Apache/2.0.52
Server built:   Oct 15 2004 11:39:29

and it's a DSO build as supplied from Fedora 3

# /usr/sbin/httpd -l
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c


This box has several NICs, of which two are used as private LAN
interconnects of cluster nodes
while one NIC is multihomed where one IP is the node's address
while the other is the application's (viz. webserver's) public
address.

I slightly modified apachectl to be -DVHOST switch aware.

In the main httpd.conf I thus have this inclusion

# sed -n 1103,1105p /etc/httpd/conf/httpd.conf
<IfDefine VHOST>
    Include conf.d/vhosts.conf
</IfDefine>


Because this webserver is also run with mod_ssl which I guess
per default is configured to run as a vhost,
in the module loading section close to the top of httpd.conf
mod_vhost is loaded irrespectible whether -DVHOST is passed or
not

# grep -A1 -B1 -in ^loadmodule\ vhost /etc/httpd/conf/httpd.conf
175-LoadModule dav_fs_module modules/mod_dav_fs.so
176:LoadModule vhost_alias_module modules/mod_vhost_alias.so
177-LoadModule negotiation_module modules/mod_negotiation.so


While the vhost container for mod_ssl is included pretty early

# grep -A1 -B1 -in 'include.*ssl.conf' /etc/httpd/conf/httpd.conf
220-<IfDefine SSL>
221:    Include conf.d/ssl.conf
222-</IfDefine>

the other vhost container is included as late as in line 1104
(see above)

This IP based vhost is configured very basically with only those
directives 
used which I considered minimally mandatory

# cat /etc/httpd/conf.d/vhosts.conf
<VirtualHost 192.168.2.2:80>
    ServerName  tintin_ic1:80
    ServerAdmin root@localhost
    DocumentRoot /var/www/apache/html
    CustomLog   logs/ic1.log common
    ErrorLog    logs/ic1_error.log
    LogLevel    debug
</VirtualHost>


As said the configtest is syntactically correct
which can easily be verified by putting some junk chars
in the above vhost container file.

Nevertheless, when I start the webserver I see no listening
socket
for this vhost's IP address,
but only those for the publich IP (ports 80 and 443).

I raised the LogLevel to debug but in error_log the only virtual
host
entries that appear on startup relate to the SSL container.

What have I missed?

Regards
Ralph

---------------------------------------------------------------------
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] Why doesn't Apache bind socket to vhost's IP addr.?

Posted by Joshua Slive <jo...@slive.ca>.
On 2/28/06, Ralph.Grothe@itdz-berlin.de <Ra...@itdz-berlin.de> wrote:
>
> # cat /etc/httpd/conf.d/vhosts.conf
> <VirtualHost 192.168.2.2:80>
>     ServerName  tintin_ic1:80
>     ServerAdmin root@localhost
>     DocumentRoot /var/www/apache/html
>     CustomLog   logs/ic1.log common
>     ErrorLog    logs/ic1_error.log
>     LogLevel    debug
> </VirtualHost>
>
>
> As said the configtest is syntactically correct
> which can easily be verified by putting some junk chars
> in the above vhost container file.
>
> Nevertheless, when I start the webserver I see no listening
> socket
> for this vhost's IP address,
> but only those for the publich IP (ports 80 and 443).
>
> I raised the LogLevel to debug but in error_log the only virtual
> host
> entries that appear on startup relate to the SSL container.
>
> What have I missed?

Listen 192.168.2.2:80

Joshua.

---------------------------------------------------------------------
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