You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Owen Boyle <ob...@bourse.ch> on 2002/03/01 09:19:41 UTC

Re: Not That IP Address!

Lewis Watson wrote:
> 
> Apache gets all the ip addresses on this box except for one that is doing
> ftp for my network. So I need to add a Listen directive (right word?) for
> each virtual host....
> <VirtualHost 111.222.333.444>
> DocumentRoot /home/www/user1
> ServerAdmin user1@adomain.com
> Listen 111.222.333.444
> blah
> blah
> </VirtualHost>
> 
> I was wishing that I would not have to do that but I guess that would be
> best.....

To be clear:
- Apache by default, listens to all active IP addresses (i.e. listed by
ifconfig -a) on port 80.
- If you want to specify IP addresses, you use "Listen" or
"BindAddress".
- As soon as you use either of these directives, apache will listen only
to specified addresses; the default behaviour is switched off.
- BindAddress allows you to listen to only one IP; you can only have one
of these directives.
- You can have many Listens, apache will listen only to IP addresses
specified by these directives.
- Therefore if you have several IP addresses and you want servers on
some but not others, you should use specify one-by-one the addresses you
want to listen to. Addresses which are not defined by a Listen will be
ignored.

NB: Listen is a server-config directive - it applies to the whole server
so you shouldn't put it in a <VirtualHost> as you have done (it'll work
but you're confusing matters...). I find the best self-documenting
layout is:

> Listen 111.222.333.444
> <VirtualHost 111.222.333.444>
>   DocumentRoot /home/www/user1
>   blah
> </VirtualHost>

repeated for each VH.

NB2 There is no "UnListen" directive - i.e. you can't get the default
"listen all addresses" behaviout and then subtract one IP from it...

Rgds,

Owen Boyle.

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Not That IP Address!

Posted by Lewis Watson <li...@visionsix.com>.
I was wondering how to specify what addresses for apache not too listen on.
It looks as if I need a Listen directive in my virtual hosts containers.
Thanks though....

----- Original Message -----
From: "Brian Quinn" <br...@azfms.com>
To: <us...@httpd.apache.org>
Sent: Friday, March 01, 2002 9:36 AM
Subject: RE: Not That IP Address!


> i do this for my virtual hosts
> i think this is what you were asking?
>
>
>
>
> <VirtualHost *>
>      ServerName www.mydomain.com
>      DocumentRoot /opt/htdocs
>      ErrorLog /opt/apache/logs/mydomain.error
>      CustomLog /opt/apache/logs/mydomain.access common
> </VirtualHost>
>
>
>
> At 09:50 AM 3/1/2002 +0000, you wrote:
> >Just wondering, whether we can specify wild-card ( or specify a part of,
eg.
> >192.168.1. )in the IP
> >for listen directive.
> >
> >Santosh
> >
> >-----Original Message-----
> >From: obo@bourse.ch [mailto:obo@bourse.ch]
> >Sent: 01 March 2002 08:20
> >To: users@httpd.apache.org
> >Subject: Re: Not That IP Address!
> >
> >
> >Lewis Watson wrote:
> > >
> > > Apache gets all the ip addresses on this box except for one that is
doing
> > > ftp for my network. So I need to add a Listen directive (right word?)
for
> > > each virtual host....
> > > <VirtualHost 111.222.333.444>
> > > DocumentRoot /home/www/user1
> > > ServerAdmin user1@adomain.com
> > > Listen 111.222.333.444
> > > blah
> > > blah
> > > </VirtualHost>
> > >
> > > I was wishing that I would not have to do that but I guess that would
be
> > > best.....
> >
> >To be clear:
> >- Apache by default, listens to all active IP addresses (i.e. listed by
> >ifconfig -a) on port 80.
> >- If you want to specify IP addresses, you use "Listen" or
> >"BindAddress".
> >- As soon as you use either of these directives, apache will listen only
> >to specified addresses; the default behaviour is switched off.
> >- BindAddress allows you to listen to only one IP; you can only have one
> >of these directives.
> >- You can have many Listens, apache will listen only to IP addresses
> >specified by these directives.
> >- Therefore if you have several IP addresses and you want servers on
> >some but not others, you should use specify one-by-one the addresses you
> >want to listen to. Addresses which are not defined by a Listen will be
> >ignored.
> >
> >NB: Listen is a server-config directive - it applies to the whole server
> >so you shouldn't put it in a <VirtualHost> as you have done (it'll work
> >but you're confusing matters...). I find the best self-documenting
> >layout is:
> >
> > > Listen 111.222.333.444
> > > <VirtualHost 111.222.333.444>
> > >   DocumentRoot /home/www/user1
> > >   blah
> > > </VirtualHost>
> >
> >repeated for each VH.
> >
> >NB2 There is no "UnListen" directive - i.e. you can't get the default
> >"listen all addresses" behaviout and then subtract one IP from it...
> >
> >Rgds,
> >
> >Owen Boyle.
> >
> >---------------------------------------------------------------------
> >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
> >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
> >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
> 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
For additional commands, e-mail: users-help@httpd.apache.org


RE: Not That IP Address!

