3
votes

I have a problem with Rails + Passenger + Apache + Alias. I tried to run a rails app over an Alias and I declared this virtualhost

<VirtualHost *:80>
    Alias /smart_data /home/pablo/Proyectos/Net-Works/SmartData/smart_data/public
    <Location /smart_data>
        PassengerBaseURI /smart_data
        PassengerAppRoot /home/pablo/Proyectos/Net-Works/SmartData/smart_data
    </Location>
    <Directory /home/pablo/Proyectos/Net-Works/SmartData/smart_data/public>
        Allow from all
        Options -MultiViews
        Require all granted
    </Directory>
</VirtualHost>

It works ok, but my app read a file from the folder /public/data/ and apache try read this file from /var/www/html/data.

Could someone help me?.

1

1 Answers

1
votes

You need to define a DocumentRoot within the VirtualHost tags.

<VirtualHost *:80>
  # Add this line:
  DocumentRoot /home/pablo/Proyectos/Net-Works/SmartData/smart_data/public
</VirtualHost>

Since no DocumentRoot is defined there, it's going with the default one (defined somewhere in the same config file, but not nested in any VirtualHost tag)