如何在CentOS 7部署redmine 5.0,请给出详细的步骤
时间: 2024-03-29 16:39:39 浏览: 25
好的,以下是在 CentOS 7 上部署 Redmine 5.0 的详细步骤:
1. 安装必要的软件包
```
sudo yum update
sudo yum install epel-release
sudo yum install git httpd httpd-devel mariadb mariadb-server mariadb-devel ImageMagick-devel ImageMagick-c++-devel gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison libxml2 libxml2-devel libxslt libxslt-devel libiconv-devel
```
2. 安装 Ruby
```
sudo yum install ruby ruby-devel rubygems
sudo gem install bundler
```
3. 下载 Redmine 5.0
```
sudo mkdir /opt/redmine
sudo chown <your_username> /opt/redmine
cd /opt/redmine
sudo git clone https://github.com/redmine/redmine.git .
sudo git checkout 4.0-stable
```
4. 安装 Redmine 的依赖项
```
sudo bundle install --without development test postgresql sqlite
```
5. 配置数据库
```
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
mysql -u root -p
CREATE DATABASE redmine CHARACTER SET utf8mb4;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
FLUSH PRIVILEGES;
```
6. 配置 Redmine
```
sudo cp config/configuration.yml.example config/configuration.yml
sudo vi config/database.yml
```
在 `database.yml` 中修改以下内容:
```
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: <password>
encoding: utf8mb4
```
7. 初始化数据库
```
sudo bundle exec rake generate_secret_token
sudo RAILS_ENV=production bundle exec rake db:migrate
sudo RAILS_ENV=production REDMINE_LANG=en bundle exec rake redmine:load_default_data
```
8. 设置文件权限
```
sudo chown -R apache:apache files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
```
9. 配置 Apache
```
sudo vi /etc/httpd/conf/httpd.conf
```
在 `httpd.conf` 中添加以下内容:
```
LoadModule passenger_module /usr/local/bin/passenger/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/bin/passenger
PassengerDefaultRuby /usr/bin/ruby
</IfModule>
<VirtualHost *:80>
ServerName <your_domain_name>
DocumentRoot /opt/redmine/public
<Directory /opt/redmine/public>
AllowOverride all
Options -MultiViews
Require all granted
PassengerEnabled on
</Directory>
</VirtualHost>
```
10. 重启 Apache
```
sudo systemctl restart httpd
```
现在,您应该可以在浏览器中访问您的 Redmine 实例了。访问 `<your_domain_name>` 即可开始使用 Redmine 5.0。
希望这些步骤对您有帮助!
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)