Install Ruby and Passenger
- Install relevant packages by yum
yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mod_fcgid gcc-c++
yum install -y ruby-libs ruby ruby-rdoc ruby-devel rubygems
gem install passenger
passenger-install-apache2-module
- While installing, it needs significant of memory to compile the source code. Create swap file if necessary
dd if=/dev/zero of=/swapfile bs=1024 count=2097152
mkswap /swapfile
swapon /swapfile
Install MariaDB
yum install mariadb-server mariadb-devel mariadb
systemctl start mariadb.service
systemctl enable mariadb.service
mysql_secure_installation
mysql -uroot -p<PASSWORD>
> create database redmine character set utf8;
> create user 'redmine'@'localhost' identified by '<input_your_password>';
> grant all privileges on redmine.* to 'redmine'@'localhost';
Install Redmine
tar zxf redmine-3.2.1.tar.gz
chown -R apache:apache redmine-3.2.1
mv redmine-3.2.1 /var/www/redmine
Configure Redmine
- Rename redmine/config/database.yml.example to database.yml, and edit it
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: <input_your_password>
encoding: utf8
- Generate the secret token
cd redmine/config
rake generate_secret_token
- Migrate the database models
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
chown -R apache:apache files log tmp public plugins
chmod -R 755 files log tmp public plugins
gem install bundler
cd /var/www/redmine
bundle install
Configure Apache
- Create /etc/httpd/conf.d/redmine.conf (Change passenger version according to your installed version)
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p648/gems/passenger-5.0.23/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p648/gems/passenger-5.0.23
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.0.0-p648/wrappers/ruby
Listen 8080
<VirtualHost *:8080>
ServerName localhost
DocumentRoot "/var/www/redmine/public/"
<Directory "/var/www/redmine/public/">
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
systemctl restart httpd.service
Done
- Browse http://localhost:8080/ and login by admin:admin