![](/img/trans.png)
[英]Asset precompilation with Phusion Passenger, Apache and Rails
[英]Fedora + Apache + Phusion passenger + Rails shows default apache page (always)
即使有關於此主題的大量信息,我仍然停留在服務器顯示的apache默認頁面上。 更糟糕的是,一切似乎都能正常運行。
我已經使用dnf
安裝了所有東西,甚至是ruby gems
我正在使用
4.2.6-200.fc22.x86_64
2.4.17
4.0.53
我已安裝的軟件包
# dnf install nodejs ruby rubygem-rails ruby-devel rubygem-json rubygem-debug_inspector rubygem-byebug rubygem-sqlite3 httpd mod_passenger
乘客配置文件(在@bobomoreno回答后編輯)
$ cat /etc/httpd/conf.d/passenger.conf
<IfModule mod_passenger.c>
PassengerRoot /usr/share/passenger//phusion_passenger/locations.ini
PassengerRuby /usr/bin/ruby
PassengerEnable on
<VirtualHost *:80>
ServerName 10.10.15.219
ServerAdmin los_true@gmail.com
DocumentRoot /var/www/html/los_true/public
ErrorLog /var/log/httpd/tsc-error.log
CustomLog /var/log/httpd/tsc-access.log common
RackEnv development
<Directory /var/www/html/los_true/public>
Allow from all
Options -MultiViews
Require all granted
</Directory>
</VirtualHost>
</IfModule>
防火牆工作正常
# firewall-cmd --list-all
public (default, active)
interfaces: eth0
sources:
services: dhcpv6-client http https mdns ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
SELinux允許(直到其他一切正常為止,然后將其更改為強制執行)
$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 29
Apache服務器運行無錯誤
$ systemctl status -l httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since sáb 2015-11-28 20:41:05 CLT; 24min ago
Main PID: 25649 (httpd)
Status: "Total requests: 1; Idle/Busy workers 100/0;Requests/sec: 0.00068; Bytes served/sec: 3 B/sec"
CGroup: /system.slice/httpd.service
├─25649 /usr/sbin/httpd -DFOREGROUND
├─25650 /usr/libexec/nss_pcache 1802248 off /etc/httpd/alias
├─25671 PassengerWatchdog
├─25674 PassengerHelperAgent
├─25679 PassengerLoggingAgent
├─25689 /usr/sbin/httpd -DFOREGROUND
├─25690 /usr/sbin/httpd -DFOREGROUND
├─25691 /usr/sbin/httpd -DFOREGROUND
├─25692 /usr/sbin/httpd -DFOREGROUND
├─25693 /usr/sbin/httpd -DFOREGROUND
└─25705 /usr/sbin/httpd -DFOREGROUND
nov 28 20:41:04 ip210.15.priv.inf.utfsm.cl systemd[1]: Starting The Apache HTTP Server...
nov 28 20:41:05 ip210.15.priv.inf.utfsm.cl systemd[1]: Started The Apache HTTP Server.
乘客已啟動並正在運行,未列出任何錯誤
# cat /var/log/httpd/error_log | grep 'Phusion\|Passenger'
[ 2015-11-28 21:43:34.3687 26203/7f416653f740 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.26198/generation-0/request
[ 2015-11-28 21:43:34.3807 26209/7ff9a135b840 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.26198/generation-0/logging
[ 2015-11-28 21:43:34.3817 26200/7fdd4c2bf740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2015-11-28 21:43:34.4808 26223/7fb79dc8d740 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.26198/generation-1/request
[ 2015-11-28 21:43:34.4912 26229/7f643095a840 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.26198/generation-1/logging
[ 2015-11-28 21:43:34.4916 26220/7efd30072740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Sat Nov 28 21:43:34.498645 2015] [mpm_prefork:notice] [pid 26198] AH00163: Apache/2.4.17 (Fedora) mod_auth_gssapi/1.3.0 mod_nss/2.4.16 NSS/3.19.3 Basic ECC mod_wsgi/4.4.8 Python/2.7.10 Phusion_Passenger/4.0.53 configured -- resuming normal operations
# cat /var/log/httpd/tsc-error.log
#
Rails應用程序正常工作(在本地計算機上進行了測試,並且工作正常)
$ cd /var/www/html/los_true
$ ./bin/bundle install
Using rake 10.4.2
Using i18n 0.7.0
...
Using web-console 2.2.1
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ ./bin/rake db:migrate
$
所以我真的不知道我在做什么錯。 此外,關於旅客的問題只有一件事,它說它沒有運行,但是可以正常重定向public
文件夾(如果將URL放在http://10.10.15.219/404.html
,我可以看到位於public
文件夾中的*.html
文件。例如http://10.10.15.219/404.html
)
$ passenger-status
ERROR: Phusion Passenger doesn't seem to be running.
所以,如果有人對這里的問題有任何想法,請幫助我:c,因為我真的不知道該怎么辦
看起來你失蹤了
passenger_enabled on;
在您的虛擬主機定義中
我終於在此鏈接中找到了問題:'D
原來,自動autoindex
模塊是邪惡之源。 如果您評論這行
...
LoadModule autoindex_module modules/mod_autoindex.so
...
在/etc/httpd/conf.modules.d/00-base.conf
並刪除文件autoindex.conf
# mv /etc/httpd/conf.d/autoindex.conf /etc/httpd/conf.d/autoindex.conf.bak
您將獲得鐵路視圖的工作:')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.