You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ma...@manfbraun.de on 2010/10/18 12:14:45 UTC
[users@httpd] Host-header from requests are ignored?
Hello !
I read the apache docs [using 2.2.9], but there is a lot of stuff,
which is different in Debian [lenny, 5.0.6].
Apache ignores the host-header given by the browser:
http://x or http://x:81 or http://x.mbg.local are all served, but should be
blocked.
The definition for x stems from my hosts file [which everyone could do this
way].
I am new new to apache, but on my IIS this works as expected.
All browsers act equal [so no browser header problem].
I configured two VirtualHosts, an excerpt:
NameVirtualHost hugo:80
<VirtualHost hugo:80>
DocumentRoot /usr/share/doc
Alias /doc/ /usr/share/doc/
<Directory /usr/share/doc/>
Options Indexes MultiViews FollowSymLinks
Allow from 192.168.24.0/24
</Directory>
</VirtualHost>
The other VirtualHost is configured for port 81.
The I go to my hosts file on any box, and add hugo's ip-address under
the new name x. Then, x is served [with and without specifying a port],
although the host-header in apache is hugo!! Every user coming from
the internet could make the same!
I am out of hope now. Does anyone has any help for me?
Would really very good!
br++mabra
---------------------------------------------------------------------
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] Host-header from requests are ignored?
Posted by Eric Covener <co...@gmail.com>.
> <VirtualHost hugo:80>
That means the virtualhost applies to the IP address hugo resolves to,
it doesn't affect which virtualhost will be used when the client sends
"hugo" in the host header. See the basic doc on name-based vhosts.
---------------------------------------------------------------------
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] Host-header from requests are ignored?
Posted by Eric Covener <co...@gmail.com>.
> Anyway, which host-header I specify - any valid ip-address pointing to this
> machine - strands in the same directory!
http://httpd.apache.org/docs/current/mod/core.html#namevirtualhost
--
Eric Covener
covener@gmail.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] Host-header from requests are ignored?
Posted by Joost de Heer <jo...@sanguis.xs4all.nl>.
> Anyway, which host-header I specify - any valid ip-address pointing to this
> machine - strands in the same directory!
What's the output of 'httpd -S'?
Joost
---------------------------------------------------------------------
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] Host-header from requests are ignored?
Posted by ma...@manfbraun.de.
Hi !
Thanks for your reply!
I read the docs several times and, again today, read several hours tips from
groups in the internet, without any help.
I just now made a VM with debian and put the following in httpd.conf
and left off debians's enabled-sites and available-sites directories:
<VirtualHost *:80>
ServerName wl1
ServerAlias wl1
DocumentRoot /var/www/test80
<Directory /var/www/test80>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order Allow,Deny
Allow from All
</Directory>
LogLevel debug
ErrorLog /var/log/apache2/test80-error.log
CustomLog /var/log/apache2/test80-access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName wl2
ServerAlias wl2
DocumentRoot /var/www/test81
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/test81>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
LogLevel info
ErrorLog /var/log/apache2/error-test81.log
CustomLog /var/log/apache2/test81-access.log combined
</VirtualHost>
<VirtualHost _default_:*>
ServerName localhost
ServerAlias localhost
DocumentRoot /var/www
</VirtualHost>
Anyway, which host-header I specify - any valid ip-address pointing to this
machine - strands in the same directory!
I have really not any clue, what's going wrong. I tried with different ports
also, with no luck. I put the default host on top or on bottom, the result
remains the same.
It looks like apache never sees or acts on the hostheader!
Could you possibly offer more help??
::Eric Covener:I left off the name/ip in the VirtualHost now.
Thanks a lot!!
br++mabra
-----Original Message-----
From: Igor Galic [mailto:i.galic@brainsware.org]
Sent: Monday, October 18, 2010 1:00 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Host-header from requests are ignored?
----- mabra@manfbraun.de wrote:
> Hello !
>
> I read the apache docs [using 2.2.9], but there is a lot of stuff,
> which is different in Debian [lenny, 5.0.6].
>
> Apache ignores the host-header given by the browser:
> http://x or http://x:81 or http://x.mbg.local are all served, but
> should be
> blocked.
> The definition for x stems from my hosts file [which everyone could do
> this
> way].
> I am new new to apache, but on my IIS this works as expected.
> All browsers act equal [so no browser header problem].
>
> I configured two VirtualHosts, an excerpt:
>
> NameVirtualHost hugo:80
>
> <VirtualHost hugo:80>
This looks like bad practice on Apache httpd.
> DocumentRoot /usr/share/doc
> Alias /doc/ /usr/share/doc/
> <Directory /usr/share/doc/>
> Options Indexes MultiViews FollowSymLinks
> Allow from 192.168.24.0/24
> </Directory>
> </VirtualHost>
>
> The other VirtualHost is configured for port 81.
>
> The I go to my hosts file on any box, and add hugo's ip-address under
> the new name x. Then, x is served [with and without specifying a
> port],
> although the host-header in apache is hugo!! Every user coming from
> the internet could make the same!
>
> I am out of hope now. Does anyone has any help for me?
Check http://wiki.apache.org/httpd/ExampleVhosts or
http://httpd.apache.org/docs/current/vhosts/examples.html
out to see some examples for vhosts.
What I prefer to do is something like this:
# Enable name-based virtual hosts for all interfaces, on port 80
NameVirtualHost *:80
# the first listed vhost will be the default vhost,
# it catches all names which do not match:
<VirtualHost *:80>
<Location />
Deny from all
</Location>
# Alternatively, you could use mod_rewrite to send 410, as per RFC.
</VirtualHost>
<VirtualHost *:80>
ServerName Hugo
</VirtualHost>
etc...
> Would really very good!
>
> br++mabra
>
>
>
> ---------------------------------------------------------------------
> 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
--
Igor Galic
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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] Host-header from requests are ignored? [solved]
Posted by ma...@manfbraun.de.
Hi All !
I really have had not understand how far the consistence of properties have
to be driven .....
Now, I have
a) in debians ports.conf:
NameVirtualHost 192.168.26.92:80
b) in httpd.conf:
<VirtualHost 192.168.26.92:80>
#ServerName localhost
#ServerAlias localhost
DocumentRoot /var/www/block
<Directory /var/www/block>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order Allow,Deny
Allow from All ##would just like to see, this is the end!!!
</Directory>
</VirtualHost>
<VirtualHost 192.168.26.92:80>
ServerName wl1
ServerAlias wl1
DocumentRoot /var/www/test80
<Directory /var/www/test80>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order Allow,Deny
Allow from All
</Directory>
LogLevel debug
ErrorLog /var/log/apache2/test80-error.log
CustomLog /var/log/apache2/test80-access.log vhost_combined
</VirtualHost>
<VirtualHost 192.168.26.92:80>
ServerName wl2
ServerAlias wl2
DocumentRoot /var/www/test81
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/test81>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
LogLevel info
ErrorLog /var/log/apache2/error-test81.log
CustomLog /var/log/apache2/test81-access.log vhost_combined
</VirtualHost>
After I removed any mixture between names/ip's and ports, the result is
as I expected!!!! Hurray!!
Many, many thanks:All contributions finally brought me into the right
directions!!!!
br++mabra
-----Original Message-----
From: Igor Galic [mailto:i.galic@brainsware.org]
Sent: Monday, October 18, 2010 1:00 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Host-header from requests are ignored?
----- mabra@manfbraun.de wrote:
> Hello !
>
> I read the apache docs [using 2.2.9], but there is a lot of stuff,
> which is different in Debian [lenny, 5.0.6].
>
> Apache ignores the host-header given by the browser:
> http://x or http://x:81 or http://x.mbg.local are all served, but
> should be
> blocked.
> The definition for x stems from my hosts file [which everyone could do
> this
> way].
> I am new new to apache, but on my IIS this works as expected.
> All browsers act equal [so no browser header problem].
>
> I configured two VirtualHosts, an excerpt:
>
> NameVirtualHost hugo:80
>
> <VirtualHost hugo:80>
This looks like bad practice on Apache httpd.
> DocumentRoot /usr/share/doc
> Alias /doc/ /usr/share/doc/
> <Directory /usr/share/doc/>
> Options Indexes MultiViews FollowSymLinks
> Allow from 192.168.24.0/24
> </Directory>
> </VirtualHost>
>
> The other VirtualHost is configured for port 81.
>
> The I go to my hosts file on any box, and add hugo's ip-address under
> the new name x. Then, x is served [with and without specifying a
> port],
> although the host-header in apache is hugo!! Every user coming from
> the internet could make the same!
>
> I am out of hope now. Does anyone has any help for me?
Check http://wiki.apache.org/httpd/ExampleVhosts or
http://httpd.apache.org/docs/current/vhosts/examples.html
out to see some examples for vhosts.
What I prefer to do is something like this:
# Enable name-based virtual hosts for all interfaces, on port 80
NameVirtualHost *:80
# the first listed vhost will be the default vhost,
# it catches all names which do not match:
<VirtualHost *:80>
<Location />
Deny from all
</Location>
# Alternatively, you could use mod_rewrite to send 410, as per RFC.
</VirtualHost>
<VirtualHost *:80>
ServerName Hugo
</VirtualHost>
etc...
> Would really very good!
>
> br++mabra
>
>
>
> ---------------------------------------------------------------------
> 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
--
Igor Galic
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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] Host-header from requests are ignored?
Posted by Igor Galić <i....@brainsware.org>.
----- mabra@manfbraun.de wrote:
> Hello !
>
> I read the apache docs [using 2.2.9], but there is a lot of stuff,
> which is different in Debian [lenny, 5.0.6].
>
> Apache ignores the host-header given by the browser:
> http://x or http://x:81 or http://x.mbg.local are all served, but
> should be
> blocked.
> The definition for x stems from my hosts file [which everyone could do
> this
> way].
> I am new new to apache, but on my IIS this works as expected.
> All browsers act equal [so no browser header problem].
>
> I configured two VirtualHosts, an excerpt:
>
> NameVirtualHost hugo:80
>
> <VirtualHost hugo:80>
This looks like bad practice on Apache httpd.
> DocumentRoot /usr/share/doc
> Alias /doc/ /usr/share/doc/
> <Directory /usr/share/doc/>
> Options Indexes MultiViews FollowSymLinks
> Allow from 192.168.24.0/24
> </Directory>
> </VirtualHost>
>
> The other VirtualHost is configured for port 81.
>
> The I go to my hosts file on any box, and add hugo's ip-address under
> the new name x. Then, x is served [with and without specifying a
> port],
> although the host-header in apache is hugo!! Every user coming from
> the internet could make the same!
>
> I am out of hope now. Does anyone has any help for me?
Check http://wiki.apache.org/httpd/ExampleVhosts or
http://httpd.apache.org/docs/current/vhosts/examples.html
out to see some examples for vhosts.
What I prefer to do is something like this:
# Enable name-based virtual hosts for all interfaces, on port 80
NameVirtualHost *:80
# the first listed vhost will be the default vhost,
# it catches all names which do not match:
<VirtualHost *:80>
<Location />
Deny from all
</Location>
# Alternatively, you could use mod_rewrite to send 410, as per RFC.
</VirtualHost>
<VirtualHost *:80>
ServerName Hugo
</VirtualHost>
etc...
> Would really very good!
>
> br++mabra
>
>
>
> ---------------------------------------------------------------------
> 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
--
Igor Galić
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
---------------------------------------------------------------------
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