這篇文章主要是參考自 Redmine 官網上的 HowTo Install Redmine on Debian 8 with Apache2-Passenger
我安裝Redmine的配置為:
-------------------------------
型號: Raspberry Pi 2 Model B
SD卡: Kingston MicroSD HC Class 10, 32GB
OS: Raspbian Jessie Lite (Version May 2016, Kernel 4.4)
Redmine版本: 3.3.0
-------------------------------
安裝步驟如下:
1. 先執行以下指令更新套件
sudo apt-get update && sudo apt-get upgrade
2. 安裝需要的packages, 例如apache, mysql 等等
sudo aptitude install mysql-server mysql-client libmysqlclient-dev gcc build-essential zlib1g zlib1g-dev zlibc ruby-zip libssl-dev libyaml-dev libcurl4-openssl-dev ruby gem libapache2-mod-passenger apache2-mpm-prefork apache2-dev libapr1-dev libxslt1-dev checkinstall libxml2-dev ruby-dev vim libmagickwand-dev imagemagick
安裝需要440MB呢......
3. 設定mysql 的root 密碼:
4. 在Redmine 官網下載 Redmine 3.3.0:
http://www.redmine.org/projects/redmine/wiki/Download
我下載的是 redmine-3.3.0.tar.gz
5. 把 redmine-3.3.0.tar.gz 放到 /opt/裡面,然後執行以下指令:
cd /opt/ tar xzf redmine-3.3.0.tar.gz mv redmine-3.3.0 redmine
6. 用以下指令進入mysql, 並且輸入密碼:
mysql -u root -p
7. 在mysql裡面,輸入以下內容 (請自行修改你在mysql裡面使用的密碼):
CREATE DATABASE redmine CHARACTER SET utf8; CREATE USER 'redmine'@'localhost' IDENTIFIED BY '你的密碼'; GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost'; exit
8. 編輯 database.yml
首先執行以下指令:
cp /opt/redmine/config/database.yml.example /opt/redmine/config/database.yml
然後在database.yml輸入以下內容:
production: adapter: mysql2 database: redmine host: localhost username: redmine password: 你的密碼
9. 執行以下的指令安裝bundler和redmine:
cd /opt/redmine/ sudo gem install bundler bundle install --without development test bundle exec rake generate_secret_token RAILS_ENV=production bundle exec rake db:migrate RAILS_ENV=production bundle exec rake redmine:load_default_data
10. 執行以下指令,設定各文件權限:
cd /opt/redmine/ sudo chown -R www-data files log tmp public/plugin_assets sudo chmod -R 755 files log tmp public/plugin_assets sudo chown www-data:www-data Gemfile.lock
11.執行以下指令,連結到web server(apache)的文件夾裡面:
sudo ln -s /opt/redmine/public/ /var/www/html/redmine
12.設定apache裡面的內容:
編輯以下文件:
/etc/apache2/sites-available/000-default.conf
000-default.conf文件裡面,改為以下內容:
<virtualhost> ServerAdmin admin@example.com Servername hostname DocumentRoot /var/www/html/ PassengerDefaultUser www-data <location redmine=""> RailsEnv production RackBaseURI /redmine Options -MultiViews </location> </virtualhost>
13. 儲存變更,並執行以下指令,重開 apache:
service apache2 restart
完成後,就可以成功進入Redmine了:
網址為: http://你的IP/redmine
沒有留言:
張貼留言