Wewill install Redmine Project Management System on virtual operationsystem (Ubuntu) in top down approach. If you follow all instructionscorrectly you will be installed your Redmine server successfully almostan hour.
Installing VirtualBox:
1.Download last version of Sun VirtualBox(version 3.0.10 or newer) tool in your system.
2.Install to your system by following the instructions.
Installing Ubuntu on VirtualBox:
1.Download last version of Ubuntu(version 9.10 or newer) OS in your system.
2.Afterinstalled VirtualBox on your system you will create a new virtualoperating which will be Linux type and Ubuntu subtype. If you don'tknow anything about VirtualBox and/or its usage please refer to thegoogle.
3.While installing Ubuntu you should type the related configurations as follows:
(These all configurations are optional, you can give any name what you what.)
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.Whenyou finished up installation all of them open up your new VirtualBoxUbuntu OS and open up terminal(console) screen and issuing thesecommands:
sudo apt-get updatesudo apt-get upgrade
Configuring VirtualBox:
1.Ifyou want to reach your VirtualBox Ubuntu OS from different machine, youhave to configure VirtualBox Ubuntu OS's network setting to BridgedAdapter. So you can reach your VirtualBox Ubuntu from internal IPaddress easily. Because it get's same IP block as you from DHCP easily.I mean your guest and host computer is same IP block as differentnetwork client.
2.If you had assigned a static IP to yourNetwork Consult by giving your static ethernet MAC address, you have toassign unique MAC address your VirtualBox Ubuntu OS bySetting->Network->MAC address initialization box. By this MACaddress, you can get static ip easily or you can configure your Ubuntusystem to not use DHCP, instead of that you can assign static IPmanually.
Requirements for Installing Redmine:
Ruby on Rails 2.0.2
MySQL 4 or higher
Optional:
SVN binaries (>= 1.3), for repository browsing (must be available in your PATH)
Package Installation and Setup:
1.Onceyou’ve installed the VirtualBox Ubuntu OS and updated it, you need toinstall a bunch of packages that we will prepare the server for theRedmine installation. So, as root, install the following packages byissuing:
sudo apt-get install build-essentialsudo apt-get install ssh openssh-server mysql-server phpmyadmin rails rubygems mongrel ruby1.8-dev
The packages we’re installing above are MySQL, phpMyAdmin, Rails, Ruby Gems, Mongrel and Ruby Dev environment.
Duringthe installation of the packages, when MySQL is installed, it willprompt you to create a password. Make sure you remember it. You willneed it later to log in to the phpMyAdmin. To make simplicity you canset all passwords to “redmine”.
2.Create a new directory forRedmine. I put mine in /opt/redmine. And download last version ofRedmine in it with wget command line downloader and extract it byissuing:
sudo mkdir /opt/redminesudo cd /opt/redminesudo wget http://rubyforge.org/frs/download.php/66633/redmine-0.8.6.tar.gztar -xvf redmine-0.8.6.tar.gz
Database Setup:
1.Nowit’s time to create an empty database for Redmine. As you may havenoticed, we installed phpMyAdmin earlier. phpMyAdmin will come in handynow. 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 “Createnew 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”
Fillout the “Login Information” boxes. Call your user “redmine”. Make sureyou remember password you create here. It will be used when you set upthe database connection details in Redmine.
In the “Database foruser” section, check “Create database with same name and grant allprivileges” and click on the “Go” button.
4.Log out of phpMyAdmin.
Redmine Database Connection Configuration:
1.It’stime to configure the database connection. If you installed Redmine asI did above, then copy “config/database.yml.example” to“config/database.yml” and edit this file in order to configure yourdatabase 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 “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.Createthe database structure, by running the following command under theapplication 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 default configuration data in database, by issuing:
sudo rake redmine:load_default_data RAILS_ENV="production"
(Thisstep is optional but highly recommended, as you can define your ownconfiguration from scratch. It will load default roles, trackers,statuses, work flows and enumerations. While loading default datacommand prompt wants to given language selection by you.)
Setting up Permissions:
1.Theuser who runs Redmine must have write permission on the following subdirectories: “files”, “log”, “tmp” (create the last one if notpresent). 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 tmpsudo chmod -R 755 files log tmp
Testing the Installation:
1.It should all be working now. Test the installation by running the WEBrick web server issue:
sudo cd /opt/redmine/redmine-0.8.6sudo ruby script/server -e production
Once WEBrick has started, point your browser to http://localhost:3000/. Or, if you are using a browser on another computer than what 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 & Settings to modify application settings.
Setting Up Static IP:
1.Amore easy method for configuring a static IP address is to use yourlocal DHCP server to assign a permanent IP to the VirtualBox OS macaddress. That way you will not have to do anything inside VBS. Consultyour network administrator.
2.Or you should learn configuration parameters as given below, and can configure your system to get static IP address:
The desired IP address
Network mask and broadcast address
Gateway address
Your local DNS server address(es)
Assigning Host Name and Domain for VirtualBox OS:
1.Amore easy method for adding your IP address - Host name pairconfigurations to your DNS server . Consult your network administrator.
Sendmail Server Configuration:
1.Before configure the email support of Redmine, we should download sendmail application for Ubuntu, issue:
sudo apt-get install sendmailsudo sendmailconfig (Answer Yes to all questions which will be asked you)
2.It’s time to configure the server connection. Copy“config/email.yml.example” to “config/email.yml” and edit this file inorder to configure your database settings for “production” environment.You’ll find the “email.yml.example” issue:
sudo cd /opt/redmine/redmine-0.8.6/config
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:
production:
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: redmine@example.net
password: redmine
Then save “email.yml” file and exit to the command prompt.
5.It’stime 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 saveand close the “environment.rb”.
Subversion Installation and Configuration:
1.Before configure the subversion support of Redmine, we should download 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:
· > sudo cd /opt/redmine/redmine-0.8.6/config
· > sudo gedit environment.rb
· Add ENV['PATH'] = "#{ENV['PATH']}:/subversion/path" line in it.
· Save and close the “environment.rb”
Start Application Boot Time:
1.To automatically start the application on booting your server you need to modify your “crontab”, issue:
export EDITOR=geditcrontab -e
2.Your “crontab” file will be presented. This is thelist of programs that start at certain times or at boot. Add thefollowing 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
Backup:
1.Running backups is always a good idea. Redmine backups should include:
data (stored in your redmine database)
/usr/bin/mysqldump -u -p | gzip > /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 bash shell to automate kind of this operation issue:
sudo cd /opt/redmine/redmine-0.8.6sudo mkdir backupsudo mkdir backup/dbsudo mkdir backup/filessudo gedit backup/runRedmineBackup.bash
And after opened gedit with “runRedmineBackup.bash” write all commands below:
#!/bin/bash
data=`date I`$data.sql.gz
mysqldump --user=root --password="redmine" --all-databases | gzip > db/backup
cd db
ftp i -n << EOF$data.sql.gz
open ftpserver.example.net
user username password
bin
mput backup
bye
EOF
Thensave “runRedmineBackup.bash” file and exit to the command prompt. Aftercreation of runRedmineBackup.bash you can add this bash to runcontinually between specified periods. Issue:
export EDITOR=geditcrontab -e
Add 0 0 * * 0 cd /opt/redmine/redmine-0.8.6/backup ; sh runRedmineBackup.bash commands to crontab to backup database weekly.
To work this bush without any permission problem you have to change all of them modes to maxium permission issue:
sudo chmod -R 777 backupsudo chown -R redmine:redmine backup
That's all. Now we completely installed Redmine ourvirtual Ubuntu OS and can reach from any machine at our network easily.Congratulations..!
Ümit Uzun
06/11/2009
聯(lián)系客服