Posted by Brian Quinn <br...@azfms.com>.
i do this for my virtual hosts
i think this is what you were asking?




<VirtualHost *>
     ServerName www.mydomain.com
     DocumentRoot /opt/htdocs
     ErrorLog /opt/apache/logs/mydomain.error
     CustomLog /opt/apache/logs/mydomain.access common
</VirtualHost>



At 09:50 AM 3/1/2002 +0000, you wrote:
>Just wondering, whether we can specify wild-card ( or specify a part of, eg.
>192.168.1. )in the IP
>for listen directive.
>
>Santosh
>
>-----Original Message-----
>From: obo@bourse.ch [mailto:obo@bourse.ch]
>Sent: 01 March 2002 08:20
>To: users@httpd.apache.org
>Subject: Re: Not That IP Address!
>
>
>Lewis Watson wrote:
> >
> > Apache gets all the ip addresses on this box except for one that is doing
> > ftp for my network. So I need to add a Listen directive (right word?) for
> > each virtual host....
> > <VirtualHost 111.222.333.444>
> > DocumentRoot /home/www/user1
> > ServerAdmin user1@adomain.com
> > Listen 111.222.333.444
> > blah
> > blah
> > </VirtualHost>
> >
> > I was wishing that I would not have to do that but I guess that would be
> > best.....
>
>To be clear:
>- Apache by default, listens to all active IP addresses (i.e. listed by
>ifconfig -a) on port 80.
>- If you want to specify IP addresses, you use "Listen" or
>"BindAddress".
>- As soon as you use either of these directives, apache will listen only
>to specified addresses; the default behaviour is switched off.
>- BindAddress allows you to listen to only one IP; you can only have one
>of these directives.
>- You can have many Listens, apache will listen only to IP addresses
>specified by these directives.
>- Therefore if you have several IP addresses and you want servers on
>some but not others, you should use specify one-by-one the addresses you
>want to listen to. Addresses which are not defined by a Listen will be
>ignored.
>
>NB: Listen is a server-config directive - it applies to the whole server
>so you shouldn't put it in a <VirtualHost> as you have done (it'll work
>but you're confusing matters...). I find the best self-documenting
>layout is:
>
> > Listen 111.222.333.444
> > <VirtualHost 111.222.333.444>
> >   DocumentRoot /home/www/user1
> >   blah
> > </VirtualHost>
>
>repeated for each VH.
>
>NB2 There is no "UnListen" directive - i.e. you can't get the default
>"listen all addresses" behaviout and then subtract one IP from it...
>
>Rgds,
>
>Owen Boyle.
>
>---------------------------------------------------------------------
>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
>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
>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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Not That IP Address!

Posted by Owen Boyle <ob...@bourse.ch>.
Santosh Deshpande wrote:
> 
> Just wondering, whether we can specify wild-card ( or specify a part of, eg.
> 192.168.1. )in the IP
> for listen directive.

I don't think so - the docs say use a full address. Check the source to
see how the arguments to Listen are parsed - or just try it and see what
apache says!

rgds,

Owen Boyle.

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


RE: Not That IP Address!

Posted by Santosh Deshpande <sa...@office.sourceree.com>.
Just wondering, whether we can specify wild-card ( or specify a part of, eg.
192.168.1. )in the IP
for listen directive.

Santosh

-----Original Message-----
From: obo@bourse.ch [mailto:obo@bourse.ch]
Sent: 01 March 2002 08:20
To: users@httpd.apache.org
Subject: Re: Not That IP Address!


Lewis Watson wrote:
>
> Apache gets all the ip addresses on this box except for one that is doing
> ftp for my network. So I need to add a Listen directive (right word?) for
> each virtual host....
> <VirtualHost 111.222.333.444>
> DocumentRoot /home/www/user1
> ServerAdmin user1@adomain.com
> Listen 111.222.333.444
> blah
> blah
> </VirtualHost>
>
> I was wishing that I would not have to do that but I guess that would be
> best.....

To be clear:
- Apache by default, listens to all active IP addresses (i.e. listed by
ifconfig -a) on port 80.
- If you want to specify IP addresses, you use "Listen" or
"BindAddress".
- As soon as you use either of these directives, apache will listen only
to specified addresses; the default behaviour is switched off.
- BindAddress allows you to listen to only one IP; you can only have one
of these directives.
- You can have many Listens, apache will listen only to IP addresses
specified by these directives.
- Therefore if you have several IP addresses and you want servers on
some but not others, you should use specify one-by-one the addresses you
want to listen to. Addresses which are not defined by a Listen will be
ignored.

NB: Listen is a server-config directive - it applies to the whole server
so you shouldn't put it in a <VirtualHost> as you have done (it'll work
but you're confusing matters...). I find the best self-documenting
layout is:

> Listen 111.222.333.444
> <VirtualHost 111.222.333.444>
>   DocumentRoot /home/www/user1
>   blah
> </VirtualHost>

repeated for each VH.

NB2 There is no "UnListen" directive - i.e. you can't get the default
"listen all addresses" behaviout and then subtract one IP from it...

Rgds,

Owen Boyle.

---------------------------------------------------------------------
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
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
For additional commands, e-mail: users-help@httpd.apache.org