CentOS 7安装Redmine,centosredmine
- 环境
- 连接服务器
- 启动MariaDB
- 安装Ruby
- 安装Redmine
- 使用puma运行redmine
- 测试
环境
连接服务器
启动MariaDB
安装Ruby
安装Redmine
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "redmine"
encoding: utf8
安装bundle
cd /var/redmine
gem install bundler配置bundler源
bundle config mirror.https://rubygems.org https://gems.ruby-china.org安装redmine依赖
bundle install --without development test rmagick初始化数据库
# 生成秘钥
bundle exec rake generate_secret_token
# 初始化数据库
RAILS_ENV=production bundle exec rake db:migrate用以下命令配置为中文,输入zh
RAILS_ENV=production bundle exec rake redmine:load_default_data设置权限
# 创建目录
mkdir -p tmp tmp/pdf public/plugin_assets
# 设置权限
sudo chmod -R 755 files log tmp public/plugin_assets测试运行redmine
bundle exec rails server webrick -e production
# e.g,我的主机是192.168.31.133,用以下命令绑定80端口
bundle exec rails server webrick -e production -p 80 -b 192.168.31.133使用puma运行redmine
gem "puma"
重新运行安装依赖
bundle install --without development test rmagick配置puma.rb
vi config/puma.rb
#!/usr/bin/env puma
# The directory to operate out of.
#
# The default is the current directory.
#
directory '/var/redmine'
# Set the environment in which the rack's app will run. The value must be a string.
#
# The default is "development".
#
environment 'production'
# Daemonize the server into the background. Highly suggest that
# this be combined with "pidfile" and "stdout_redirect".
#
# The default is "false".
#
# daemonize
daemonize true
# Store the pid of the server in the file at "path".
#
pidfile '/var/redmine/tmp/pids/puma.pid'
# Use "path" as the file to store the server info state. This is
# used by "pumactl" to query and control the server.
#
state_path '/var/redmine/tmp/pids/puma.state'
# Redirect STDOUT and STDERR to files specified. The 3rd parameter
# ("append") specifies whether the output is appended, the default is
# "false".
#
stdout_redirect '/var/redmine/log/stdout.log', '/var/redmine/log/stderr.log'
# stdout_redirect '/u/apps/lolcat/log/stdout', '/u/apps/lolcat/log/stderr', true
# Configure "min" to be the minimum number of threads to use to answer
# requests and "max" the maximum.
#
# The default is "0, 16".
#
threads 2, 32
# Bind the server to "url". "tcp://", "unix://" and "ssl://" are the only
# accepted protocols.
#
# The default is "tcp://0.0.0.0:9292".
#
# bind 'tcp://0.0.0.0:9292'
# bind 'unix:///var/run/puma.sock'
# bind 'unix:///var/run/puma.sock?umask=0111'
# bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'
# 绑定80端口
bind 'tcp://0.0.0.0:80'
# How many worker processes to run. Typically this is set to
# to the number of available cores.
#
# The default is "0".
#
workers 3
# Preload the application before starting the workers; this conflicts with
# phased restart feature. (off by default)
preload_app!
# Verifies that all workers have checked in to the master process within
# the given timeout. If not the worker process will be restarted. This is
# not a request timeout, it is to protect against a hung or dead process.
# Setting this value will not protect against slow requests.
# Default value is 60 seconds.
#
worker_timeout 60运行
cd /var/redmine
# 运行
bundle exec puma -C config/puma.rb
# 停止
bundle exec pumactl --state tmp/pids/puma.state stop
# 重启
bundle exec pumactl --state tmp/pids/puma.state restart测试
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。