Thanks for the reply.

What we are trying to do is to create a new vhost without disrupting the 
default settings.

So that http://localhost/whatever/... Follow the default setup while
http://localhost/testsite/... Will refer to /var/www/company/yyy/public


I did look into the suggested link but most examples on multiple vhosts rely on 
either different port, different ip address, or different name but in our case 
they are all the same. It is just a path that we want to take over.

I realize the default DocumentRoot /var/www takes over all requests, and I am 
just wonder if there is a way override it just for a particular path 
"testsite". Or do we always need to edit the default config?

Editing the default config is fine for a particular server but we are working 
on a web application, to be deployed on different machines. Would be nice if we 
could just add our own vhost configuration without messing with the default.


Thanks!


-----Original Message-----
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Thursday, May 14, 2009 1:37 PM
To: users@httpd.apache.org
Subject: Re: [us...@httpd] VirtualHost with no ServerName in 2.2.11

Tony Ser wrote:
> Hi,
> 
> We are developing a web application and need to create a website.
> The testsite.conf contains
> 
> Namevirtualhost *:80
> <VirtualHost *:80>

ServerName ?????

> AllowEncodedSlashes On

DocumentRoot ????  ----|
                        |
                        v

> Alias /testsite "/var/www/company/yyy/public"
> <Directory "/var/www/company/yyy/public">
> AllowOverride All
> Order allow,deny
> Allow from all
> </Directory>
> </VirtualHost>
> 
> 
> We don't want to specify a fix IP Address, so we leave it with *.
> This works fine under Apache 2.2.8 (in Ubuntu 8.04)
You mean the above config ? or just the "*" ?

> However, under Apache 2.2.11 (in Ubuntu 9.04), the settings are not
> ineffect.
> 
> If we browse http://localhost/testsite/test.html, error log shows apache
> trying to access /var/www/testsite/test.html instead of
> /var/www/company/yyy/public/test.html
> 
Probably only because your main configuration says
DocumentRoot /var/www
and by default, it carries over to the <VirtualHost>

> If I add "ServerName localhost", then it will work.
>
If that's the only thing you're adding, then you're lucky.

> Is there a way specify a site configuration (i.e. AllowEncodedSlashes,
> Alias, etc) with out specifying a fixed IP Address or fixed ServerName.
> 

If you have only one <VirtualHost> section, then it does not matter what
you give it as ServerName.  Pages will always be served by this VirtualHost,
because it will be the default one.

As for fixed IP address, I don't really understand what you mean.
For that, it seems that your configuration above is fine.  This Apache 
will respond to any request that reaches it on port 80, no matter 
through which one of its (possible) IP addresses.


I believe you might benefit from reading through
http://httpd.apache.org/docs/2.2/vhosts/
and try to get a basic understanding of this stuff first.

---------------------------------------------------------------------
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-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@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-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to