我在安裝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