无法在Apache

时间:2017-05-14 15:15:51

标签: ruby apache deployment sinatra

所以我有一个sinatra应用程序在我的本地机器上正常运行。目录结构是:

├── Gemfile
├── Gemfile.lock
├── Rakefile
├── app
│   ├── controllers
│   │   └── bike_share_app.rb
│   ├── models
│   │   ├── city.rb
│   │   ├── condition.rb
│   │   ├── csv_loader.rb
│   │   ├── station.rb
│   │   └── trip.rb
│   └── views
│       ├── cities
│       │   ├── city.erb
│       │   ├── index.erb
│       │   └── new.erb
│       ├── conditions
│       │   ├── edit.erb
│       │   ├── index.erb
│       │   ├── new.erb
│       │   ├── show.erb
│       │   └── weather_dashboard.erb
│       ├── home.erb
│       ├── stations
│       │   ├── edit.erb
│       │   ├── index.erb
│       │   ├── new.erb
│       │   ├── show.erb
│       │   └── station_dashboard.erb
│       └── trips
│           ├── edit.erb
│           ├── index.erb
│           ├── new.erb
│           ├── show.erb
│           └── trip_dashboard.erb
├── config
│   ├── database.rb
│   ├── database.yml
│   └── environment.rb
├── config.ru
├── db
│   ├── csv
│   │   ├── station.csv
│   │   ├── status.csv
│   │   ├── trip.csv
│   │   └── weather.csv
│   ├── migrate
│   │   ├── 20170506165638_create_stations.rb
│   │   ├── 20170506225107_fix_date_type.rb
│   │   ├── 20170507184336_create_cities.rb
│   │   ├── 20170507184847_change_city_column_in_stations.rb
│   │   ├── 20170508201547_create_trips.rb
│   │   ├── 20170509023655_update_trip_zip_type.rb
│   │   ├── 20170509220039_create_conditions.rb
│   │   ├── 20170509222446_fix_date_column_in_conditions.rb
│   │   ├── 20170510175115_change_date_string_to_date_object.rb
│   │   ├── 20170511050518_change_date_string_to_date_object_in_conditions.rb
│   │   └── 20170511055446_add_index_to_trip_start_date.rb
│   ├── schema.rb
│   └── seeds.rb
├── public
│   ├── assets
│   │   └── bicycle.svg
│   ├── css
│   ├── fonts
│   ├── js
│   └── stylesheets
└── spec
    ├── controllers
    ├── features
    │   ├── condition_crud_spec.rb
    │   ├── station_crud_spec.rb
    │   └── trip_crud_spec.rb
    ├── fixtures
    │   └── trip_fixture.csv
    ├── models
    │   ├── city_spec.rb
    │   ├── csv_loader_spec.rb
    │   ├── station_spec.rb
    │   └── trip_spec.rb
    └── spec_helper.rb

我在我的debian服务器上运行apache和乘客的结构如下(注意:我在文档中读到我需要一个公共和临时文件夹。所以我将所有的CSS和视图移动到公共场所,并将我的应用程序的其余部分放在根目录中)

