Virtual Hosts problem
am 20.10.2009 17:07:27 von mk27
I have two virtual hosts set-up and working at home right now. The=20
first one is this:
NameVirtualHost *:80
ServerName localhost
DocumentRoot "/var/www/html/"
Alias /filesystem /
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} MSIE.6
RewriteRule .m?html$ http://localhost/IE6.htm [L]
The second one is a ruby on rails site. I put both these in a while=20
ago, and went to add a third one today since as far as I can remember,=20
and AFAICT looking at the docs, it was as simple as this:
ServerName dev.docsearch.net
DocumentRoot "/var/www/html/searchtest/mirror/"
Then I restarted apache. However, no matter what directory I point=20
this to (including the ones in the other Virtual hosts directives, I=20
get an "Address not found" error from the browser. Strangely, if I=20
move the *exact same DocumentRoot line* into one of the working=20
VirtualHosts, that directory works. In other words THERE ARE NO=20
SPELLING ERRORS OR MISTAKES IN THE PATHS, ETC. And no typos in the nav=20
bar either. Promise.
Using apachectl -S shows "port 80 namevhost dev.docsearch.net ...=20
Syntax OK"
There is no output in either the access or error log. What have I=20
missed? Why is the configuration above not sufficient?
ps. Server version: Apache/2.2.10 (Unix)
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Virtual Hosts problem
am 20.10.2009 17:26:45 von aw
MK wrote:
...
>
> ServerName dev.docsearch.net
> DocumentRoot "/var/www/html/searchtest/mirror/"
>
>
> Then I restarted apache. However, no matter what directory I point
> this to (including the ones in the other Virtual hosts directives, I
> get an "Address not found" error from the browser.
What do you get when you enter :
ping dev.docsearch.net
in a command window on your workstation ?
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Virtual Hosts problem
am 20.10.2009 17:55:17 von mk27
On 10/20/2009 11:26:45 AM, Andr=E9 Warnier wrote:
> What do you get when you enter :
> ping dev.docsearch.net
> in a command window on your workstation ?
On the working VH's, the ping goes thru. On the non-working one, I get=20
"unknown host".
I'm totally baffled by this. I keep staring at everything looking for=20
a typo, but again, there isn't one...
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Virtual Hosts problem
am 20.10.2009 18:21:22 von aw
MK wrote:
> On 10/20/2009 11:26:45 AM, André Warnier wrote:
>
>> What do you get when you enter :
>> ping dev.docsearch.net
>> in a command window on your workstation ?
>
> On the working VH's, the ping goes thru. On the non-working one, I get
> "unknown host".
>
> I'm totally baffled by this. I keep staring at everything looking for
> a typo, but again, there isn't one...
>
When you enter a URL like "http://dev.docsearch.net/something" in the
URL bar of your browser, the first thing the browser has to do, is
resolve the hostname "dev.docsearch.net" to an IP address.
If it cannot do that, then it can never set up a TCP connection to that
host, never mind sending it a request.
No wonder thus that Apache never receives it..
So the first thing you have to do, is arrange for your browser to be
able to resolve "dev.docsearch.net" to an IP address.
Depending on your setup, and whether this is only for testing or you
want other workstations to also access that VirtualHost, the solution
differs.
If your browser workstation is the same computer as the one where Apache
is running, and this is just for testing, then just do this :
- find your "hosts" file (in Windows, this is in
C:/windows/system32/drivers/etc/hosts, in Unix/Linux it is /etc/hosts)
- add a line like this :
127.0.0.1 dev.docsearch.net
- save the file
- close and re-open your browser, and try again
If you are not in the above conditions, then you need to ask the
sysadmin responsible for DNS in your network, to add "dev.docsearch.net"
to the list of aliases for your Apache host computer.
Note that this is basic TCP/IP stuff, not really an Apache issue.
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Virtual Hosts problem
am 20.10.2009 19:04:39 von Drew Tomlinson
MK wrote:
> On 10/20/2009 11:26:45 AM, André Warnier wrote:
>
>
>> What do you get when you enter :
>> ping dev.docsearch.net
>> in a command window on your workstation ?
>>
>
> On the working VH's, the ping goes thru. On the non-working one, I get
> "unknown host".
>
> I'm totally baffled by this. I keep staring at everything looking for
> a typo, but again, there isn't one...
So you do not have a virtual host problem. You have a name resolution
problem. dev.docsearch.net has resolve to the IP address of your web
server. You can test this by adding an entry for dev.docsearch.net to
the hosts file on your workstation.
Cheers,
Drew
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Virtual Hosts problem
am 20.10.2009 19:07:07 von Drew Tomlinson
Drew Tomlinson wrote:
> MK wrote:
>> On 10/20/2009 11:26:45 AM, André Warnier wrote:
>>
>>
>>> What do you get when you enter :
>>> ping dev.docsearch.net
>>> in a command window on your workstation ?
>>>
>>
>> On the working VH's, the ping goes thru. On the non-working one, I
>> get "unknown host".
>>
>> I'm totally baffled by this. I keep staring at everything looking
>> for a typo, but again, there isn't one...
>
> So you do not have a virtual host problem. You have a name resolution
> problem. dev.docsearch.net has resolve to the IP address of your web
> server. You can test this by adding an entry for dev.docsearch.net to
> the hosts file on your workstation.
>
> Cheers,
>
> Drew
Sorry for the noise. Seems I didn't scroll completely to the bottom
before replying and thus, didn't see Andre's reply.
Cheers,
Drew
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Virtual Hosts problem
am 20.10.2009 20:09:07 von mk27
Hey thanks y'all, it was the name resolution. As soon as I saw that,=20
bells started ringing and of course the other VH's (eg, localhost) have=20
an entry there. =20
Thanks!
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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