2015-07-10 72 views
1

我试图打开我的网页http://moneytree.space/catalogs/traders,但我得到:Safari浏览器无法连接到服务器(nginx的,麒麟,Ubuntu的,铁轨,MySQL的)

enter image description here

麒麟和Nginx的运行。我的工作目录是/ home/zhall/zoulfia

[email protected]:/home/zhall/zoulfia# rails s -e production 
     => Booting Unicorn 
     => Rails 4.2.0 application starting in production on   

     http://localhost:3000 

     => Run `rails server -h` for more startup options 

     => Ctrl-C to shutdown server 

当我输入:

在我的/ etc/nginx的/网站,avalable /默认文件我:

enter image description here

我需要改变服务器名称为localhost?我是新来的所有这些配置,任何帮助将不胜感激。谢谢。 也许我的服务器关闭,因为有一些错误。我不知道去哪里寻找他们。我的日志文件是空的:(

我检查nginx的配置:

sudo nginx -t 
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 
nginx: configuration file /etc/nginx/nginx.conf test is successful 

当我启动的WEBrick:

Zoulfias-iMac:zoulfia zoulfiahall$ rails s -e production 
=> Booting WEBrick 
=> Rails 4.2.0 application starting in production on http://localhost:3000 
=> Run `rails server -h` for more startup options 
=> Ctrl-C to shutdown server 
[2015-07-10 17:08:38] INFO WEBrick 1.3.1 
[2015-07-10 17:08:38] INFO ruby 2.2.0 (2014-12-25) [x86_64-darwin13] 
[2015-07-10 17:08:38] INFO WEBrick::HTTPServer#start: pid=18631 port=3000 

我没有问题,开始我的应用程序

在麒麟服务器启动时,我得到:

[email protected]:/home/zhall/zoulfia# rails s -p80 -e production 
=> Booting Unicorn 
=> Rails 4.2.0 application starting in production on http://localhost:80 
=> Run `rails server -h` for more startup options 
=> Ctrl-C to shutdown server 
[email protected]:/home/zhall/zoulfia# ------> this line should not be here! 

如何设置应用程序日志以查看错误?

+0

我没有看到你的'netstat'结果'nginx',如果我尝试'telnet'到80端口的服务器上,我得到'连接refused'。 – 2015-07-10 14:27:02

+0

感谢您的回复。这是什么意思?我需要做些什么来纠正它。可能导致这种情况发生的错误有哪些? – MBJH

+0

我认为你的nginx配置有问题。 [见这个问题](http://stackoverflow.com/questions/17859653/nginx-not-running-with-no-error-message)。您可能还想尝试发布[服务器故障](http://serverfault.com)。 – 2015-07-10 14:46:46

回答

0

我做了一件很愚蠢的。我检查了我的/ home/zhall/zoulfia/config文件,发现unicorn.rb文件在那里。我删除了该文件并再次运行服务器。它现在有效。有些东西告诉我,这不是结束......我会回来一些其他问题。

相关问题