Project

General

Profile

Redmine and Phusion Passenger

Added by Carsten Schurig over 15 years ago

Hi,

just wanted to report about my experience with Phusion Passenger (http://www.modrails.com/): so far it rocks! I used a plain mod_proxy/mongrel_cluster configuration before (as written in the wiki) and have the impression that performance improved greatly. Memory usage of the server looks better as well (I moved to Ruby enterprise edition as well), but I want to wait a few days for more definite numbers.

Are there any known compatibility problems between Redmine and Phusion Passenger? The only change I did need to make to my redmine installation was a small adaptation of public/.htaccess: I moved all Rewrite directives into an <IfModule mod_rewrite.c> block as Phusion Passenger deactivates mod_rewrite in it's standard configuration because of some compatibility problems.

If there are no good reason against running Redmine using Phusion Passenger I would like to see it mentioned in the Wiki as an alerternative to mongrel_cluster.

BTW: I think the mongrel_cluster Wiki entry should be changed a bit: remove the Rewrite* directives in the virtual host definition and use ProxyPass* directives instead.


Replies (15)

RE: Redmine and Phusion Passenger - Added by Jim Mulholland over 15 years ago

Carston, we have been using Redmine with Passenger for 5+ months without issues. Good idea about updating the wiki.

RE: Redmine and Phusion Passenger - Added by Joe Blauer over 15 years ago

I had one issue that forced me to revert to mongrel for the time being.

In order to access a subversion repository via self-certified SSL, I needed to accept a certificate, but couldn't figure out how to do so as the apache user, so I reverted to using mongrel running as root.

Does anyone know how I can resolve this?

thanks.

RE: Redmine and Phusion Passenger - Added by Eric Davis over 15 years ago

Joe Blauer wrote:

In order to access a subversion repository via self-certified SSL, I needed to accept a certificate, but couldn't figure out how to do so as the apache user, so I reverted to using mongrel running as root.

Try switching your user to the apache user and doing an svn checkout into a temporary directory (you can delete it later).

root@server$ su - apache
apache@server$ svn co https://svn.repo /tmp/checkout
... Do you wish to accept this SSL certificate? ...

Eric

RE: Redmine and Phusion Passenger - Added by Joe Blauer over 15 years ago

Thanks guys. I tried accepting the cert permanently as the apache user, but it doesn't stick (i.e. it re-prompts every time, even though I accept it permanently). I'm guessing this has something to do with the fact that the apache user doesn't have a home directory to store it in. I'm going to look into this further, but if someone has the answer I'd love to hear it.

RE: Redmine and Phusion Passenger - Added by Carsten Schurig over 15 years ago

As my subversion server is the same as the redmine server, I configured it differently. I configured an apache without SSL listening on a local port only on 127.0.0.1 and serving the subversion repository read-only there. Then redmine can access the subversion server without any credentials.

If the server is only listening localy it doesn't make much sense to use SSL anyways. Further I don't want to store any svn access credentials readable in the redmine database. So it is much better to allow an "anonymous" access to the svn for redmine.

BTW: phusion passenger runs RoR applications not neccessarily as the apache user! IMO the user of environment.rb is used to decide what user will be used in standard configuration. Read the Phusion Passenger docs for more on this.

RE: Redmine and Phusion Passenger - Added by Joe Blauer over 15 years ago

Still no luck.

Here's what I tried:

chsh -s /bin/bash apache
mkdir /home/apache
usermod --home /home/apache apache
su - apache
svn ls https://<my repo>

On the last command, I accepted the certificate permanently. Reexecuting the last command eliminates the prompt, so the cert is definitely there.

But when configuring my app for Passenger and trying to access the repository, a prompt for the certificate STILL appears in my error_log.

RE: Redmine and Phusion Passenger - Added by Joe Blauer over 15 years ago

Thanks Carsten, I was thinking of doing something like that myself, but I thought I'd prefer my repository paths in redmine to be exactly like they are elsewhere. But if all else fails, that's what I'll do.

But that's the first I'm hearing about Passenger not using the apache user - interesting. Would certainly explain my problem. I assume you mean the owner of the environment.rb?

RE: Redmine and Phusion Passenger - Added by Joe Blauer over 15 years ago

Thanks for pointing that out Carsten. It solved my problem.

Here's the relevant part of the Passenger docs, for anyone who's wondering:

http://www.modrails.com/documentation/Users%20guide.html#user_switching

I tried disabling user switching without success, so I changed the owner of my environment.rb to apache, and it now works beautifully.

Thanks again!

RE: Redmine and Phusion Passenger - Added by Carsten Schurig over 15 years ago

Good to hear that your problem has been solved by this ;)

For the different URLs in my setup I don't care much because the redmine interface doesn't reveal the URL it uses to access the repository IMO. For configuration I have just to replace the host part (including port). Everything else is setup the same. External URL is https://host.domain.xx:12345/svn/ and "internal" URL is http://localhost:12346/svn/. So no big difference...

RE: Redmine and Phusion Passenger - Added by Joseph Simmons about 15 years ago

Is it possible for you to post your .htaccess file? I'm trying to set things up using an Alias and I can't seem to get it right.

RE: Redmine and Phusion Passenger - Added by Giorgio Gonnella almost 15 years ago

I simply deleted .htaccess and it seems to work fine (I didn't try to access the repository, as I don't need it)

RE: Redmine and Phusion Passenger - Added by Peter Mueller over 14 years ago

Hi,

  • I'm running mongrel rails cluster from user redmine. Running a server application as root is not that nice.
  • Appache runs from user appache, default at Debian Lenny.
To accept the ssl certificate for svn+ssl do
  • su redmine
  • cd
  • svn co https: ...
    accept the cerificate permanentely

All should work now. It took me quite some days to find out this.

peter

Hello! I'm new here - Added by JimBaenGreen JimBaenGreen over 14 years ago

SPAM removed

RE: Redmine and Phusion Passenger - Added by Anthony Cartmell over 11 years ago

I too have found my Passenger process running as nobody instead of apache.

I added this line to my apache config:

 PassengerUser apache

so the standard passenger.conf, as installed on Centos 6 by yum, has:

LoadModule passenger_module modules/mod_passenger.so
<IfModule mod_passenger.c>
   PassengerRoot /usr/share/rubygems/gems/passenger-3.0.17
   PassengerRuby /usr/bin/ruby
   PassengerUser apache
</IfModule>

# Deploying a Ruby on Rails application: an example

# Suppose you have a Rails application in /somewhere. Add a virtual host to
# your Apache configuration file and set its DocumentRoot to /somewhere/public:
#
#    <VirtualHost *:80>
#       ServerName www.yourhost.com
#       DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
#       <Directory /somewhere/public>
#          AllowOverride all              # <-- relax Apache security settings
#          Options -MultiViews            # <-- MultiViews must be turned off
#       </Directory>
#    </VirtualHost>

    (1-15/15)