天天看點

HowTo Install Redmine in Ubuntu - Redmine Ubuntu 10.04 (and 10.04.1) using Passenger Ubuntu 10.4 using mod_cgi Redmine Installation on Virtual or Normal Ubuntu < 10.04

原文:http://www.redmine.org/projects/redmine/wiki/howto_install_redmine_in_ubuntu

the installation assumes that the web server and database are already in place, so you probably want to install the lamp stack first if you don't already have it:

$ sudo tasksel install lamp-server

also, the default apparmor configuration can get in the way, so you may need to set the mysqld profile to complain:

$ sudo aa-complain /usr/sbin/mysqld

as of 10.04, redmine is available through ubuntu's package manager, and installation is simple:

$ sudo apt-get install redmine redmine-mysql subversion

the second package, redmine-mysql, can be replaced by either redmine-pgsql or redmine-sqliteif you want to use either of those databases.

the installation process should prompt you for all the interesting details.

redmine will now be installed in <code>/usr/share/redmine</code> and <code>/etc/redmine</code>

note: the package with ubuntu is stuck in the 0.9.x branch for now. a ppa exists that has the 1.1 branch here:https://launchpad.net/~ondrej/+archive/redmine

to install redmine using the ppa:

note: if your server is behind a firewall, you will need to export your firewall settings before running <code>add-apt-repository</code>. otherwise, the command will hang. 

run the following

you will also need to install the passenger apache module.

sudo apt-get install libapache2-mod-passenger

if you set your apparmor mysqld profile to complain you ought to set it back to enforce:

$ sudo aa-enforce /usr/sbin/mysqld

symlink <code>/usr/share/redmine/public</code> to your desired web-accessible location. e.g.:

$ sudo ln -s /usr/share/redmine/public /var/www/redmine

by default, passenger runs as 'nobody', so you'll need to fix that. in <code>/etc/apache2/mods-available/passenger.conf</code>, add:

passengerdefaultuser www-data

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

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

the second package, redmine-mysql, can be replaced by either redmine-pgsql or redmine-sqlite if you want to use either of those databases.

using ubuntu server 10.04.1, configuring redmine via mod_cgi as described in this section does not seem to work. if you can successfully make this work, please update these instructions! otherwise follow the instructions in the next section for installing on ubuntu 10.04 using passenger if mod_cgi does not work for you.

the other files that you need to modify/create are as follows:

<code>/etc/redmine/default/database.yml</code>:

<code>/usr/share/redmine/public/dispatch.cgi</code>:

<code>/usr/share/redmine/public/.htaccess</code>:

and that's it! if these instructions didn't work for you, please expand them to include whatever is needed.

this page is a guide to installing redmine on either a virtual or actual installation of the ubuntu operating system. if you follow all instructions correctly you will have installed your redmine server successfully in almost an hour.

if you are installing on a non-virtual ubuntu instance, please skip this section.

installing virtualbox:

1.download the latest version of sun virtualbox (version 3.0.10 or newer).

2.install virtualbox by following the instructions.

installing ubuntu on virtualbox:

1.download the latest version of ubuntu (version 9.10 or newer).

2.after installing virtualbox you will create a new virtual operating which will be linux type and ubuntu subtype. if you don't know anything about virtualbox and/or its usage please refer to google.

3.while installing ubuntu you should enter the following configuration:

(this suggested configuration is optional, you can enter any names you want.)

q: what is your name? a: redmine server

q: what name do you want to use to login? a: redmine

q: choose to password to keep your account safe? a: redmine

q: what is the name of this computer? a: redmine-server

choose “log in automatically.” radio button.

4.when you've finished the installation, open up your new virtualbox ubuntu os and open up a terminal (console) screen and issue these commands:

sudo apt-get update sudo apt-get upgrade

configuring virtualbox:

1.if you want to reach your virtualbox ubuntu os from a different machine, you have to configure virtualbox ubuntu os's network settings to bridged adapter. so you can reach your virtualbox ubuntu from an internal ip address easily. because it get's the

same ip block as you from dhcp easily. i mean your guest and host computer is same ip block as different network client.

2.if you had assigned a static ip to your network consult by giving your static ethernet mac address, you have to assign the unique mac address your virtualbox ubuntu os by setting-&gt;network-&gt;mac address initialization box. by this mac address, you can get

a static ip easily or you can configure your ubuntu system to not use dhcp, instead of that you can assign a static ip manually.

once you have a functioning ubuntu operating system up and running, you can continue with installing redmine.

the following packages are required to install and run redmine. please install them by running <code>apt-get</code> as root:

sudo apt-get install package-name

where <code>package-name</code> is each of:

apache2

apache2-threaded-dev

build-essential

libapache-dbi-perl

libapache2-mod-perl2

libapache2-svn

libdigest-sha1-perl

