52b29019d1783d5f7b5c9c77e8b37877

Redmine: Quick install

I install redmine on port 3000 to avoid any conflicts. So, lets start

Lets install ruby:

  1. sudo apt-get install ruby1.9.3 ruby1.9.1-dev ri1.9.1 libruby1.9.1 libssl-dev zlib1g-dev
  2. sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400
  3.          --slave   /usr/share/man/man1/ruby.1.gz ruby.1.gz
  4.                         /usr/share/man/man1/ruby1.9.1.1.gz
  5.         --slave   /usr/bin/ri ri /usr/bin/ri1.9.1
  6.         --slave   /usr/bin/irb irb /usr/bin/irb1.9.1
  7.         --slave   /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1
sudo apt-get install ruby1.9.3 ruby1.9.1-dev ri1.9.1 libruby1.9.1 libssl-dev zlib1g-dev
sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 
         --slave   /usr/share/man/man1/ruby.1.gz ruby.1.gz 
                        /usr/share/man/man1/ruby1.9.1.1.gz 
        --slave   /usr/bin/ri ri /usr/bin/ri1.9.1 
        --slave   /usr/bin/irb irb /usr/bin/irb1.9.1 
        --slave   /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1

Lets install Bundler:

  1. $ sudo gem update
  2. $ sudo gem install bundler
$ sudo gem update
$ sudo gem install bundler

Lets install redmine core:

  1. cd /usr/share
  2. sudo wget http://www.redmine.org/releases/redmine-2.6.0.tar.gz
  3. sudo tar xvfz redmine-2.6.0.tar.gz
  4. sudo rm redmine-2.6.0.tar.gz
  5. sudo mv redmine-2.6.0 redmine
  6. sudo chown -R root:root /usr/share/redmine
  7. sudo chown www-data /usr/share/redmine/config/environment.rb
  8. sudo ln -s /usr/share/redmine/public /var/www/html/redmine
cd /usr/share
sudo wget http://www.redmine.org/releases/redmine-2.6.0.tar.gz
sudo tar xvfz redmine-2.6.0.tar.gz
sudo rm redmine-2.6.0.tar.gz
sudo mv redmine-2.6.0 redmine
sudo chown -R root:root /usr/share/redmine
sudo chown www-data /usr/share/redmine/config/environment.rb
sudo ln -s /usr/share/redmine/public /var/www/html/redmine

Create DB for redmine:

  1. mysql -u root -p
  2. CREATE DATABASE redmine character SET utf8;
  3. CREATE user 'redmine'@'localhost' IDENTIFIED BY 'password';
  4. GRANT ALL privileges ON redmine.* TO 'redmine'@'localhost';
  5. exit
mysql -u root -p
CREATE DATABASE redmine character SET utf8;
CREATE user 'redmine'@'localhost' IDENTIFIED BY 'password';
GRANT ALL privileges ON redmine.* TO 'redmine'@'localhost';
exit

Setup DB connection info in Redmine in database.yml:

  1. sudo cp redmine/config/database.yml.example redmine/config/database.yml
sudo cp redmine/config/database.yml.example redmine/config/database.yml

Open copied file database.yml
sudo vim redmine/config/database.yml
And put there settings like this:

  1. production:
  2.   adapter: mysql2
  3.   database: redmine
  4.   host: localhost
  5.   username: redmine
  6.   password: password
  7.   encoding: utf8
production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: password
  encoding: utf8

Install all libraries:

  1. sudo apt-get install libapache2-mod-php5 libapache2-mod-perl2 libcurl4-openssl-dev libssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev libmysqlclient-dev libmagickcore-dev libmagickwand-dev curl git-core patch build-essential bison zlib1g-dev libssl-dev libxml2-dev libxml2-dev sqlite3 libsqlite3-dev autotools-dev libxslt1-dev libyaml-0-2 autoconf automake libreadline6-dev libyaml-dev libtool imagemagick apache2-utils
sudo apt-get install libapache2-mod-php5 libapache2-mod-perl2 libcurl4-openssl-dev libssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev libmysqlclient-dev libmagickcore-dev libmagickwand-dev curl git-core patch build-essential bison zlib1g-dev libssl-dev libxml2-dev libxml2-dev sqlite3 libsqlite3-dev autotools-dev libxslt1-dev libyaml-0-2 autoconf automake libreadline6-dev libyaml-dev libtool imagemagick apache2-utils

