multiple rails app with passenger on Debian

I have been trying to setup the passenger so that I can run multiple
rails app on it without success.

I found someone suggested following:

Edit your virtual host file (example: /etc/apache2/sites-available/
example) so that the following is used:

NameVirtualHost *:80
<VirtualHost *:80>
ServerName one.example.com
DocumentRoot /web/one/public

<Directory /web/one/public/ />
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>

Repeat the <VirtualHost/> block for each Rails site you want to setup.
Restart Apache to pick up the new changes by executing the following
command line: sudo /etc/init.d/apache2 restart

I made another file with virtualhost block of the other rails app and
it still does not work.

each individual rails app works if I modify accordingly in the /etc/
apache2/sites-available/default.

What is a simple way to setup multiple rails app with passenger?

Thanks!

I have been trying to setup the passenger so that I can run multiple
rails app on it without success.

I found someone suggested following:

Edit your virtual host file (example: /etc/apache2/sites-available/
example) so that the following is used:

NameVirtualHost *:80
<VirtualHost *:80>
ServerName one.example.com
DocumentRoot /web/one/public

<Directory /web/one/public/ />
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>

Repeat the <VirtualHost/> block for each Rails site you want to setup.
Restart Apache to pick up the new changes by executing the following
command line: sudo /etc/init.d/apache2 restart

What about a2ensite?

Are your new virtual host files symlinked into /etc/apache2/sites-
enabled? If not, apache never sees them...

-philip

I did not aware of that.

Could you please advise how I should do that?
Thanks!

I did not aware of that.

Could you please advise how I should do that?
Thanks!

% zmore /usr/share/doc/apache2.2-common/README.Debian.gz

should give you what you need.

I figured it out - about symlink.

But it still does not work. How do I access the different apps?

kitty00 wrote:


I figured it out - about symlink.
But it still does not work. How do I access the different apps?

Each virtual host needs a different hostname and you access the
different apps by going to the hostname. All of the hostnames will
share the same ip address.

Norm

Configuring virtual hosts can get tricky the first few times you do
it. Slicehost has excellent articles on the subject. http://articles.slicehost.com.
I go there often. Just look for the articles under your distro.

Andrew

I have only one hostname.

Thanks!

Actually, I want to deploy as sub URI.

I found the following instruction on phusion passenger web. But it
still did not work.

You can deploy multiple Rails applications under a virtual host, by
specifying RailsBaseURI multiple times. For example:

<VirtualHost *:80>
    ....
    RailsBaseURI /app1
    RailsBaseURI /app2
    RailsBaseURI /app3
</VirtualHost>

I followed the instruction on slice host too. It did not work either.
But by following the slice host, the other server which did not have
passenger running working fine with different hostnames.

I also found that by running passenger. my phpadmin is not working
anymore. Any ideas?

Thanks!

kitty00 wrote:


Actually, I want to deploy as sub URI.
I found the following instruction on phusion passenger web. But it
still did not work.
You can deploy multiple Rails applications under a virtual host, by
specifying RailsBaseURI multiple times. For example:
<VirtualHost *:80>
....
RailsBaseURI /app1
RailsBaseURI /app2
RailsBaseURI /app3
</VirtualHost>
I followed the instruction on slice host too. It did not work either.
But by following the slice host, the other server which did not have
passenger running working fine with different hostnames.
I also found that by running passenger. my phpadmin is not working
anymore. Any ideas?
Thanks!

No experience with sub uri but based on the other passenger use I am
familiar with I would assume that you need to put one URI per virtual
host.

Norm

Thanks!
Yes, I did implement that way. each URI per virtual host per file. But
it still did not work.

kitty00 wrote:

Thanks!
Yes, I did implement that way. each URI per virtual host per file. But
it still did not work.

What URIs are you using? What errors are you getting?

Best,

I was trying to deploy them as:
domain.com/app1

domain.com/app2

But I got the error message: the page you are looking for does not
exist.