我在安装Redmine时遇到了问题。它似乎在webrick下运行得很好,像这样:Apache2 + Passenger + Redmine的问题
[email protected]:~$ /usr/bin/ruby1.8 script/rails server webrick -e production
请注意,这是当我以用户'redmine'登录时。
我安装了客运(v3.0.17)对我现有的Apache2安装和使用这样的/etc/apache2/mods-enabled/passenger.conf:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerDefaultUser www-data
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17
PassengerRuby /usr/bin/ruby1.8
我的虚拟主机的conf也很简单:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName redmine.machine.com
RailsEnv production
DocumentRoot /home/redmine/redmine-2.1/public
<Directory /home/redmine/redmine-2.1/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ErrorLog /var/log/apache2/redmine.error.log
CustomLog /var/log/apache2/redmine.access.log combined
</VirtualHost>
当我运行它,我得到一个错误“没有这样的文件来加载 - 打捆”。但是,请注意:
[email protected]:~$ gem list
*** LOCAL GEMS ***
actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
activerecord-mysql2-adapter (0.0.3)
activeresource (3.2.8)
activesupport (3.2.8)
arel (3.0.2)
builder (3.0.0)
bundler (1.2.1)
coderay (1.0.8)
daemon_controller (1.0.0)
erubis (2.7.0)
fastercsv (1.5.5)
fastthread (1.0.7)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.0.3)
json (1.7.5)
mail (2.4.4)
mime-types (1.19)
multi_json (1.3.6)
mysql (2.8.1)
mysql2 (0.3.11)
net-ldap (0.3.1)
passenger (3.0.17)
pg (0.14.1)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-openid (1.3.1)
rack-ssl (1.3.2)
rack-test (0.6.2)
rails (3.2.8)
railties (3.2.8)
rake (0.9.2.2)
rdoc (3.12)
rmagick (2.13.1)
ruby-openid (2.1.8)
rvm (1.11.3.5)
sprockets (2.1.3)
sqlite3 (1.3.6)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.11)
tzinfo (0.3.33)
在/home/redmine/redmine-2.1
所有文件将通过redmine:redmine
拥有。所有目录均为0755
,所有文件为0644
。
现在,当我告诉进程我已经注意到有趣的事情:
[email protected]:~$ ps -ef | grep "Passenger"
root 21764 21759 0 10:49 ? 00:00:00 PassengerWatchdog
root 21773 21764 0 10:49 ? 00:00:00 PassengerHelperAgent
root 21775 21773 0 10:49 ? 00:00:00 Passenger spawn server
nobody 21778 21764 0 10:49 ? 00:00:00 PassengerLoggingAgent
我肯定在的Ruby/Rails /乘客/管理平台的专家,但我怀疑的事实,乘客正在运行的nobody
而不是redmine
可能是问题所在。根据这里的文档:http://www.modrails.com/documentation/Users%20guide%20Apache.html#user_switching,Passenger应该将用户切换到拥有/config/environment.ru的用户,只要该用户可以读取/写入日志并且不是root
,那么正确?从上面可以看出,该文件(实际上是整个应用程序)归redmine
所有,其中包括所有者的rwx
日志和redmine
≠root
因此,我相信我已通过了Passenger to切换为redmine
运行。
三个直接的问题:
- 这是我无法下运行客运管理平台的原因是什么? ?而**
- 为什么乘客仍
nobody
** 运行在我试图解决这个问题,我尝试添加一行:
PassengerDefaultUser www数据
到我/etc/apache2/mods-enabled/passenger.conf(如上所示),但似乎不起作用。一切的结果都是相同的,没有这条线。我不希望它能解决这个问题,但我确实希望它显示为Passenger在列出流程时运行的用户。它没。
其他可能相关的信息:
[email protected]:~$ uname -a
Linux machine.****.com 2.6.18-028stab092.1 #1 SMP Wed Jul 20 19:47:12 MSD 2011 x86_64 GNU/Linux
Ubuntu 10.04.4 LTS
[email protected]:~$ /usr/bin/ruby1.8 --version
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
感谢您的支持! – mkoistinen