您好,登錄后才能下訂單哦!
環境介紹:
CentOS Linux release 7.6.1810 (Core)
MySQL5.7
Redmine 3.3
ruby-2.3.3
Rails 4.2.6
參考文檔:http://www.redmine.org/projects/redmine/wiki/RedmineInstall
1. 環境準備
官方的yum源下載軟件速度慢,把yum源替換成阿里的yum源,并安裝epel源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
安裝rvm及ruby
curl -L https://get.rvm.io | bash -s stable
此時會報錯,按照返回的提示執行相應的命令
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
(替換成你提示的執行命令)
設置Ruby系統環境
source /etc/profile.d/rvm.sh
rvm reload??
rvm install 2.3.3
切換阿里的源
gem source -r https://rubygems.org/
gem source -a http://mirrors.aliyun.com/rubygems/
安裝
gem install rake -v 12.0.0
gem install rails -v 4.2.6
安裝mysql數據庫(5.7)
Wget https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm
安裝mysql源
yum -y install mysql80-community-release-el7-2.noarch.rpm
(注意默認安裝的是MySQL8.0,所以安裝好yum源后,要修改yum源的配置,把mysql8.0禁掉,開啟mysql5.7的源后再進行安裝)。
yum repolist enabled | grep mysql.*
yum install mysql-community-server
systemctl start? mysqld.service
運行一下命令查看一下運行狀態
systemctl status mysqld.service
查看一下初始密碼
grep "password" /var/log/mysqld.log
登錄
mysql -uroot -p
修改密碼
mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY '****************';
mysql>FLUSH PRIVILEGES;
設置自動啟動
systemctl enable mysqld
systemctl daemon-reload
2. 數據庫操作
CREATE DATABASE redmine CHARACTER SET utf8mb4;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
3. 更改配置文件
解壓軟件包redmine-3.3.0.tar.gz
tar xf? redmine-3.3.0.tar.gz -C /opt
cd /opt/redmine-3.3.0
cp? database.yml.example? database.yml
修改database.yml如下內容(這塊要仔細,不要亂改數據庫名,否則會出問題,最好一致)
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "redmine"
Redmine使用Bundler管理gem依賴項,需要先安裝Bundler
gem install bundler
Then you can install all the gems required by Redmine using the following command:
bundle install --without development test
(執行這個命令后報錯,解決辦法yum -y install ImageMagick-devel,然后再執行一遍undle install --without development test)
Session store secret generation:
bundle exec rake generate_secret_token
在應用程序根目錄下(/opt/redmine-3.3.0)運行以下命令,創建數據庫結構:
RAILS_ENV=production bundle exec rake db:migrate
設置數據庫默認數據集,通過運行以下命令,在數據庫中插入默認配置數據:
RAILS_ENV=production bundle exec rake redmine:load_default_data
輸入zh
至此,redmine安裝完成。
3.啟動redmine
cd /opt/redmine-3.3.0/bin
echo –e? ‘#!/bin/bash\nbundle exec rails server webrick -e production -p 3000 -b 0.0.0.0 -d’? >> start.sh
chmod +x start.sh
./start.sh
4.訪問redmine
http://your_ip:3000
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。