Installing Redmine on Centos 6 Dot 2 Wiht Mysql and Apache
I needed recently to install the excellent project management tool Redmine on a CentOS 6.2 machine. There are some tutorials on the Web (here or here) but they are a little bit outdated. The following is a method that works as of today.
Pre-requisites
Logged as root, install the following packages:
|
|
And then install the bundle
ruby gem:
|
|
Install Redmine
Redmine is installed with the following commmands:
|
|
Install Redmine ruby dependencies
Bundle helps us install the ruby Redmine dependencies:
|
|
Database creation
First we start MySQL:
|
|
Then we secure it (Optional):
|
|
We then create the redmine database and user:
|
|
Redmine database configuration
We copy the database configuration example and we modify it to point to our newly created database:
|
|
On the database.yml
file, the production
section should look like this:
|
|
And then we create and populate the database with the following rake commands:
|
|
Outgoing email configuration (Optional)
To configure an outgoing SMTP server for sending emails, we create the
config/configuration.yml
file from the sample:
|
|
And edit it to provide our configuration :
|
|
Redmine standalone testing
At this point, Redmine can be tested in standalone mode by running the following command:
|
|
and open the http://localhost:3000
addess in a browser. If you are testing
from another computer, you will need to open the port in the
/etc/sysconfig/iptables
file by duplicating the ssh (port 22) line and
adapting it:
|
|
Then apply the new configuration with the following command:
|
|
Passenger installation
To install Phusion passenger, we firts install its gem:
|
|
And then install the Apache module with the command:
|
|
Apache configuration
We remove the default Apache configuration and replace it by a new one:
|
|
In the empty new conf.d
folder, we create a redmine.conf
file with the
following configuration:
|
|
We then enable named based virtual hosting for our server by uncomenting the
following line in the /etc/httpd/conf/httpd.conf
file:
|
|
We give full access on the redmine folder to the apache
user and test the
configuration:
|
|
At this point, the SELinux configuration needs to be modified to allow our apache instance to run the phusion passenger module. You can do this by putting SELinux in permissive mode:
|
|
And letting the Permissive mode survive a reboot by modifyin the
/etc/selinux/config
file from:
|
|
to
|
|
If you want to run redmine while enforcing, you may want to apply the method
described here for which you will need
to install the policycoreutils-python
package.
In any case, you will start Apache with the command:
|
|
Now you can access your Redmine installation with your browser. To access it
from all the computers in your network, you will need to open the port 80 in the
/etc/sysconfig/iptables
. You can replace the 3000 rule by :
|
|
And restart iptables.
|
|
Start services at boot
To have MySQL and Apache started at boot, run the commands:
|
|
Cleaning up
A quick command to clean up all the devel
stuff needed for installation:
|
|
Tips
Don’t forget that if you change your Redmine configuration, you don’t have to restart Apache. Your can restart only Redmine with the command:
|
|
If you restore data on your server from another redmine instance that runs on a previous version, dont forget to migrate your data:
|
|