访问的我部署一个RoR应用到我的服务器,有一个额外的Apache2虚拟主机文件:的Ruby on Rails应用程序只能通过本地主机
<VirtualHost *:80>
# ServerName ubuntu
DocumentRoot /var/www/myapp/current/public
PassengerEnabled off
ProxyPass/http://127.0.0.1:9051
ProxyPassReverse/http://127.0.0.1:9051
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect all requests to the maintenance page if present
RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
</IfModule>
</VirtualHost>
,我使用客运启动:
passenger start -a 127.0.0.1 -p 9051 -e production -d
这是一个Ubuntu的服务器:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
和端口监听:
[email protected]:~$ sudo lsof -i :9051
[sudo] password for plee:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 1016 plee 4u IPv4 168135 0t0 TCP localhost:9051 (LISTEN)
nginx 1017 plee 4u IPv4 168135 0t0 TCP localhost:9051 (LISTEN)
nginx 1017 plee 5u IPv4 225556 0t0 TCP localhost:9051->localhost:44586 (ESTABLISHED)
ruby 1018 plee 5u IPv4 225555 0t0 TCP localhost:44586->localhost:9051 (ESTABLISHED)
的问题是,我的应用程序只能通过http://localhost:9051
如果我尝试使用服务器的IP地址从另一台机器连接访问:http://10.50.10.75:9051
谷歌浏览器给我:
Google Chrome could not connect to 10.50.10.75:9051
请帮我一把!
谢谢。
您的应用程序是否可以从本地PC的10.50.10.75:9051访问? 访问它从10.50.10.75而不是10.50.10.75:9051 becoz代理应用程序的apache服务器在端口80上运行 – PriteshJ 2012-07-11 05:35:46
不。它甚至不能从apache服务器输入http://10.50.10.75:9051。 – 2012-07-11 05:57:56
你能访问http://10.50.10.75吗? – PriteshJ 2012-07-11 05:59:23