You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by wa...@xs4all.nl on 2002/10/17 20:57:55 UTC
[users@httpd] Apache to except only connections for one hostname
Hello,
I am wandering if it is possible to configure Apache that it excepts only
connection for only one hostname, also in the case that the ip adres has
got more aliases. If so please let me know how to do this.
I am running Apache behind a firewall which does also NAT on one public ip
address. The Apache box has got a private ip adres. The public ip address
has got a real hostname (myhost.mydomain.com) and several aliases (of
which one is www.mydomain.com) associated with it.I want to configure Apache that it only excepts connections for
www.mydomain.com and not for ie. mail.mydomain.com which it does now.
My httpd setup is like this :
ServerType standalone
ServerRoot "/wwwroot"
DocumentRoot "/wwwroot/htdocs"
PidFile /var/run/httpd.pid
MaxClients 150
StartServers 2
MinSpareServers 2
MaxSpareServers 4
MaxRequestsPerChild 0
Timeout 300
KeepAlive on
MaxKeepAliveRequests 100
KeepAliveTimeout 15
Port 80
User apache
Group apache
ErrorLog /wwwroot/logs/httpd_error.log
LogLevel info
TransferLog /wwwroot/logs/httpd_access.log
HostnameLookups Off
BindAddress a.b.c.d
NameVirtualHost a.b.c.d
<VirtualHost a.b.c.d>
ServerName www.mydomain.com
DocumentRoot "/wwwroot/htdocs/mydomain.com"
ScriptAlias /cgi-bin /wwwroot/cgi-bin
ServerAdmin webmaster@mydomain.com
ErrorLog /wwwroot/logs/httpd_error.log
LogLevel info
TransferLog /wwwroot/logs/httpd_access.log
</VirtualHost>
I have read that Apache always takes the first virtual host as it's
default, so when a http connection comes in for somename.mydomain.com it
drops it on the first virtual host.
MTIA.
Lars.
---------------------------------------------------------------------
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] Apache to except only connections for one hostname
Posted by wa...@xs4all.nl.
Hello,
the solution given by Joshua worked. Thanx Joshua!
Lars.
> waldi@xs4all.nl wrote:
>
>>
>>
>> I have read that Apache always takes the first virtual host as it's
>> default, so when a http connection comes in for somename.mydomain.com
>> it drops it on the first virtual host.
>> MTIA.
>
>
> Right. So all you need to do is create a new <virtualhost> block, list
> it first, and include
> <Location />
> Deny from all
> </Location>
>
> Then all hostnames that don't match one of the ServerName's or
> ServerAlias's in the other <virtualhost> blocks will be denied access.
>
> 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
---------------------------------------------------------------------
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] Apache to except only connections for one hostname
Posted by Joshua Slive <jo...@slive.ca>.
waldi@xs4all.nl wrote:
>
>
> I have read that Apache always takes the first virtual host as it's
> default, so when a http connection comes in for somename.mydomain.com it
> drops it on the first virtual host.
> MTIA.
Right. So all you need to do is create a new <virtualhost> block, list
it first, and include
<Location />
Deny from all
</Location>
Then all hostnames that don't match one of the ServerName's or
ServerAlias's in the other <virtualhost> blocks will be denied access.
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