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/04 05:48:37 UTC

[users@httpd] virtual hosts on LAN with apache 2.0.47


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>

with the above configuration http://192.168.1.13 directly loads
index.html from /usr/local/apache2/htdocs/gowtham. But im not able to
acess /usr/local/apache2/htdocs/sekar.

can any one help me ....


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] virtual hosts on LAN with apache 2.0.47

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 4 Dec 2003, gowthaman ramasamy wrote:
> 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

Apache doesn't really care if the names map to the ip address.  The
clients do.  If the client can't resolve the name->IP, then it won't know
how to access the server.  If you don't want to use DNS, you'll need to
modify /etc/hosts on all the client systems to map the names to the
relevant IP address.

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