libgemplugin-ruby

libgemplugin-ruby1.8

libruby-extras

libruby1.8-extras

mongrel

mysql-server

rails

rake

ruby

rubygems

rubygems1.8

ruby1.8-dev

subversion

(could someone please clean up this list?)

1.once you’ve installed the virtualbox ubuntu os and updated it, you need to install a bunch of packages that we will prepare the server for the redmine installation. so, as root, install the following packages by issuing:

sudo apt-get install sudo apt-get install  (surely some missing package names above?)

the packages we’re installing above are mysql, phpmyadmin, rails, ruby gems, mongrel and ruby dev environment.

during the installation of the packages, when mysql is installed, it will prompt you to create a password. make sure you remember it. you will need it later to log in to phpmyadmin. to make things simple you can set all passwords to “redmine”.

2.create a new directory for redmine. i put mine in /opt/redmine. and download the latest version of redmine in to it with the wget command line downloader and extract it by issuing:

sudo mkdir /opt/redmine sudo cd /opt/redmine sudo wget http://rubyforge.org/frs/download.php/66633/redmine-0.8.6.tar.gz tar -xvf redmine-0.8.6.tar.gz

1.now it’s time to create an empty database for redmine. as you may have noticed, we installed phpmyadmin earlier. phpmyadmin will come in handy now. head over to http://localhost/phpmyadmin.

you should be presented with the phpmyadmin login screen.

type in “root” and the mysql “password” you created when installing mysql.

2.first, click on “databases” then, at the bottom of the screen, in the “create new database” text box create a new database called “redmine” and set “collation” to “utf8_general_ci”.

3.now, go back to the home screen and click on:

“privileges”

“add a new user” 

fill out the “login information” boxes. call your user “redmine”. make sure you remember password you create here. it will be used when you set up the database connection details in redmine.

in the “database for user” section, check “create database with same name and grant all privileges” and click on the “go” button.

4.log out of phpmyadmin.

1.it’s time to configure the database connection. if you installed redmine as i did above, then copy “config/database.yml.example” to “config/database.yml” and edit this file in order to configure your database settings for “production” environment. you’ll

find the “database.yml.example” issuing:

sudo cd /opt/redmine/redmine-0.8.6/config

2.so now, assuming you’re in the “/opt/redmine/redmine-0.8.6/config” directory, issue:

sudo cp database.yml.example database.yml

3.then, open the “database.yml” file, issue:

sudo gedit database.yml … and edit it as in the example for a mysql database below:

production:

adapter: mysql

socket: /var/run/mysqld/mysqld.sock

database: redmine

host: localhost

username: redmine

password: [password]

then save the “database.yml” file and exit to the command prompt.

on ubuntu the “mysql.sock” is located in /var/run/mysqld/mysqld.sock, as noted in the “config” above. 

(the standard redmine installation assumes the socket is located in “/opt/redmine/redmine-0.8.6/tmp/mysqld.sock”.)

4.create the database structure, by running the following command under the application root directory (i mean “/opt/redmine/redmine-0.8.6”):

sudo rake db:migrate rails_env="production"  it will create the necessary tables in the redmine database you created earlier and an administrator account.

5.insert the default configuration data in to the database, by issuing:

sudo rake redmine:load_default_data rails_env="production"  (this step is optional but highly recommended, as you can define your own configuration from scratch. it will load default roles, trackers, statuses, work flows and enumerations. while loading default data command prompt wants to given language selection by you.)

1.the user who runs redmine must have write permission on the following sub directories: “files”, “log”, “tmp” (create the last one if not present). you probably already have a “tmp” directory in /opt/redmine/redmine-0.8.6, but if you don’t, create one now

by issuing:

sudo mkdir /opt/redmine/redmine-0.8.6

2.if you haven’t created a redmine user, do it now by issuing:

sudo useradd redmine

3.now, assuming you run redmine with a redmine user, from your /opt/redmine/redmine-0.8.6 directory issue:

sudo chown -r redmine:redmine files log tmp sudo chmod -r 755 files log tmp

1.it should all be working now. test the installation by running the webrick web server issue:

sudo cd /opt/redmine/redmine-0.8.6 sudo ruby script/server -e production

once webrick has started, point your browser to http://localhost:3000/. or, if you are using a browser on a computer other than the

one you installed redmine on, point your browser to http://192.168.1.10:3000/ (if that’s the ip address you gave your redmine server).

you should now see the application welcome page.

log in:

1.use default administrator account to log in:

login : admin

password : admin

2.you can go to admin &amp; settings to modify application settings.

1.an easier method for configuring a static ip address is to use your local dhcp server to assign a permanent ip to the virtualbox os mac address. that way you will not have to do anything inside vbs. consult your network administrator.

2.or you should determine the configuration parameters given below, and then you can configure your system to have a static ip address:

