Documente Academic
Documente Profesional
Documente Cultură
Geek Quickies
Stories from the cloudvergence.
RSS
Pre-requisites
Logged as root, install the following packages:
1 yum install make gcc gcc-c++ zlib-devel ruby-devel rubygems ruby-libs apr-devel apr-util-devel httpd-devel mysql-devel mysql-server automake autoconf ImageMagick Image
Install Redmine
Redmine is installed with the following commmands:
1 cd /var/www 2 wget http://rubyforge.org/frs/download.php/76255/redmine-1.4.4.tar.gz 3 tar zxf redmine-1.4.4.tar.gz 4 ln -s redmine-1.4.4 redmine 5 rm -f redmine-1.4.4.tar.gz
Database creation
First we start MySQL:
1 service mysqld start
On the database.yml file, the production section should look like this:
1 production: 2 adapter: mysql 3 database: redmine 4 host: localhost 5 username: redmine
1 of 4
4/6/2014 6:41 PM
Installing Redmine on CentOS 6.2 wiht MySQL and Apache - Geek Q...
6 7
And then we create and populate the database with the following rake commands:
1 cd /var/www/redmine 2 rake generate_session_store 3 rake db:migrate RAILS_ENV="production" 4 rake redmine:load_default_data RAILS_ENV="production"
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:
1 -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT 2 -A INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT
Passenger installation
To install Phusion passenger, we firts install its gem:
1 gem install passenger
Apache configuration
We remove the default Apache configuration and replace it by a new one:
1 cd /etc/httpd 2 mv conf.d available 3 mkdir conf.d
In the empty new conf.d folder, we create a redmine.conf file with the following configuration:
1 # Loading Passenger 2 LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13/ext/apache2/mod_passenger.so 3 PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13 4 PassengerRuby /usr/bin/ruby 5 6 <VirtualHost *:80> 7 ServerName redmine.mycompany.com 8 DocumentRoot /var/www/redmine/public 9 <Directory /var/www/redmine/public> 10 # This relaxes Apache security settings. 11 AllowOverride all 12 # MultiViews must be turned off. 13 Options -MultiViews 14 allow from all 15 </Directory> 16 17 ErrorLog "|/usr/sbin/rotatelogs /etc/httpd/logs/redmine-error.%Y-%m-%d.log 86400" 18 CustomLog "|/usr/sbin/rotatelogs /etc/httpd/logs/redmine-access.%Y-%m-%d.log 86400" "%h %l %u %t %D \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" 19 20 </VirtualHost>
We then enable named based virtual hosting for our server by uncomenting the following line in the /etc/httpd/conf/httpd.conf file:
1 ...
2 of 4
4/6/2014 6:41 PM
Installing Redmine on CentOS 6.2 wiht MySQL and Apache - Geek Q...
We give full access on the redmine folder to the apache user and test the configuration:
1 chown -R apache:root /var/www/redmine 2 service httpd configtest
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:
1 setenfore Permissive
And letting the Permissive mode survive a reboot by modifyin the /etc/selinux/config file from:
1 SELINUX=enforcing
to
1 SELINUX=permissive
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:
1 service httpd start
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 :
1 -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT 2 -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Cleaning up
A quick command to clean up all the devel stuff needed for installation:
1 yum remove '*-devel' make automake autoconf
Tips
Dont forget that if you change your Redmine configuration, you dont have to restart Apache. Your can restart only Redmine with the command:
1 touch /var/www/redmine/tmp/restart.txt
If you restore data on your server from another redmine instance that runs on a previous version, dont forget to migrate your data:
1 cd /var/www/redmine 2 rake db:migrate RAILS_ENV="production"
Posted by Antoine Martin Jul 6th, 2012 CentOS, Linux, Redmine, Ruby
Tweet 0 1
Django on Windows: run Celery as a Service Quickly deploy a Git project on a server with SSH
Comments
Recent Posts
Mirror a Git repository through SSH Checking Google Play Signatures on .Net Avoid Thread Issues while Testing an Android Service Unlock and root a Nexus device Quickly deploy a Git project on a server with SSH
Latest Tweets
3 of 4
4/6/2014 6:41 PM
Installing Redmine on CentOS 6.2 wiht MySQL and Apache - Geek Q...
Status updating...
Follow @antoinemartin
Google+
Copyright 2012 - Antoine Martin - Powered by Octopress
4 of 4
4/6/2014 6:41 PM