GIT – How to redmine on Ubuntu

Run these commands on your server

apt-get update
apt-get upgrade

Installing LAMP

Install Apache with Modules

apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-prefork-dev apache2-utils libexpat1 ssl-cert

Enable Apache Modules

a2enmod ssl
a2enmod rewrite
a2enmod suexec
a2enmod include

Install with Modules

apt-get install mysql-server mysql-client libmysqlclient-dev

Installing MySQL connector

apt-get install libmysql-ruby libmysqlclient-dev

Install PHP5 (Ruby and Apache modules)

apt-get install libapache2-mod-php5 libapache2-mod-ruby php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

Required packages for installing Redmine

Install ruby

apt-get install ruby-full build-essential

Check ruby version

ruby –v

Install RubyGems

apt-get install rubygems

Manually installed rubygems

wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
tar -zxvf rubygems-1.3.1.tgz
cd rubygems-1.3.1
sudo ruby setup.rb

Check GEM version

gem –v

Install Rails

gem install rails

Required extra packages

apt-get install ruby1.8-dev libgemplugin-ruby libgemplugin-ruby1.8 libruby-extras libruby1.8-extras rubygems1.8 subversion rake apache2-threaded-dev libapache-dbi-perl libapache2-mod-perl2 libdigest-sha1-perl libapache2-svn

Install Passenger
Run the following to install passenger, an apache module that adds support for running rails apps within apache

gem install passenger
passenger-install-apache2-module

If you have faced this error [passenger-install-apache2-module: not found]. So run this following

sudo /var/lib/gems/1.8/bin/passenger-install-apache2-module

Add these line /etc/apache2/apache2.conf

PassengerDefaultUser root
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11
PassengerRuby /usr/bin/ruby1.8

cd /var/www/

Download Redmine


wget http://files.rubyforge.vm.bytemark.co.uk/redmine/redmine-0.9.4.tar.gz
sudo tar -zxvf redmine-0.9.4.tar.gz

Folder Rename


mv redmine-0.9.4 redmine
chown -Rf www-data:www-data redmine

Configuring redmine
Create Mysql DB
login MySQL

mysql -u username -pyourpassword
mysql> create database redminedbname;
quit

cd /var/www/redmine/config
cp database.yml.example database.yml

There is necessary complete the configuration inside database.yml

production:
adapter: mysql
database: redminedbname
host: localhost
username: dbusername
password: XXXXXXXX
encoding: utf8
socket: /var/run/mysqld/mysqld.sock

cd /var/www/redmine

Redmine stores session data in cookies by default,
which requires a  secret to be generated. This can be done by running:

RAILS_ENV=production rake config/initializers/session_store.rbrake
generate_session_store
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_dat

The user who runs Redmine must have write permission on the following
subdirectories:files, log,tmp (create the last one if not present).
Assuming you run Redmine with a redmine user:

mkdir tmp public/plugin_assets
sudo chown -R www-data:www-data files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets

Test the installation by running WEBrick web server:

ruby script/server webrick -e production

Once WEBrick has started, point your browser to http://localhost:3000/.
You should now  see the application welcome page.
Use default administrator account to log in:

login: admin
password: admin

Configured application with Apache
Now you should point apache to the location of your Ruby app.
Create something like this in /etc/apache2/sites-available/redmine.com

<VirtualHost *>
ServerName redmine.hostname.com
DocumentRoot /var/www/redmine/public
</VirtualHost>

Create the site on webserve
a2ensite sitename

Restart web server using the following command

sudo /etc/init.d/apache2 restart

Now open your web-browser and enter the following address
http://domain-name or server-ip/redminesitename

Print Friendly

Comments

comments

Bài viết liên quan