the desired ip address

network mask and broadcast address

gateway address

your local dns server address(es)

1.an easier method for adding your ip address - host name pair configuration to your dns server . consult your network administrator.

passenger is a module for apache2 that allows apache to run ruby on rails applications. install it thus:

$ sudo gem install passenger

then go to the passenger apache2 module installation directory and run <code>passenger-install-apache2-module</code>

$ cd /var/lib/gems/1.x/gems/passenger-x.x.x/
$ sudo bin/passenger-install-apache2-module

next, configure apache:

in /etc/apache2/mods-available/passenger.load we will add next line

loadmodule passenger_module /var/lib/gems/1.x/gems/passenger-x.x.x/ext/apache2/mod_passenger.so

we have to edit the conf of the passenger apache2 module in /etc/apache2/mods-available/passenger.conf

passengerroot /var/lib/gems/1.x/gems/passenger-x.x.x passengerruby /usr/bin/ruby1.x

and now we activate the module

apache virtualhost for redmine web app

subversion server config in apache

1.before configuring email support for redmine, we should download the sendmail application for ubuntu, issue:

sudo apt-get install sendmail
sudo sendmailconfig

(answer yes to all questions which you will be asked)

2.it’s time to configure the server connection. copy “config/email.yml.example” to “config/email.yml” and edit this file in order to configure your database settings for “production” environment. you’ll find the “email.yml.example” issue:

3.so now, assuming you’re in the “/config” directory, issue:

sudo cp email.yml.example email.yml

4.then, open the “email.yml” file, issue:

sudo gedit email.yml … and edit it as in the example for sendmail configuration below:

delivery_method: :sendmail

sendmail_settings:

location: /usr/sbin/sendmail

arguments: -i -t

address: smtp.example.net

port: 25

domain: example.net

authentication: :none

user_name: [email protected]

password: redmine

then save “email.yml” file and exit to the command prompt.

5.it’s time to configure the “environmet.rb” configuration. open up the “environment.rb” and change “config.action_mailer.perform_deliveries = false” to “config.action_mailer.perform_deliveries = true” then save and close the “environment.rb”.

1.before configuring subversion support for redmine, we should download the subversion application for ubuntu, issue:

sudo apt-get install subversion

2.if your redmine can't find the “subversion” command you can help to find by issuing:

· &gt; sudo cd /opt/redmine/redmine-0.8.6/config

· &gt; sudo gedit environment.rb

· add env['path'] = "#{env['path']}:/subversion/path" line in it.

· save and close the “environment.rb”

1.to automatically start the application on booting your server you need to modify your “crontab”, issue:

export editor=gedit crontab -e

2.your “crontab” file will be presented. this is the list of programs that start at certain times or at boot. add the following to the “crontab” (all on one line):

@reboot cd /opt/redmine/redmine-0.8.6 ; rm -f log/mongrel.pid ; mongrel_rails start -e production -p 3000 -d

1.running backups is always a good idea. redmine backups should include:

data (stored in your redmine database) 

/usr/bin/mysqldump -u -p | gzip &gt; /path/to/redmine/backup/db/redmine_`date +%y_%m_%d`.gz

attachments (stored in the files directory of your redmine install)

rsync -a /path/to/redmine/files /path/to/redmine/backup/files

2.or you can use the bash shell to automate this kind of operation, issue:

sudo cd /opt/redmine/redmine-0.8.6 sudo mkdir backup sudo mkdir backup/db sudo mkdir backup/files sudo gedit backup/runredminebackup.bash

and after open “runredminebackup.bash” with gedit, write all commands below:

then save the “runredminebackup.bash” file and exit to the command prompt. after creation of runredminebackup.bash you can add this bash script to run continually between specified periods. issue:

add 0 0 * * 0 cd /opt/redmine/redmine-0.8.6/backup ; sh runredminebackup.bash commands to crontab to backup database weekly.

for this to work without any permission problems you have to change the permissions of the files to maximum, issue:

sudo chmod -r 777 backup sudo chown -r redmine:redmine backup

that's all. now we have completely installed redmine on our virtual ubuntu os and can reach it from any machine in our network easily. congratulations..!

Ümit uzun 06/11/2009.

some of the above material comes from macada's wiki, licenced under the gnu free documentation license 1.2. see redmine

in ubuntu jaunty 9.04by david 'macada', last modified 2010-02-08, accessed 2010-05-26.

sam wilson 2010-05-26, formatting changes.

allen yeh 2010-09-08, added apt-get install subversion into instructions for 10.04 otherwise once redmine is setup an error like this will result this error -&gt; the entry or revision was not found in the repository.

http://wiki.oseems.com/web/redmine/install-in-ubuntu

redmineinstallation.pdf -

redmine installation on ubuntu (108 kb) umit uzun, 2009-11-06 17:45