Question

Rails app already works correctly on mydomain.com with Apache+Passenger. In addition, I'm going to deploy non-Rails app(wordpress) on blog.mydomain.com. So I modified httpd.conf like

PassengerEnabled off
<VirtualHost *:80>
  ServerName mydomain.com
  DocumentRoot /var/www/railsapp/public
  PassengerEnabled on
</VirtualHost>

<VirtualHost *:80>
  ServerName blog.mydomain.com
  DocumentRoot /var/www/blog
</VirtualHost>

But this doesn't work. blog.mydomain.com also shows Rails app. How can I divide them?

Was it helpful?

Solution

Try adding this to the top of the conf file:

NameVirtualHost *:80

You might also try swapping the order so the more specific one is first, but look at the section called 'Using the ServerPath Directive' on this page. It indicates that with older http/1.0 clients, you may not have enough information to route it correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top