Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SuzanneSoy/8618063 to your computer and use it in GitHub Desktop.
Save SuzanneSoy/8618063 to your computer and use it in GitHub Desktop.
# See also: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step
# See also: http://charles.lescampeurs.org/2013/11/01/redmine-on-ubuntu-13-10-with-apache2-and-passenger
echo "vb-redmine" | sudo tee /etc/hostname
sudo sed -i -e "s/vb-xub1310-64/vb-redmine/" /etc/hosts
sudo apt-get -y install apache2 libapache2-mod-passenger mysql-server mysql-client redmine redmine-mysql
# Configuring mysql-server-5.5
# New password for the MySQL "root" user:
# => root
# Repeat password for the MySQL "root" user.
# => root
# Configuring redmine
# Configure database for redmine/instances/default with dbconfig-common?
# => Yes
# Database type to be used by redmine/instances/default:
# => mysql
# Password of the database's administrative user:
# => root
# MySQL application password for redmine/instances/default:
# => redmine
# Password confirmation:
# => redmine
# Redmine will crash. To fix that, run:
sudo sed -i -e 's/adapter: mysql/adapter: mysql2/' /etc/redmine/default/database.yml
sudo dpkg --configure -a
# Password of the database's administrative user:
# => root
sudo sed -i -e '/<IfModule mod_passenger.c>/a\ PassengerDefaultUser www-data' /etc/apache2/mods-available/passenger.conf
sudo ln -s /usr/share/redmine/public /var/www/redmine
sudo sed -i -e '/<\/VirtualHost>/i\\t<Directory /var/www/redmine>' /etc/apache2/sites-available/000-default.conf
sudo sed -i -e '/<\/VirtualHost>/i\\t\tRailsBaseURI /redmine' /etc/apache2/sites-available/000-default.conf
sudo sed -i -e '/<\/VirtualHost>/i\\t\tPassengerResolveSymlinksInDocumentRoot on' /etc/apache2/sites-available/000-default.conf
sudo sed -i -e '/<\/VirtualHost>/i\\t</Directory>' /etc/apache2/sites-available/000-default.conf
echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf
sudo a2enconf fqdn.conf
sudo service apache2 restart
sudo chown -R www-data:www-data /usr/share/redmine/
cd /usr/share/redmine
sudo -u www-data rake db:migrate RAILS_ENV=production
sudo -u www-data rake redmine:plugins:migrate RAILS_ENV=production
sudo -u www-data rake tmp:cache:clear
sudo -u www-data rake tmp:sessions:clear
# In case you get a 500 error when you sign in, there’s a workaround.
# You can find an error like this in redmine production log :
#
# NoMethodError (undefined method `options' for {:user_id=>1, :ctime=>1383335524, :atime=>1383335524}:Hash):
# /usr/lib/ruby/vendor_ruby/rack/session/abstract/id.rb:329:in `commit_session'
# It seems the default rack version (1.5.2) is not compatible. Just install a previous version and update redmine’s Gemfile :
cd /
sudo -u www-data gem install rack --version 1.4.5
# Add the following line in Gemfile :
echo "gem 'rack', '1.4.5'" | sudo tee -a /usr/share/redmine/Gemfile
sudo service apache2 restart
# You can now access http://127.0.0.1:80/redmine .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment