If you use Suburi, then
<documentroot>/<suburi> is for specifying the public directory of your rails application- your rails root directory for applications should be one directory above your rails declaration.
Both are solved if you have a dedicated public docroot for your domain, and then you do
ln -sf /path/to/suburi-rails-app/public <documentroot>/<suburi>
The documentation is really not that great. So your solution would be:
ln -sf /srv/www/suburi/public srv/www/mydomain/public/suburi
and vhost conf:
<VirtualHost 173.230.137.212:80> ServerName www.mydomain.com ServerAlias mydomain.com DocumentRoot /srv/www/mydomain/public ErrorLog /srv/www/error.log RewriteEngine On RewriteOptions Inherit RailsEnv production <Directory /srv/www/mydomain/public> Options FollowSymLinks -MultiViews AllowOverride all Order allow,deny Allow from all </Directory> RailsBaseURI /suburi <Directory /srv/www/mydomain/public/suburi> Options -MultiViews </Directory> </VirtualHost>
you say that: both the rails app for mydomain.com and the rails app for mydomain.com/suburi are in / srv / www /
This confused me a bit, I donβt think that it would be nice to run the application in the domain, and the other in suburi, since routing should be confusing. Rather use 2 suburi, in this case
ln -sf /srv/www/suburi2/public srv/www/mydomain/public/suburi2
where / srv / www / suburi2 is your second application root directory and add:
RailsBaseURI /suburi2 <Directory /srv/www/mydomain/public/suburi2> Options -MultiViews </Directory>
you can add any number of suburis to the same vhost.
hope this helped
source share