├── app
│   ├── controllers
│   │   └── bike_share_app.rb
│   └── models
│       ├── city.rb
│       ├── condition.rb
│       ├── csv_loader.rb
│       ├── station.rb
│       └── trip.rb
├── config
│   ├── database.rb
│   ├── database.yml
│   └── environment.rb
├── config.ru
├── db
│   ├── csv
│   │   ├── station.csv
│   │   ├── status.csv
│   │   ├── trip.csv
│   │   └── weather.csv
│   ├── migrate
│   │   ├── 20170506165638_create_stations.rb
│   │   ├── 20170506225107_fix_date_type.rb
│   │   ├── 20170507184336_create_cities.rb
│   │   ├── 20170507184847_change_city_column_in_stations.rb
│   │   ├── 20170508201547_create_trips.rb
│   │   ├── 20170509023655_update_trip_zip_type.rb
│   │   ├── 20170509220039_create_conditions.rb
│   │   ├── 20170509222446_fix_date_column_in_conditions.rb
│   │   ├── 20170510175115_change_date_string_to_date_object.rb
│   │   ├── 20170511050518_change_date_string_to_date_object_in_conditions.rb
│   │   └── 20170511055446_add_index_to_trip_start_date.rb
│   ├── schema.rb
│   └── seeds.rb
├── Gemfile
├── Gemfile.lock
├── logs
│   ├── access.log
│   └── error.log
├── public
│   ├── assets
│   │   └── bicycle.svg
│   ├── css
│   ├── fonts
│   ├── js
│   ├── stylesheets
│   └── views
│       ├── cities
│       │   ├── city.erb
│       │   ├── index.erb
│       │   └── new.erb
│       ├── conditions
│       │   ├── edit.erb
│       │   ├── index.erb
│       │   ├── new.erb
│       │   ├── show.erb
│       │   └── weather_dashboard.erb
│       ├── edit.erb
│       ├── home.erb
│       ├── index.erb
│       ├── new.erb
│       ├── station_dashboard.erb
│       ├── station.erb
│       ├── stations
│       │   ├── edit.erb
│       │   ├── index.erb
│       │   ├── new.erb
│       │   ├── show.erb
│       │   └── station_dashboard.erb
│       └── trips
│           ├── edit.erb
│           ├── index.erb
│           ├── new.erb
│           ├── show.erb
│           └── trip_dashboard.erb
├── Rakefile
├── spec
│   ├── controllers
│   ├── features
│   │   ├── condition_crud_spec.rb
│   │   ├── station_crud_spec.rb
│   │   └── trip_crud_spec.rb
│   ├── fixtures
│   │   └── trip_fixture.csv
│   ├── models
│   │   ├── city_spec.rb
│   │   ├── csv_loader_spec.rb
│   │   ├── station_spec.rb
│   │   └── trip_spec.rb
│   └── spec_helper.rb
└── tmp
    └── restart.txt

在我的浏览器中导航到我的主机,这给了我"应用程序无法启动"乘客错误。以下是访问日志:

- - [14/May/2017:10:00:47 -0500] "GET / HTTP/1.1" 500 5133 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" - - [14/May/2017:10:00:48 -0500] "GET /favicon.ico HTTP/1.1" 500 5133 "http://IP/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/5$ - - [14/May/2017:10:00:51 -0500] "GET /favicon.ico HTTP/1.1" 500 5133 "http://IP/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/5$ - - [14/May/2017:10:02:18 -0500] "GET / HTTP/1.1" 500 5133 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" IP - - [14/May/2017:10:02:19 -0500] "GET /favicon.ico HTTP/1.1" 500 5133 "http://IP/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/5$ - - [14/May/2017:10:02:57 -0500] "GET / HTTP/1.1" 500 5133 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, - - [14/May/2017:10:02:57 -0500] "GET /favicon.ico HTTP/1.1" 500 5133 "http://IP/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/5$ - - [14/May/2017:10:04:05 -0500] "GET /favicon.ico HTTP/1.1" 500 5133 "http://IP/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/5$

我假设我的目录结构存在错误。有什么建议?附:抱歉目录树文本的长墙

编辑:这是我的conf:

VirtualHost *:80>
     ServerName localhost
     DocumentRoot /var/www/figgus/public
     PassengerRuby /usr/bin/ruby2.1
     ServerAlias figgus
     ErrorLog /var/www/figgus/logs/error.log
     CustomLog /var/www/figgus/logs/access.log combined

    # Relax Apache security settings
    <Directory /var/www/figgus/public>
      Allow from all
      Options -MultiViews
      # Uncomment this if you're on Apache > 2.4:
      Require all granted
    </Directory>
</VirtualHost>

0 个答案:

没有答案