您的位置:首页 > 运维架构 > Apache

apache2+passenger遇到的问题总结:

2016-02-02 11:07 681 查看
参考文章:
http://blog.csdn.net/abbuggy/article/details/8245941 http://5551543.blog.hexun.com/31625644_d.html http://www.cnblogs.com/baizhantang/archive/2012/12/20/2827061.html
问题之前:

安装Passenger,

[root@test-1 config]#gem install passenger

passenger-install-apache2-module

问题1:我的redhat服务器yum没有注册,卸载后安装了centos的yum。

参考文章:http://5551543.blog.hexun.com/31625644_d.html
http://www.cnblogs.com/shuaixf/archive/2011/11/30/2268496.html
下载如下包,安装yum
[root@test-1 public]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm [root@test-1 public]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm [root@test-1 public]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rp<pre name="code" class="html">[root@test-1 public]#wget http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5


问题2:我的apache passenger模块安装好后提示有些软件没有安装,使用yum安装,运行如下命令时,如果缺少一些安装包,会提示,安装即可。

[root@test-1 public]# passenger-install-apache2-module
[root@test-1 public]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/apr-devel-1.2.7-11.el5_6.5.x86_64.rpm [root@test-1 public]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/apr-util-devel-1.2.7-11.el5_5.2.x86_64.rpm [root@test-1 public]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/httpd-devel-2.2.3-82.el5.centos.x86_64.rpm [root@test-1 public]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/httpd-2.2.3-82.el5.centos.x86_64.rpm[/code] 
问题3:安装完成之后提示配置apache,修改它,添加如下内容,如果还有问题只能网上搜解决了,这个用了不少时间,主要理解下面配置的含义。。
参考文章:
http://www.cnblogs.com/baizhantang/archive/2012/12/20/2827061.html http://blog.csdn.net/abbuggy/article/details/8245941
[root@test-1 public]#vi /etc/httpd/conf/httpd.conf
LoadModule passenger_module /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.2
PassengerRuby /usr/local/ruby/bin/ruby
<VirtualHost *:80>
ServerName 127.0.0.1
DocumentRoot /var/www/html/
ErrorLog logs/redmine_error_log

RailsBaseURI /redmine
RailsEnv production
<Directory "/var/www/html/redmine">
Options Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>

解决问题中常用命令:

[root@test-1 public]# ln -s /usr/local/redmine/public/ /var/www/html/redmine #建立一个软链放在apache DocumentRoot ,针对配置文件的

<Directory "/var/www/html/redmine">


[root@test-1 public]# service httpd restart             #重启apache


                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: