[HOWTO] Redmine on FreeBSD

參考 http://www.redmine.org/wiki/redmine/RedmineInstall

1. 先從 ports 裡頭安裝 redmine

# cd /usr/ports/www/redmine
# make install clean

因為我要使用 apache2 以及 postgresql 當 database ,所以要 enable passenger, postgresql 支援,
另外也可以啟用 gantt chart 及 mysql database 支援,這個就看個人需求。

2. 安裝好之後,進行設定的步驟

2.1. 設定 database (postgresql)

登入 postgresql 帳號

$ sudo su postgres
$ psql
psql=# CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'my_password' NOINHERIT VALID UNTIL 'infinity';
psql=# CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;


2.2. 安裝 passenger 的 apache2 模組(passenger-install-apache2-module)

# /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/bin/passenger-install-apache2-module
接下來照指示做 (如下,略)

This installer will guide you through the entire installation process. It
shouldn’t take more than 3 minutes in total.

Here’s what you can expect from the installation process:

1. The Apache 2 module will be installed for you.
2. You’ll learn how to configure Apache.
3. You’ll learn how to deploy a Ruby on Rails application.

Don’t worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.

之後會出現編譯的畫面,最後出現

The Apache 2 module was successfully installed.

Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11
PassengerRuby /usr/local/bin/ruby18

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!

Press ENTER to continue.

——————————————–
Deploying a Ruby on Rails application: an example

Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:
ServerName http://www.yourhost.com
DocumentRoot /somewhere/public # <– be sure to point to ‘public’!

AllowOverride all # <– relax Apache security settings
Options -MultiViews # <– MultiViews must be turned off

And that’s it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:

/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/doc/Users guide Apache.html

Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) 🙂
http://www.modrails.com/
Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.

2.3. 安裝 fastcgi for apache2 模組

也是一樣,從 ports 安裝。

2.4. 設定 apache2 的模組

如下設定檔,例子是使用 name based virtual host,另外也強制啟用 ssl ,可按照需求修改。

NameVirtualHost my.address:80
<VirtualHost my.address:80>

LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11
PassengerRuby /usr/local/bin/ruby18
LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so

DocumentRoot "/usr/local/www/redmine/public"
FastCgiServer /usr/local/www/redmine/public/dispatch.fcgi -idle-timeout 120 -initial-env RAILS_ENV=production -initial-env PATH=/usr/local/bin -processes 2
<Directory /usr/local/www/redmine/public>

AddHandler fastcgi-script fcgi
Order allow,deny
Allow from all
Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi
AllowOverride all
Options -MultiViews
SSLRequireSSL

</Directory>

# SSL settings
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "/usr/local/etc/apache22/ssl.crt/server.crt"
SSLCertificateKeyFile "/usr/local/etc/apache22/ssl.key/server.key"

</VirtualHost>

2.5. 設定 redmine

依照 http://www.redmine.org/wiki/redmine/RedmineInstall 設定 database, mail 等即可

廣告

對「[HOWTO] Redmine on FreeBSD」的一則回應

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 /  變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 /  變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 /  變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 /  變更 )

w

連結到 %s