|
Home > Archive > Apache Server configuration support > November 2006 > Virtualhost doesn't work how I would
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Virtualhost doesn't work how I would
|
|
| Giacomo 2006-11-28, 7:28 pm |
| Hi everybody,
I do have a virtualhost like this:
<VirtualHost *>
DocumentRoot /dir/httpd/
ServerName 10.0.0.1/directory/
<Directory /dir/httpd/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order deny,allow
deny from all
allow from 10.0.0.0/24
</Directory>
</VirtualHost>
If with my browser I go to:
10.0.0.1/directory/
I get a 404 error, and this in the log file:
File does not exist: /dir/httpd/directory
I mean that apache2 adds to "DocumentRoot" path the "directory"
directory, but I don't know why?
How can I solve this?
Bye and thanks
--
Giacomo
| |
|
| "Giacomo" <kylnas@tiscali.it> schreef in bericht
news:Bc3bh.1555$P04.323@tornado.fastwebnet.it...
NameVirtualHost * missing?
> <VirtualHost *>
> DocumentRoot /dir/httpd/
>
> ServerName 10.0.0.1/directory/
Must use a name here not an ip + folder.
> <Directory /dir/httpd/>
> Options Indexes FollowSymLinks MultiViews
> AllowOverride All
> Order deny,allow
> deny from all
> allow from 10.0.0.0/24
> </Directory>
> </VirtualHost>
>
> If with my browser I go to:
> 10.0.0.1/directory/
>
> I get a 404 error, and this in the log file:
> File does not exist: /dir/httpd/directory
>
> I mean that apache2 adds to "DocumentRoot" path the "directory" directory,
> but I don't know why?
You made a request for http://10.0.0.1/directory/ yourself.
Just http://10.0.0.1 brings you to the documentroot.
Assuming you want to have multiple sites on one IP:
- There has to be a 'NameVirtualHost *' preceding the first <virtualhost>
- Your client -IE or FF- must addres a virtual by _name_ not by ip
- The name used above must match the one given to servername -or
serveralias-
- The name must be resolved by DNS -or the clients local hosts file-
HansH
| |
| devon_banks@comcast.net 2006-11-28, 7:28 pm |
|
Giacomo wrote:
> Hi everybody,
> I do have a virtualhost like this:
>
> <VirtualHost *>
> DocumentRoot /dir/httpd/
>
> ServerName 10.0.0.1/directory/
> <Directory /dir/httpd/>
> Options Indexes FollowSymLinks MultiViews
> AllowOverride All
> Order deny,allow
> deny from all
> allow from 10.0.0.0/24
> </Directory>
> </VirtualHost>
>
> If with my browser I go to:
> 10.0.0.1/directory/
>
> I get a 404 error, and this in the log file:
> File does not exist: /dir/httpd/directory
>
> I mean that apache2 adds to "DocumentRoot" path the "directory"
> directory, but I don't know why?
>
> How can I solve this?
>
> Bye and thanks
>
> --
> Giacomo
I don't think this is a valid ServerName. I think you can make work
with a Rewrite or something such as that. But if you input into your
browser 10.0.0.1/directory it is going to go to Directory
/dir/httpd/directory.
Not /dir/httpd/. I could be wrong but I have never seen anything like
this.
| |
| Giacomo 2006-11-28, 7:28 pm |
| devon_banks@comcast.net ha scritto:
> I don't think this is a valid ServerName.
Thanks to both, this is the problem.
The ServerName must be fully-qualified-domain-name.
Bye and thanks again
--
Giacomo
|
|
|
|
|