Linux环境下Redmine的安装(三)
原创文章标签 Linux Remine 404 500 文章分类 运维
©著作权归作者所有:来自51CTO博客作者zyy123的原创作品,请联系作者获取转载授权,否则将追究法律责任
[root@cent5-ADCPtest redmine]# yum install httpd-devel apr-devel apr-util-devel //安装依赖的软件
[root@cent5-ADCPtest redmine]# passenger-install-apache2-module //再次执行一遍命令
--------------------------------------------
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /opt/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.15/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.15
PassengerRuby /opt/ruby/bin/ruby
After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!
Press ENTER to continue.
--------------------------------------------
Deploying a Ruby on Rails application: an example
Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:
<VirtualHost *:80>
ServerName www.yourhost.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /somewhere/public
<Directory /somewhere/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:
/opt/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.15/doc/Users guide Apache.html
Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
https://www.phusionpassenger.com
[root@cent5-ADCPtest redmine]# chmod -R 777 public/
[root@cent5-ADCPtest conf]# vim httpd.conf
LoadModule passenger_module /opt/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.15/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.15
PassengerRuby /opt/ruby/bin/ruby
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Include conf/extra/httpd-vhosts.conf
修改虚拟机配置:
<VirtualHost *:80>
DocumentRoot "/opt/redmine/public/"
<Directory /opt/redmine/public/>
AllowOverride all
Allow from all
</Directory>
ErrorLog "logs/redmine-error_log"
CustomLog "logs/redmine-access_log" common
</VirtualHost>
[root@cent5-ADCPtest conf]# ../bin/apachectl restart
[root@cent5-ADCPtest conf]# vim /etc/selinux/config
SELINUX=disabled
[root@cent5-ADCPtest conf]# chcon -u system_u -R -t httpd_log_t /opt/redmine/log
[root@cent5-ADCPtest conf]# chcon -u system_u -R -t httpd_tmpfs_t /opt/redmine/tmp
[root@cent5-ADCPtest conf]# chcon -u system_u -R -t httpd_sys_script_rw_t /opt/redmine/files
[root@cent5-ADCPtest conf]# chcon -u system_u -R -t httpd_sys_script_rw_t /opt/redmine/public
[root@cent5-ADCPtest config]# cp -a configuration.yml.example configuration.yml
[root@cent5-ADCPtest config]# vim configuration.yml
scm_subversion_command: svn //实际执行的是/opt/redmine/extra/svn/reposman.rb,可以避免报404错误
三、常见故障的解决
1. 错误:
Internal error
An error occurred on the page you were trying to access.
If you continue to experience problems please contact your
Redmine administrator for assistance.
If you are the Redmine administrator, check your log files
for details about the error.
Back
原因:
Internet 500错误
ActionView::Template::Error (Permission denied -
/opt/redmine/tmp/cache/408): 权限拒绝
解决方法:chmod 777
-R /opt/redmine/tmp/
2.错误:
404 版本库中不存在该条目和(或)其修订版本。
解决方法:
[root@cent5-ADCPtest config]# vim configuration.yml
scm_subversion_command: svn //实际执行的是/opt/redmine/extra/svn/reposman.rb,可以避免报404错误
四、通过计划任务读取SVN上的更新
rake -f /opt/redmine/Rakefile RAILS_ENV=production
redmine:fetch_changesets
ruby /opt/redmine/script/rails runner
"Repository.fetch_changesets" -e production
将命令写成脚本:redcheck.sh
#!/bin/bash
cd /opt/redmine/
ruby /opt/redmine/script/rails runner "Repository.fetch_changesets" -e production
[root@cent5-ADCPtest
config]# crontab -e
*/5 * * * * /bin/bash -l -c /opt/redmine/redcheck.sh >/dev/null 2&>1
下一篇:Linux排错记录(二)

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Oracle Linux下安装Redmine 2.3.3
Oracle Linux下安装Redmine 2.3.3服务器提要
Ruby Rails Redmine 安装Redmine -
Windows下安装Redmine
如何在windows环境下安装Redmine
职场 Windows Ruby 休闲 Redmine