HowTo Install Redmine on Ubuntu step by step
- Prerequisite: check your ubuntu version against intended Redmine version
- Introduction
- Prerequisites: Apache, mod-passenger, and MySQL
- Installing and configuring the Ubuntu Redmine package
- Configuring Apache
- Backing up Redmine
Prerequisite: check your ubuntu version against intended Redmine version
Before using or studying this guide you should check which Redmine version you are going for. Be aware that only latest stable releases will be fully compatible with current releases of plugins.
To check redmine versions versus your ubuntu version have a look at http://www.ubuntuupdates.org/pm/redmine
Generally you could also consider only installing ruby from ubuntu-repos and then heading for a release of redmine from redmine's download page: http://www.redmine.org/projects/redmine/wiki/Download (this is the more common way of installing redmine on ubuntu). In this case this guide is not suited for you and you should check for an alternate guide. Google provides lots of resources for this alternate installation procedure.
If you are sure that you want to install from ubuntu-repositories, keep on reading:
Introduction
This tutorial walks you step-by-step through installing Redmine on a clean/fresh Ubuntu 12.04 installation. This is intended to be a complete cookbook method for getting Redmine installed and running. It makes no assumptions about other things being installed or configured. Since I have had some issues when using the graphical package managers, we will be doing this from the command line prompt to keep things as clear and clean as possible.
I recommend that you install any Ubuntu updates prior to beginning this process. There are almost always some waiting to be applied after Ubuntu is first set up.
Prerequisites: Apache, mod-passenger, and MySQL
There are several support packages that we will install first. The apache installation is pretty simple if you just follow the prompts and accept the defaults.
Installing mysql takes just a little more, so the details are spelled out.
The installation process for mysql is going to prompt you for a password for the "root" access for the database server, then ask you to confirm the password in a follow-up screen. This sets the database adminstration password.
Installing and configuring the Ubuntu Redmine package
Now it is time to install redmine itself.
You want to allow dbconfig-common to configure the database when prompted so select Yes from the prompt in the panel below.
Then you want to provide the "root" password for the database, so that the installer can create the redmine database. This is the password set when you installed mysql.
Tell the redmine installer we are using mysql for this installation by highlighting "mysql" from the list of database choices:
Now you are asked to provide a password that will be used to protect the redmine database. Redmine itself will use this when it wants to access mysql.如123456
Now confirm the redmine password.
Ensure the bundler gem is installed
Configuring Apache
You need to modify two files for apache. The first is /etc/apache2/mods-available/passenger.conf which needs the text PassengerDefaultUser www-data added as seen below. Do not try to replace whole file content!
Now create a symlink to connect Redmine into the web document space:
And modify /etc/apache2/sites-available/000-default.conf (before apache 2.4 /etc/apache2/sites-available/default) to insert the following with the other <Directory> sections so that apache knows to follow the symlink into Rails:
Create and set the ownership of a Gemfile.lock file so that apache's www-data user can access it:
Now restart apache:
You should now be able to access redmine from the local host
In the upper right corner of the browser window you should see the "Sign in" link. Click that and enter "admin" at both the Login: and Password: prompts. Note: this is not the password you set during the installation process. Click the Login button.
I recommend that the next thing you do is to click on My account in the upper right corner and change that password. In the page that is displayed there should be a Change password link in the upper right of the white area of the page. Click to change the password.
Backing up Redmine
You should arrange a regular backup of the Redmine database and the files that users upload/attach. The database can be dumped to a text file with:
where <password> is the one you set when installing mysql.
The attachments are stashed in /var/lib/redmine/default/files and can be backed up with something like:
You can have these commands run automatically by creating a script called /etc/cron.daily/redmine that contains:
Again, be sure to substitute the mysql root password for <password> in the mysqldump command line. The file should be protected so that only root has read permission because you are storing the root password for your mysql installation in this file. That the first line creates a new file every time the script is run. This can eventually create a large number of backups of your database files. You should have a script that purges old ones periodically.
Additional semi-optional packages
There are some services that Redmine can use that are not absolutely necessary, but are useful. These are email and software repository/revision control systems.
Email setup
At some point you will probably want Redmine to be able to send email. For this you will need to install and configure email. This can be achieved by installing the postfix package. I do not recommend the exim4 package, as there have been some incompatibilities in the way the "sendmail" command line is handled between Redmine and exim4. Unless everyone has an email account on the redmine server you will want to set up external email as a full internet host. Once email service is installed, you will have to restart apache for Redmine to know that it has access to email services.
Now that you can send email, you have to tell Redmine about it. You need to create/edit the file /etc/redmine/default/configuration.yml and add the following lines:
Then restart apache so that Redmine reloads the configuration file:
Revision control repository setup
In order to have your software repository on the system Redmine will need the corresponding software installed.
That covers it as far as I have gotten in my use of Redmine to date.
开启邮箱发送功能
打开配置文件
sudo vi /etc/redmin/default/configure.yml
配置如下
用管理员登录后台,点击管理,->配置->邮件通知,发件人填写配置中的邮箱,其它随情况而定,
注意,在选者发送模式时,最好不要选'使用密件抄送 (bcc)',勾选了这个选项,有可能会导致发送测试邮件成功,而其它情况(如建立新问题时)会发送邮件失败的情况(我就遇到过,找了半天)
补充:2019-02-22
测试邮件通知提示"hostname was not match with the server certificate"
解决方法:
修改redmine/config/configuration.yml
82行到96行
# default configuration options for all environments
default:
# Outgoing emails configuration (see examples above)
email_delivery:
delivery_method: :smtp
smtp_settings:
address: smtp.kingmed.com.cn
port: 25
domain: kingmed.com.cn
authentication: :login
user_name: app
password: "******"
enable_starttls_auto: true
openssl_verify_mode: 'none'增加一行 openssl_verify_mode: 'none'
重启服务即可
参考:
2、Ubuntu之邮件服务器
3、Ubuntu 16.04 布置postfix、dovecot邮件服务器
4、快速安装配置邮件服务器(详解 Postfix + Dovecot)
http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_ste