You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Martin Greco <ma...@solsis.com.ar> on 2003/05/28 15:31:32 UTC

[users@httpd] Virtual Host Issue

Hi Everyone:
I configured my webserver with apache2 (redhat 8).
I have the following problem:
I configured a virtual host and the main server document root.

#
# Use name-based virtual hosting.
#
NameVirtualHost *

<VirtualHost *>
    ServerAdmin root@solsis.com.ar
    DocumentRoot /var/www/html/squirre
    ServerName webmail.solsis.com.ar
    ErrorLog logs/squirre_error.log
    CustomLog logs/squirre.log common
</VirtualHost>

The problem is that when I browse www.solsis.com.ar it sends me to the
virtual host.
I fixed this by configuring other virtual host named www.solsis.com.ar.
I'm sure this is not the right way.
Any suggestions?

Thanks.

#####################
# Martin Greco

Re: [users@httpd] Virtual Host Issue

Posted by Zac Stevens <zt...@cryptocracy.com>.
On Wed, May 28, 2003 at 10:31:32AM -0300, Martin Greco wrote:
> I configured a virtual host and the main server document root.

<--snip-->

> The problem is that when I browse www.solsis.com.ar it sends me to the
> virtual host.
> I fixed this by configuring other virtual host named www.solsis.com.ar.
> I'm sure this is not the right way.

No, that is exactly correct!  When using virtualhosts, it is best to use
them for everything - don't serve a website from the main server config.


Cheers,


Zac

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

Posted by Andrew Berkowitz <ba...@rocketmail.com>.
When Virtual hosts are defined, any requests for a host NOT defined as
a virtual host go to the first VirtualHost defined.

So if you use other CNAMES, or an IP address to reach this server,
those requests will all go to whatever VirtualHost is defined first.

Since webmail.solsis.com.ar is the only VirtualHost, all requests go
there.

So define www.solsis.com.ar as a VirtualHost, but put it first in the
list if you want it to be the default.

Putting it second will work for that name, but not if you want to use
other names or IP address.

--- Martin Greco <ma...@solsis.com.ar> wrote:
> Hi Everyone:
> I configured my webserver with apache2 (redhat 8).
> I have the following problem:
> I configured a virtual host and the main server document root.
> 
> #
> # Use name-based virtual hosting.
> #
> NameVirtualHost *
> 
> <VirtualHost *>
>     ServerAdmin root@solsis.com.ar
>     DocumentRoot /var/www/html/squirre
>     ServerName webmail.solsis.com.ar
>     ErrorLog logs/squirre_error.log
>     CustomLog logs/squirre.log common
> </VirtualHost>
> 
> The problem is that when I browse www.solsis.com.ar it sends me to
> the
> virtual host.
> I fixed this by configuring other virtual host named
> www.solsis.com.ar.
> I'm sure this is not the right way.
> Any suggestions?
> 
> Thanks.
> 
> #####################
> # Martin Greco
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.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