You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by gowthaman ramasamy <go...@icgeb.res.in> on 2003/12/03 11:59:35 UTC

[users@httpd] apache VHOSTS on LAN

hi list,
in my system apache(2.0.47) is running on Redhat 8 + P4.

I am trying to setup virtual hosts but in vein.

I would like to know is it possible to setup virtual hosts without valid
DNS names. Say if my system's IP is 192.168.1.13 (WITHIN LAN), can i set
two vhosts with the name  gowtham.myhost.com and sekar.myhost.com.

if yes is the following lines are correct ? do i have to do something in
/etc/hosts
 
NameVirtualHost 192.168.1.13

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost 192.168.1.13>
    ServerAdmin gowtham@icgeb.res.in
    DocumentRoot /usr/local/apache2/htdocs/gowtham
    ServerName gowtham.myhost.com
    ErrorLog logs/host1.example.com-error_log
    CustomLog logs/host1.example.com-access_log common
</VirtualHost>

<VirtualHost 192.168.1.13>
    ServerAdmin gowtham@icgeb.res.in
    DocumentRoot /usr/local/apache2/htdocs/sekar
    ServerName sekar.myhost.com
    ErrorLog logs/host2.example.com-error_log
    CustomLog logs/host2.example.com-access_log common
</VirtualHost>


MANY THANX IN ADVANCE
gowtham


---------------------------------------------------------------------
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 VHOSTS on LAN

Posted by gowthaman ramasamy <go...@icgeb.res.in>.
Thank you again.
I just wonder, can i configure my proxy server so that client can
access  my site by typing  http://firstsite/. with out the pain of
maping firstsite to MY IP address in each client machine (i have 40
clients).

here we have 40 machines and all are routed thru' proxy server. My aim
is make one subset of these machines to access one particular directory
and another to another directory...... but without any passwd based
access.

gowtham
> > i configured ethernet ports  for two ips (192.168.1.13 & 192.168.1.14).
> > And in httpd.conf i pointed different directories to each of the ips.
> > And then i maped these ips in the hosts file of all the clients.
> > 
> > But this did not work, till the time i configured client browsers to
> > skip proxy for these two IP adrreses. 
> Well spotted :P
> 
> Glad it worked out.
> 
> -- 
> Jez Hancock
>  - System Administrator / PHP Developer
> 
> http://munk.nu/
> 
> ---------------------------------------------------------------------
> 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 VHOSTS on LAN

Posted by Jez Hancock <je...@munk.nu>.
On Fri, Dec 05, 2003 at 07:16:06PM +0530, gowthaman ramasamy wrote:
> hi,
> thank you very much to all of you. this worked for me. 
> But i configured in the follwing way .
> i configured ethernet ports  for two ips (192.168.1.13 & 192.168.1.14).
> And in httpd.conf i pointed different directories to each of the ips.
> And then i maped these ips in the hosts file of all the clients.
> 
> But this did not work, till the time i configured client browsers to
> skip proxy for these two IP adrreses. 
Well spotted :P

Glad it worked out.

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/

---------------------------------------------------------------------
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 VHOSTS on LAN

Posted by gowthaman ramasamy <go...@icgeb.res.in>.
hi,
thank you very much to all of you. this worked for me. 
But i configured in the follwing way .
i configured ethernet ports  for two ips (192.168.1.13 & 192.168.1.14).
And in httpd.conf i pointed different directories to each of the ips.
And then i maped these ips in the hosts file of all the clients.

But this did not work, till the time i configured client browsers to
skip proxy for these two IP adrreses. 
thank you very much once again.

gowtham

On Fri, 2003-12-05 at 09:43, Jez Hancock wrote:
> On Wed, Dec 03, 2003 at 04:29:35PM +0530, gowthaman ramasamy wrote:
> <snip>
> > I would like to know is it possible to setup virtual hosts without valid
> > DNS names. Say if my system's IP is 192.168.1.13 (WITHIN LAN), can i set
> > two vhosts with the name  gowtham.myhost.com and sekar.myhost.com.
> > 
> > if yes is the following lines are correct ? do i have to do something in
> > /etc/hosts
> Yes, enter the domain -> ip address mapping in /etc/hosts to 'override'
> your dns cache:
> 
> 192.168.1.13 gowtham.myhost.com sekar.myhost.com
> 
> Obviously this will only work on the local system - if you need other
> machines on the lan to resolve those fqdns to 192.168.1.13 then you'd
> need to add the same line to the hosts file on those machines.
> 
> The vhost entries look ok though, you could perhaps explicitly state in
> the entries that you mean port 80:
> 
> > NameVirtualHost 192.168.1.13
> NameVirtualHost 192.168.1.13:80
> 
> > #
> > # VirtualHost example:
> > # Almost any Apache directive may go into a VirtualHost container.
> > # The first VirtualHost section is used for requests without a known
> > # server name.
> > #
> > <VirtualHost 192.168.1.13>
> <VirtualHost 192.168.1.13:80>
> >     ServerAdmin gowtham@icgeb.res.in
> >     DocumentRoot /usr/local/apache2/htdocs/gowtham
> >     ServerName gowtham.myhost.com
> >     ErrorLog logs/host1.example.com-error_log
> >     CustomLog logs/host1.example.com-access_log common
> > </VirtualHost>
> <snip>
> 
> Although that shouldn't matter really.
> 
> -- 
> Jez Hancock
>  - System Administrator / PHP Developer
> 
> http://munk.nu/
> 
> ---------------------------------------------------------------------
> 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 VHOSTS on LAN

Posted by Jez Hancock <je...@munk.nu>.
On Wed, Dec 03, 2003 at 04:29:35PM +0530, gowthaman ramasamy wrote:
<snip>
> I would like to know is it possible to setup virtual hosts without valid
> DNS names. Say if my system's IP is 192.168.1.13 (WITHIN LAN), can i set
> two vhosts with the name  gowtham.myhost.com and sekar.myhost.com.
> 
> if yes is the following lines are correct ? do i have to do something in
> /etc/hosts
Yes, enter the domain -> ip address mapping in /etc/hosts to 'override'
your dns cache:

192.168.1.13 gowtham.myhost.com sekar.myhost.com

Obviously this will only work on the local system - if you need other
machines on the lan to resolve those fqdns to 192.168.1.13 then you'd
need to add the same line to the hosts file on those machines.

The vhost entries look ok though, you could perhaps explicitly state in
the entries that you mean port 80:

> NameVirtualHost 192.168.1.13
NameVirtualHost 192.168.1.13:80

> #
> # VirtualHost example:
> # Almost any Apache directive may go into a VirtualHost container.
> # The first VirtualHost section is used for requests without a known
> # server name.
> #
> <VirtualHost 192.168.1.13>
<VirtualHost 192.168.1.13:80>
>     ServerAdmin gowtham@icgeb.res.in
>     DocumentRoot /usr/local/apache2/htdocs/gowtham
>     ServerName gowtham.myhost.com
>     ErrorLog logs/host1.example.com-error_log
>     CustomLog logs/host1.example.com-access_log common
> </VirtualHost>
<snip>

Although that shouldn't matter really.

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/

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