dextervip
dextervip

Reputation: 5069

How to setup a rails app within same domain as another php application?

I have webserver using default virtualhost apache

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www

    <Directory />
            Options FollowSymLinks
            AllowOverride all
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride all
            Order allow,deny
            allow from all
    </Directory>
</VirtualHost>

My PHP apps runs fine in subfolders and I can access like below

domain.com/phpapp1

domain.com/phpapp2

domain.com/phpapp3

But How can I run a rails app using passenger like it domain.com/railsapp1? I would like to use the same domain for all apps

Upvotes: 0

Views: 311

Answers (1)

dextervip
dextervip

Reputation: 5069

I'm not sure if it is the best way but I got it working adding the following lines to configure redmine and a main app for example on the same domain

<VirtualHost *:80>
 ServerAdmin webmaster@localhost

 DocumentRoot /var/www

 <Directory />
        Options FollowSymLinks
        AllowOverride all
 </Directory>
 <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
 </Directory>

 <Directory /var/www/redmine>
        RailsBaseURI /redmine
        PassengerResolveSymlinksInDocumentRoot on
        PassengerAppRoot /var/www/redmine
 </Directory>

</VirtualHost>

Upvotes: 1

Related Questions