Skip to content

Instantly share code, notes, and snippets.

@GregoireHebert
Last active August 28, 2015 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GregoireHebert/3a08c04b49584a42296b to your computer and use it in GitHub Desktop.
Save GregoireHebert/3a08c04b49584a42296b to your computer and use it in GitHub Desktop.
A debian 8 Jessie Installation procedure (written as bash but not made to be executed)
# NOTES #
# Installation available for a debian 8
# Ensure you got root privileges
# Installation of Apache, php, mysql, curl, subversion
apt-get install mysql-server mysql-common libmysqlclient-dev mysql-client apache2 apache2-mpm-prefork apache2-prefork-dev libapr1-dev libaprutil1-dev libfcgi-dev libssl-dev zlib1g-dev libcurl4-openssl-dev phpmyadmin imagemagick libmagickwand-dev php5 libapache2-mod-php5 php5-mysql php5-ldap php5-imagick php5-curl php5-gd php5-intl php-pear php5-imap php5-mcrypt php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl php-apc curl subversion
# Installation of Ruby
apt-get install gcc build-essential zlib1g zlib1g-dev libssl-dev libyaml-dev libcurl4-openssl-dev libapr1-dev libxslt-dev checkinstall libffi-dev libreadline-dev git-core
# Using rvm insteand of rbenv because of some troubles...
mkdir /usr/local/rvm
cd /usr/local/rvm
# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 # does not work
curl -sSL https://get.rvm.io | bash -s stable --rails # takes time
usermod -aG rvm www-data
# Reloading shell
source ~/.bashrc
# start using rvm
source /usr/local/rvm/scripts/rvm
# defining version 2.2.1
rvm use 2.2.1
# Check installation
ruby -v # should have 2.2.1 -> if 1.8.* you got debian package... redo previous installation up above
gem -v
# Installation of bundler
gem install bundler
# Installation of passenger
gem install passenger
# Activate passenger
passenger-install-apache2-module
# Choose ruby language
# Follow passenger indications -> open a new ssh connection and edit 2 new files
# Defining the config mod files
nano /etc/apache2/mods-available/passenger.conf
# add theses lines without the #:
#<IfModule mod_passenger.c>
# PassengerRoot /usr/local/rvm/gems/ruby-2.2.1/gems/passenger-5.0.16
# PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.2.1/wrappers/ruby
#</IfModule>
nano /etc/apache2/mods-available/passenger.load
# Add this line without the #:
#LoadModule passenger_module /usr/local/rvm/gems/ruby-2.2.1/gems/passenger-5.0.16/buildout/apache2/mod_passenger.so
# Activate the module and restart apache2
a2enmod passenger
service apache2 restart
# Check passenger is active
apache2ctl -t -D DUMP_MODULES | grep passenger # passenger_module (shared)
# Connect to mysql
mysql -u root -p
# Create the database ! Don't forget to change password
CREATE DATABASE redmine CHARACTER SET utf8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
# Installation of redmine
mkdir -p /data/www/rubyonrails/
cd /data/www/rubyonrails
# Creation of a user "redmine" in the www-data group
useradd -d /home/ -g 33 -m -s /bin/sh redmine
# Getting the archive and add a ln to ease the updates
wget http://www.redmine.org/releases/redmine-3.0.3.tar.gz
tar xvfz redmine-3.0.3.tar.gz
rm redmine-3.0.3.tar.gz
ln -s redmine-3.0.3 redmine
# Configure the database access
cp -p /data/www/rubyonrails/redmine/config/database.yml.example /data/www/rubyonrails/redmine/config/database.yml
# Place yourself in the redmine directory
cd /data/www/rubyonrails/redmine/
# Install depedencies, take some time
bundle install --without development
# Generate the token
bundle exec rake generate_secret_token
# Check if the production and development settings are right in this file (host login password...)
nano config/database.yml
# Create schema and populate the database
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data
# Note : select fr language
# Configure vhost
nano /etc/apache2/sites-available/redmine.conf
# Replace the serveur name with yours
# And the logs directories as well
# Fell free to adapt the Access Control
#<VirtualHost *:80>
# ServerName redmine.site.com
# DocumentRoot /data/www/rubyonrails/redmine/public/
#
# <Directory /data/www/rubyonrails/redmine/public/>
# Options Indexes FollowSymLinks MultiViews
# AllowOverride All
# Order allow,deny
# allow from all
# #for version 2.4 of apache instead of the 4 lines up above, just write
# #Require all granted
# </Directory>
#
# RailsEnv production
#
# AddOutputFilter DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css
# BrowserMatch ^Mozilla/4 gzip-only-text/html
# BrowserMatch ^Mozilla/4.0[678] no-gzip
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
#
# ErrorLog /var/log/apache2/redmine.site.com/error.log
# LogLevel warn
# CustomLog /var/log/apache2/redmine.site.com/access.log combined
#</VirtualHost>
# Create the log dir, don't forget to change the directory name according to the vhost
mkdir /var/log/apache2/redmine.site.com/
# Some apache mods needed.
a2enmod ssl
a2enmod dav
a2enmod rewrite
a2enmod headers
# Enable the vhost
a2ensite redmine.site.com
service apache2 restart
# Cleaning
apt-get autoremove -y
apt-get clean
# =============
# Plugin installation
# =============
# Paste the plugin directory into /data/www/rubyonrails/redmine/plugins
# and place yourself in redmine folder
cd /data/www/rubyonrails/redmine
# Update installing missing gems
bundle install --without development test
# Migrate the plugin
rake redmine:plugins:migrate RAILS_ENV=production
# Reload apache for redmine to concider the plugin.
service apache2 restart
@GregoireHebert
Copy link
Author

Add the plugin CRM installation procedure

@GregoireHebert
Copy link
Author

Remove useless and error generating package : php5-snmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment