简体   繁体   English

乘客/ sinatra / apache我在做什么错...?

[英]What am i doing wrong with passenger/sinatra/apache…?

I've never deployed an app before and now i cant get it to show up on my domain.com 我以前从未部署过应用程序,现在我无法将其显示在我的domain.com上

my server is liquidweb, and it has apache2 我的服务器是Liquidweb,并且有apache2

I did gem install passenger 我做了gem install passenger

I ran passenger-install-apache2-module and everything installed correctly. 我运行了passenger-install-apache2-module ,一切都安装正确。

I logged in as root and added the following to httpd.conf: 我以root用户身份登录,并将以下内容添加到httpd.conf中:

LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.11
PassengerRuby /usr/local/bin/ruby

I also added this, but this (ill paste it below) is where I'm confused. 我也添加了这个,但是这个(我在下面粘贴)是我很困惑的地方。 on the part below, is the path for the virtual host supposed to be relative to ROOT or the actual domain root. 在下面的部分中,虚拟主机的路径应该相对于ROOT或实际的域根目录。 for example the absolute root the path to my app public directory is /home/why/app/public ... but from the account root its just /app/public im not sure which one to put. 例如,我的应用程序公共目录的绝对根目录是/home/why/app/public ...,但是从帐户根目录开始,它只是/app/public我不确定要放置哪个。 Furthermore, does it have to go in public_html? 此外,它是否必须放在public_html中? right now I put the app folder in just the root of the domain, not in public_html 现在,我将应用程序文件夹仅放在域的根目录中,而不是放在public_html中

<VirtualHost *:80>
    ServerName www.domain.org
    DocumentRoot /home/why/app/public
    <Directory /home/why/app/public>
        Allow from all
        Options -MultiViews
    </Directory>
</VirtualHost>

When i visit domain.org, it just shows the default page... 当我访问domain.org时,它仅显示默认页面...

Index of /
Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Phusion_Passenger/3.0.11 Server at www.domain.org Port 80

Do i need to do anything else?? 我还需要做其他事情吗? everyone says this is really easy, it simply wont load. 所有人都说这真的很容易,根本不会加载。 Also, all the changes i made to httpd.conf i restarted apache, to no avail still. 另外,我对httpd.conf所做的所有更改都重新启动了Apache,但仍然无济于事。

I'm using sinatra. 我正在使用sinatra。 Heres my config.ru. 这是我的config.ru。 the commented out portion is the local version of my config.ru which works fine if i run rackup config.ru : 注释掉的部分是我的config.ru的本地版本,如果我运行rackup config.ru可以正常工作:

#require File.dirname(__FILE__) + "/main"
#run Sinatra::Application

require 'sinatra'

Sinatra::Application.default_options.merge!(
  :run => false,
  :env => ENV['RACK_ENV']
)

require 'main'
run Sinatra.application

Not sure what else there is to do... thank you! 不知道还有什么要做...谢谢!

turns out it was because i was using cpanel/whm and I have to do a few extra steps accessing a *.conf include.. http://www.karlrixon.co.uk/writing/editing-virtualhost-settings-in-whm-cpanel/ 原来,这是因为我使用的cPanel / WHM,我必须做一些额外的工作访问* .conf文件包括.. http://www.karlrixon.co.uk/writing/editing-virtualhost-settings-in- whm-cpanel /

this is what had to go in *.conf in the userdata folder 这是必须在userdata文件夹的* .conf中输入的内容

DocumentRoot /home/why/app/public
  <Directory /home/why/app/public>
    Allow from all
    Options -MultiViews
  </Directory>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM