centos7 Redmine
时间: 2023-09-02 21:13:41 浏览: 143
Redmine安装指南(CentOS 7)
3星 · 编辑精心推荐
如果您想在 CentOS 7 上安装 Redmine,可以按照以下步骤进行操作:
1. 安装必要的软件包:在终端中执行以下命令:
```
sudo yum install -y curl policycoreutils-python openssh-server cronie
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
```
2. 安装数据库:您可以使用 MySQL 或 PostgreSQL,这里以 MySQL 为例。在终端中执行以下命令:
```
sudo yum install -y mariadb-server mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
```
3. 创建 Redmine 数据库和用户:在终端中执行以下命令:
```
sudo mysql -u root -p
CREATE DATABASE redmine CHARACTER SET utf8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
FLUSH PRIVILEGES;
exit
```
4. 安装 Ruby 和 Redmine:在终端中执行以下命令:
```
sudo yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison sqlite-devel
sudo yum install -y epel-release
sudo yum install -y ImageMagick-devel
sudo yum install -y ruby ruby-devel rubygems
sudo gem install bundler
sudo curl -L https://www.redmine.org/releases/redmine-4.1.1.tar.gz -o /opt/redmine.tar.gz
sudo tar xzf /opt/redmine.tar.gz -C /opt
sudo mv /opt/redmine-4.1.1 /opt/redmine
sudo chown -R root:root /opt/redmine
```
5. 配置 Redmine:在终端中执行以下命令:
```
cd /opt/redmine
sudo cp config/configuration.yml.example config/configuration.yml
sudo cp config/database.yml.example config/database.yml
sudo bundle install --without development test
sudo bundle exec rake generate_secret_token
sudo RAILS_ENV=production bundle exec rake db:migrate
sudo RAILS_ENV=production bundle exec rake redmine:load_default_data
sudo chown -R apache:apache files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
```
6. 配置 Apache:在终端中执行以下命令:
```
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
sudo nano /etc/httpd/conf.d/redmine.conf
```
将以下内容复制到文件中:
```
<VirtualHost *:80>
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /opt/redmine/public
ErrorLog /var/log/httpd/redmine_error_log
CustomLog /var/log/httpd/redmine_access_log combined
<Directory "/opt/redmine/public">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
```
将“yourdomain.com”替换为您的域名,并保存文件。然后重启 Apache:
```
sudo systemctl restart httpd
```
现在您应该可以在浏览器中访问 Redmine 并使用管理员凭据登录。
阅读全文