You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by john asmodeus <sd...@hotmail.com> on 2007/11/02 10:00:30 UTC

Re: [users@httpd] Configuring one static host and one Rails host-but can't get both to work

I just got an email saying this message didn't make it through the spam
filters, but when I came back to the site, it was there! So, I don't know...
I guess I will check back tomorrow and if it's gone, I will try to post it
again in a way that doesn't piss off your spambot.

Cheers
-- 
View this message in context: http://www.nabble.com/Configuring-one-static-host-and-one-Rails-host-but-can%27t-get-both-to-work-tf4736146.html#a13544093
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.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


Re: [users@httpd] Configuring one static host and one Rails host-but can't get both to work

Posted by Krist van Besien <kr...@gmail.com>.
On Nov 2, 2007 10:00 AM, john asmodeus <sd...@hotmail.com> wrote:
>
> I just got an email saying this message didn't make it through the spam
> filters, but when I came back to the site, it was there! So, I don't know...
> I guess I will check back tomorrow and if it's gone, I will try to post it
> again in a way that doesn't piss off your spambot.

I had a look at the link you gave us. What is wrong with your config
is that for namevirtual hosts to work as expected all the blocks must
be configured the same.

You have:

NameVirtualHost 192.168.0.119
<VirtualHost 192.168.0.119>
        ServerName Rails_app
        ServerAlias Rails_app
# rest of config snipped
</VirtualHost>

NameVirtualHost *:80
<VirtualHost *:80>
        ServerName HTML_site
        ServerAlias HTML_site
# rest of config snipped.
</VirtualHost>

But you probably should have:

NameVirtualHost *:80
<VirtualHost *:80>
        ServerName Rails_app
        ServerAlias Rails_app
# rest of config snipped
</VirtualHost>
<VirtualHost *:80>
        ServerName HTML_site
        ServerAlias HTML_site
# rest of config snipped.
</VirtualHost>

The "NameVirtualHost" statement tells your apache on which IP
address/port combination you want to have name based virtual hosts.
You then define these hosts with a succession of <virtualhost> blocks
that have the exact same IP address/port combination. The apache
server picks one of the virtual hosts by matchin the "host" header in
the http request with  ServerName or ServerAlias.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

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