Then we will try to build redmine:

  1. cd /usr/share/redmine/
  2. sudo bundle install --without development test postgresql sqlite
cd /usr/share/redmine/
sudo bundle install --without development test postgresql sqlite

If you have error with make call, you can try to install it:

  1. sudo apt-get install make
sudo apt-get install make

and then launch again

  1. bundle install --without development test postgresql sqlite
bundle install --without development test postgresql sqlite

Continue installation with commands:

  1. sudo rake generate_secret_token
  2. sudo RAILS_ENV=production rake db:migrate
  3. sudo RAILS_ENV=production rake redmine:load_default_data
sudo rake generate_secret_token
sudo RAILS_ENV=production rake db:migrate
sudo RAILS_ENV=production rake redmine:load_default_data
  1. sudo mkdir public/plugin_assets
  2. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
  3. sudo apt-get install apt-transport-https ca-certificates
sudo mkdir public/plugin_assets
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
sudo apt-get install apt-transport-https ca-certificates

Open repository file

  1. sudo vim /etc/apt/sources.list.d/passenger.list
sudo vim /etc/apt/sources.list.d/passenger.list

And add repository source

  1. deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main
deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main
  1. sudo chown root: /etc/apt/sources.list.d/passenger.list sudo chmod 600 /etc/apt/sources.list.d/passenger.list
  2. sudo apt-get update
  3. sudo apt-get install libapache2-mod-passenger
sudo chown root: /etc/apt/sources.list.d/passenger.list sudo chmod 600 /etc/apt/sources.list.d/passenger.list
sudo apt-get update
sudo apt-get install libapache2-mod-passenger

Configure Passenger:

  1. sudo vim /etc/apache2/mods-available/passenger.conf
sudo vim /etc/apache2/mods-available/passenger.conf

Add following line to passenger config file:

  1. PassengerDefaultUser www-data
PassengerDefaultUser www-data

Open apache2 config file:

  1. sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/redmine.conf
  2. sudo vim /etc/apache2/sites-available/redmine.conf
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/redmine.conf
sudo vim /etc/apache2/sites-available/redmine.conf

Add following part to apache2 config file

  1. <VirtualHost *:3000>
  2.        <Directory /var/www/html/redmine>
  3.                RailsBaseURI /
  4.                PassengerResolveSymlinksInDocumentRoot on
  5.        </Directory>
<VirtualHost *:3000>
       <Directory /var/www/html/redmine>
               RailsBaseURI /
               PassengerResolveSymlinksInDocumentRoot on
       </Directory>
  1.        ServerAdmin admin_email@email
  2.        ErrorLog ${APACHE_LOG_DIR}/redmine-errors.log
  3.        CustomLog ${APACHE_LOG_DIR}/redmine-access.log combined
  4. </VirtualHost>
       ServerAdmin admin_email@email
       ErrorLog ${APACHE_LOG_DIR}/redmine-errors.log
       CustomLog ${APACHE_LOG_DIR}/redmine-access.log combined
</VirtualHost>

Enable config:

  1. a2ensite redmine.conf
a2ensite redmine.conf

Open

  1. sudo vim /etc/apache2/ports.conf
sudo vim /etc/apache2/ports.conf

And add

  1. Listen 3000
Listen 3000

Allow port 3000 for HTTP connections in SecurityGroups of EC2 Management Console.

Lets restart apache

  1. sudo service apache2 restart
sudo service apache2 restart

And check redmine using url like this http://put_here_EC2_instance_IP_ADDRESS:3000/ with default user account

  1. user: admin
  2. password: admin
user: admin
password: admin

That is it, basic installation is finished and you have installed LAMP, and Redmine as a Project management tool.

I spent about 40 minutes for all this operations, and I think you will manage to do it faster.

Cheers =)

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterEmail this to someoneShare on LinkedIn

Aboutalex

Вэб-программист. Занимаюсь разработкой cервисов, написанием API, вэб-приложений. Интересна разработка приложений для высоконагруженных систем, анализ данных..

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *

8 + 8 =