为什么apache文件只显示出来。为什么不出现乘客页面?
是什么让它指向公众/公众? 我确实删除了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:
这是我去网址时出现的内容
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上的Apache / 2.2.20(Ubuntu)服务器端口80
我编辑了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
答案 0 :(得分:0)
事实证明我必须卸载并重新安装Passenger。看起来它已经安装了两次。