Saturday, January 28, 2012

Install redmine

I referred to the following documents

http://www.redmine.org/projects/redmine/wiki/RedmineInstall                   ( redmine basic setup & Ruby setup )
http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_Ubuntu   ( appache setup using passenger)


http://theeye.pe.kr/entry/how-to-install-redmine-which-good-project-management-system-is-better-than-trac
http://blog.naver.com/budget74?Redirect=Log&logNo=90103735211


0. Install redmine
- sudo apt-get install redmine
- libraries related to Ruby are installed automatically.
-

1. Install Mysql

- Install
sudo apt-get install mysql-server mysql-client

- Setup for redmine
sudo /etc/init.d/mysql restart ( stop for halting mysqld for special command : e.g.  mysqld_safe --skip-grant )


- create databases for redmine
$mysql -u root -p

mysql>                       //type the following sql command
create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost';

--------------------------------------------------------------------------------------
$sudo /etc/init.d/mysqld stop
$ mysqld_safe --skip-grant
$ mysql                              //use the another terminal
mysql> use mysql;
mysql> update user set password=password('') where user = 'root';mysql> flush privileges;
--------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------
tmax@control-machine:/var/www/redmine$ mysql -u redmine -p
Enter password:                 //type password
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 46
Server version: 5.1.41-3ubuntu12.10 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| redmine            |
+--------------------+
2 rows in set (0.00 sec)
mysql>
--------------------------------------------------------------------------------------

sudo a2enmod passenger

2. RubySetting

- Create the database structure, by running the following command under the application root directory ( in my case : /usr/share/redmine/public )

$rake generate_session_store
$sudo RAILS_ENV=production rake db:migrate

$ sudo RAILS_ENV=production rake redmine:load_default_data


(+) forced database type setting

$ rails --database=mysql

3. Appache

$ sudo apt-get install libapache2-mod-passenge
$ sudo ln -s /usr/share/redmine/public /var/www/redmine //link redmine into www


By default, passenger runs as 'nobody', so you'll need to fix that. In /etc/apache2/mods-vailable/passenger.conf, add:



----------------------------------------------------------------
PassengerDefaultUser www-data
----------------------------------------------------------------


[In my case]
----------------------------------------------------------------
1 <ifmodule mod_passenger.c="">
2 PassengerRoot /usr
3 PassengerRuby /usr/bin/ruby
4 PassengerDefaultUser www-data
5  </ifmodule>
----------------------------------------------------------------

You'll also need to configure the /var/www/redmine location in /etc/apache2/sites-available/default by adding:

----------------------------------------------------------------
<Directory /var/www/redmine>

    RailsBaseURI /redmine
    PassengerResolveSymlinksInDocumentRoot on
</Directory>
----------------------------------------------------------------
In my case
----------------------------------------------------------------
....
32     Alias /doc/ "/usr/share/doc/"
33    
34         Options Indexes MultiViews FollowSymLinks
35         AllowOverride None
36         Order deny,allow
37         Deny from all
38         Allow from 127.0.0.0/255.0.0.0 ::1/128
39    

40   <Directory /var/www/redmine>
41     RailsBaseURI /redmine
42     PassengerResolveSymlinksInDocumentRoot on
43   
</Directory>
44
----------------------------------------------------------------



- Enable passenger:

$ sudo a2enmod passenger

Restart apache2

$ sudo /etc/init.d/apache2 restart

and you should be able to access Redmine at: http://redmine.server.ip.address/redmine

If you receive a "403: Forbidden" error after setting up Redmine, the Redmine 'public' folder may have incorrect permissions set. The executable bit on the public folder must be enabled or you will receive a "403: Forbidden" error when attempting to access Redmine.

$ sudo chmod a+x /usr/share/redmine/public

4. admin account
id/pw: admin/admin

No comments: