快速安装配置项目管理工具 Redmine
- 安装数据库
MySQL
sudo apt install -y mysql-server mysql-client
配置管理员密码: root
.
- 安装
apache2
+libapache2-mod-passenger
sudo apt install -y apache2 libapache2-mod-passenger
安装 libapache2-mod-passenger
会同时安装好 Ruby
, RubyGems
等包
- 安装
redmine
sudo apt install -y redmine redmine-mysql
配置好数据库.
- 修改
gem
配置
sudo su
gem sources -r https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
- 安装
bundler
sudo gem install bundler
- 测试运行
Redmine
sudo bundle exec rails server webrick -e production
集成 apache
+ redmine
- 修改:
/etc/apache2/mods-available/passenger.conf
为:
<IfModule mod_passenger.c>
PassengerDefaultUser www-data
PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/bin/ruby
</IfModule>
- 创建软连接
sudo ln -s /usr/share/redmine/public /var/www/html/redmine
- 增加
apache2.conf
在 apache2
配置文件: /etc/apache2/apache2.conf
的 <Directroy>
段插入下面这段:
<Directory /var/www/html/redmine>
RailsEnv production
RailsBaseURI /redmine
PassengerResolveSymlinksInDocumentRoot on
</Directory>
- 修改
Gemfile.lock
权限
sudo touch /usr/share/redmine/Gemfile.lock
sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock
- 重启生效
sudo service apache2 restart
- 额外配置
相关目录可写:
sudo chown -R www-data:www-data /usr/share/redmine/instances/default
sudo chown -R www-data:www-data /var/cache/redmine/default
sudo chown -R www-data:www-data /usr/share/redmine/public/plugin_assets
图片处理 ImageMagick
支持:
sudo apt -y install imagemagick libmagickwand-dev
sudo service apache2 restart
配置 https 协议.
添加免费的 HTTPS 证书.
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install -y python-certbot-apache
sudo certbot --apache
sudo certbot renew --dry-run
配置完成.