为什么只有apache文件显示出来。为什么乘客页面没有出现?
是什么让它指向public/public?我删除了index.html文件,因为我有一个static_pages控制器
12296#0: *4 "/var/www/sample_app/releases/20120522195731/public/public/index.html" is not found
(2: No such file or directory), client: 127.0.0.1, server: 这是我转到url时出现的内容。
Index of /
[ICO] Name Last modified Size Description
[TXT] 404.html 22-May-2012 19:57 728
[TXT] 422.html 22-May-2012 19:57 711
[TXT] 500.html 22-May-2012 19:57 643
[IMG] favicon.ico 22-May-2012 19:57 0
[ ] passenger.3000.log 22-May-2012 21:35 488
[ ] passenger.3000.pid.lock 22-May-2012 21:36 0
[TXT] robots.txt 22-May-2012 19:57 204 server.silvernightfall.com端口80的Apache/2.2.20 (Ubuntu)服务器
我编辑了apache2.conf
LoadModule passenger_module /home/ubuntu/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12
/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p194/ruby我编辑了apache2/sites available/server
<VirtualHost *:80>
ServerAdmin victoria@jbyte.com
ServerName server.silvernightfall.com
# ServerAlias
DocumentRoot /var/www/sample_app/current/public
ErrorLog /var/www/sample_app/error.log
RailsEnv production
<Directory "/var/www/sample_app/current/public">
Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
</VirtualHost>静态页面控制器
class StaticPagesController < ApplicationController
def home
end
def help
end
def about
end
def contact
end
end和一个路由页面
SampleApp::Application.routes.draw do
root :to => 'static_pages#home'
match '/signup', to: 'users#new'
match '/help', to: 'static_pages#help'
match '/about', to: 'static_pages#about'
match '/contact', to: 'static_pages#contact'
end我认为唯一可能搞砸的是deploy.rb
# The name of your app
set :application, "sample_app"
# The directory on the EC2 node that will be deployed to
set :deploy_to, "/var/www/#{application}"
set :keep_releases, 3
# deploy with git
set :scm, :git
set :repository, "git@github.com:SilverNightFall/sample_app.git"
set :git_shallow_clone, 1
set :branch, "master"
set :use_sudo, true
# gets ssh info
set :user, "ubuntu"
ssh_options[:keys] = ["/Users/Victoria/Documents/ServerKeys/key.pem"]
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
# The address of the remote host on EC2 (the Public DNS address)
set :location, "server.silvernightfall.com"
# setup some Capistrano roles
role :app, location
role :web, location
role :db, location, :primary => true
after 'deploy:update_code', 'deploy:symlink_db'
namespace :deploy do
desc "Restart Application"
task :restart, :roles => :app do
run "touch #{deploy_to}/#{shared_dir}/tmp/restart.txt"
end
desc "Symlinks the database.yml"
task :symlink_db, :roles => :app do
run "ln -nfs #{deploy_to}/shared/config/database.yml
#{release_path}/config/database.yml"
end发布于 2012-05-24 07:32:56
结果我不得不卸载并重新安装Passenger。看起来它安装了两次。
https://stackoverflow.com/questions/10712680
复制相似问题