Skip to content

Instantly share code, notes, and snippets.

@meteoritt
Forked from skaag/redmine2.3inst.sh
Created September 23, 2013 05:37
Show Gist options
  • Save meteoritt/6666778 to your computer and use it in GitHub Desktop.
Save meteoritt/6666778 to your computer and use it in GitHub Desktop.
# Install some system dependencies:
apt-get install build-essential openssl libcurl4-openssl-dev \
libreadline6 libreadline6-dev curl mysql-server libmysqlclient-dev git-core \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev \
libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion \
pkg-config imagemagick joe libmagickwand-dev libmagickwand4
# Install Ruby via RVM (easiest!):
cd /root/
curl -L https://get.rvm.io | bash -s stable --ruby
source /usr/local/rvm/scripts/rvm
echo '[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"' >> ~/.bashrc
# Install Passenger + Nginx:
gem install passenger --no-ri --no-rdoc
passenger-install-nginx-module
# Get some redmine scripts
useradd -m redmine -s /bin/bash
cd ~redmine
git clone git://github.com/jnstq/rails-nginx-passenger-ubuntu.git
mv rails-nginx-passenger-ubuntu/nginx/nginx /etc/init.d/
chown root:root /etc/init.d/nginx
chmod +x /etc/init.d/nginx
# Add the server section for our redmine install (remove the other server{} block):
joe /opt/nginx/conf/nginx.conf
server {
listen 80;
server_name redmine.nsa.co.il;
root /var/data/redmine/public;
passenger_enabled on;
client_max_body_size 50m;
}
# Download the latest 2.3 redmine version:
mkdir /var/data
cd /var/data
svn co http://svn.redmine.org/redmine/branches/2.3-stable redmine
# Get the dependencies installed:
cd redmine/
bundle install --without postgresql sqlite development test rmagick --path bundle
# Create some required folders / Fix permissions:
mkdir public/plugin_assets
chown -R www-data:www-data files log tmp public/plugin_assets config.ru
chmod -R 755 files log tmp public/plugin_assets
# Configure the 'production' database, you can remove the other sections:
cp config/database.yml.example config/database.yml
joe config/database.yml
# Login to mysql to create the database
mysql -uroot -p
# Create the redmine database, user, password (as configured in database.yml)
create database redminedb character set utf8;
grant all privileges on redminedb.* to redmine@localhost identified by 'redmine';
flush privileges;
\q
# Load the redmine database
rake db:migrate
# Restart nginx and passenger:
service nginx restart
touch tmp/restart.txt
# Access redmine: http://yourdomain.com/
# User: admin
# Pass: admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment