Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Redmine Cookbook

You're reading from   Redmine Cookbook Over 80 hands-on recipes to improve your skills in project management, team management, process improvement, and Redmine administration

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher Packt
ISBN-13 9781785286131
Length 322 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Aleksandar Pavic Aleksandar Pavic
Author Profile Icon Aleksandar Pavic
Aleksandar Pavic
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Installing and Running Redmine 2. Customizing Redmine FREE CHAPTER 3. Project Management with Redmine 4. Improving Team Performance 5. Regular and Planned Maintenance 6. Performance and System Tuning 7. Integrating Redmine with Other Software 8. Getting the Most Out of Scripts and Plugins 9. Troubleshooting 10. Making the Most of Redmine Index

Running Redmine with Phusion Passenger

Phusion Passenger is a Ruby application server that was originally designed to run web applications (such as Redmine) that were built on the Ruby on Rails framework. Nowadays it has evolved, and besides Ruby applications, it supports Python and Node.js, making it a good candidate for various use cases.

This recipe is written for the Ubuntu 14.04 server.

Getting ready

Make sure that you have Apache and passenger installed:

sudo apt-get install apache2 libapache2-mod-passenger

How to do it…

To configure Passenger, perform the following steps:

  1. Open /etc/apache2/mods-available/passenger.conf with your favourite editor, or use nano:
    nano /etc/apache2/mods-available/passenger.conf
    
  2. Add the following line: PassengerDefaultUser www-data.
  3. So, your passenger.com will look something like this:
    <IfModule mod_passenger.c>
      PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
      PassengerDefaultRuby /usr/bin/ruby
      PassengerDefaultUser www-data
    </IfModule>

    Tip

    If you are using a different Ruby version installed via RVM, update the paths accordingly. Also replace www-data with your user.

    Please keep in mind that PassengerDefaultUser can be entered in your virtual server's config file, which you may need to edit manually for installations on shared hosting.

  4. Create a symbolic link to the Redmine public folder from a web server's root folder like this:
    sudo ln -s /usr/share/redmine/public /var/www/html/redmine
    
  5. This link assumes that you installed Redmine through apt-get. If this is not the case and you installed it somewhere else such as /home/user/redmine, then you must adjust your links according to your Redmine installation and www root, which may look something like this (for example):
    ln –s /home/user/redmine/public /home/user/public_html/redmine
    
  6. Make sure that passenger is enabled in Apache:
    sudo a2enmod passenger
    
  7. Modify /etc/apache2/sites-available/000-default.conf by typing the following:
    sudo nano  /etc/apache2/sites-available/000-default.conf
    
  8. Add the following content near other Directory sections; if there are none, just make sure it's added before closing the </VirtualHost> line:
    <Directory /var/www/html/redmine>
        RailsBaseURI /redmine
        PassengerResolveSymlinksInDocumentRoot on
    </Directory>
  9. Install bundler by typing the following:
    sudo gem update && sudo gem install bundler
    
  10. Finish the installation and restart Apache:
    sudo touch /usr/share/redmine/Gemfile.lock
    sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock
    sudo service apache2 restart
    

After restarting Apache, your Redmine installation should be ready to access by going to http://your_server/redmine.

How it works…

First, you installed Apache web server and Phusion Passenger as a Ruby application server, which runs as an Apache module. Then you edited Apache's configuration file for Passenger by adding the default user to be www-data. After this, we created a symbolic link from Redmine's public directory to the web server's root directory. Then, we edited the virtual server's config to serve this particular directory with two Redmine-related configs – RailsBaseURI/redmine, —which tells Ruby on Rails to access Redmine via the /redmine subfolder, and PassengerResolveSymlinksInDocumentRoot tells Passenger to follow symlink to find a Rails application through the symlink path. Instead of this, you could have written the following:

PassengerAppRoot /usr/share/redmine/

Redmine would work the same way.

There's more…

The best way to run Redmine or any other web-exposed software is to run it as a restricted user from its home directory and adjust Apache or any other web server to serve data from this directory. Running Redmine as a subdomain such as http://redmine.yoursite.com, is done by creating an ordinary subdomain, and an Apache virtual host file for this subdomain with the settings that are provided in this recipe.

See also

If you stumble upon an error such as 403 (forbidden), error 500, or if you see Ruby code on the screen or the Passenger error screen, but you have followed the preceding steps exactly, refer to Troubleshooting Apache installations section in Chapter 9, Troubleshooting.

If you need to run Redmine as sub-uri, then take a look at http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image