在OpenEuler上搭建一个支持网页和手持访问、且支持用户功能自定义的项目管理平台,可以选择多种开源工具。以下是基于 Redmine 的搭建方案,Redmine 是一个灵活的项目管理工具,支持网页和移动端访问,并且可以通过插件扩展功能。
1. 环境准备
确保你的OpenEuler系统已经安装并配置好以下环境:
- Ruby:Redmine 是基于 Ruby 开发的。
- MySQL/PostgreSQL:用于存储数据。
- Apache/Nginx:作为Web服务器。
- Passenger:用于部署Ruby应用。
1.1 安装依赖
sudo dnf install -y ruby ruby-devel mysql-devel postgresql-devel curl gcc make
1.2 安装数据库
选择 MySQL 或 PostgreSQL 作为数据库:
# 安装 MySQL
sudo dnf install -y mysql-server mysql-devel
sudo systemctl start mysqld
sudo systemctl enable mysqld# 或者安装 PostgreSQL
sudo dnf install -y postgresql-server postgresql-devel
sudo postgresql-setup --initdb
sudo systemctl start postgresql
sudo systemctl enable postgresql
1.3 安装 Web 服务器
# 安装 Apache
sudo dnf install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd# 或者安装 Nginx
sudo dnf install -y nginx
sudo systemctl start nginx
sudo systemctl enable nginx
1.4 安装 Passenger
Passenger 是一个用于部署 Ruby 应用的服务器。
sudo dnf install -y passenger passenger-devel
2. 安装和配置 Redmine
2.1 下载 Redmine
wget https://www.redmine.org/releases/redmine-5.0.0.tar.gz
tar -xvzf redmine-5.0.0.tar.gz
sudo mv redmine-5.0.0 /var/www/redmine
2.2 配置数据库
在 MySQL 或 PostgreSQL 中创建数据库和用户:
# MySQL
mysql -u root -p
CREATE DATABASE redmine CHARACTER SET utf8mb4;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
FLUSH PRIVILEGES;
EXIT;# PostgreSQL
sudo -u postgres psql
CREATE DATABASE redmine;
CREATE USER redmine WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE redmine TO redmine;
\q
2.3 配置 Redmine
编辑 /var/www/redmine/config/database.yml
文件,配置数据库连接:
production:adapter: mysql2 # 或者 postgresqldatabase: redminehost: localhostusername: redminepassword: "your_password"encoding: utf8
2.4 安装依赖
cd /var/www/redmine
sudo gem install bundler
bundle install --without development test
2.5 初始化数据库
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake redmine:load_default_data RAILS_ENV=production
2.6 设置权限
sudo chown -R apache:apache /var/www/redmine
sudo chmod -R 755 /var/www/redmine
3. 配置 Web 服务器
3.1 配置 Apache
编辑 /etc/httpd/conf.d/redmine.conf
文件:
<VirtualHost *:80>ServerName your_domain.comDocumentRoot /var/www/redmine/public<Directory /var/www/redmine/public>AllowOverride AllOptions -MultiViewsRequire all granted</Directory>ErrorLog /var/log/httpd/redmine_error.logCustomLog /var/log/httpd/redmine_access.log combined
</VirtualHost>
重启 Apache:
sudo systemctl restart httpd
3.2 配置 Nginx
编辑 /etc/nginx/conf.d/redmine.conf
文件:
server {listen 80;server_name your_domain.com;root /var/www/redmine/public;passenger_enabled on;error_log /var/log/nginx/redmine_error.log;access_log /var/log/nginx/redmine_access.log;
}
重启 Nginx:
sudo systemctl restart nginx
4. 访问 Redmine
在浏览器中访问 http://your_domain.com
,你应该能够看到 Redmine 的登录页面。默认管理员账号为 admin
,密码为 admin
。
5. 支持手持设备访问
Redmine 默认支持响应式设计,可以在移动设备上访问。如果需要更好的移动端体验,可以安装移动端插件或使用第三方移动客户端。
6. 用户功能自定义
Redmine 支持通过插件扩展功能,你可以通过以下步骤安装插件:
- 下载插件并放置在
/var/www/redmine/plugins
目录。 - 运行以下命令安装插件:
bundle install --without development test bundle exec rake redmine:plugins:migrate RAILS_ENV=production
- 重启 Web 服务器。
7. 其他注意事项
- 安全性:确保配置好防火墙和 SSL 证书。
- 备份:定期备份数据库和 Redmine 文件。
- 性能优化:根据项目规模调整服务器配置和数据库优化。
通过以上步骤,你可以在 OpenEuler 上成功搭建一个支持网页和手持访问、且支持用户功能自定义的项目管理平台。