使用capistrano在ec2上部署rails网站,但它没有显示在浏览器上,这里是网站 – > http://passionate4.net/

我正在使用apache乘客来部署rails应用程序。

我已经清楚地遵循了每一步,一切正常。 部署中没有错误消息。

但该网站没有出现在浏览器上。

这是文件

$ sudo cat /etc/apache2/sites-available/capi_app  ServerName www.passionate4.net DocumentRoot /var/www/apps/capi_app/public RailsEnv production  Allow from all Options -MultiViews   

我也试图改变

$ sudo cat / etc / apache2 / sites-available / capi_app

  ServerName www.passionate4.net DocumentRoot /var/www/apps/capi_app/current/public RailsEnv production  Allow from all Options -MultiViews   

– >有了这个,当我重新启动apache时,我没有得到错误(/ / / public)不存在,但是站点仍然没有显示出来。

@马丁

$ sudo cat / etc / apache2 / sites-enabled / capi_app

  ServerName www.passionate4.net DocumentRoot /var/www/apps/capi_app/current/public RailsEnv production  Allow from all Options -MultiViews   

———– deploy.rb文件————-

 require 'bundler/capistrano' #using RVM! $:.unshift("#{ENV["HOME"]}/.rvm/lib") require "rvm/capistrano" set :rvm_type, :user set :application, "capi_app" set :deploy_to, "/var/www/#{application}" role :web, "50.18.155.154" # Your HTTP server, Apache/etc role :app, "50.18.155.154" # This may be the same as your `Web` server role :db, "50.18.155.154", :primary => true # This is where Rails migrations will run default_run_options[:pty] = true set :repository, "git@github.com:jaipratik/capi_app.git" set :scm, :git set :branch, "master" set :user, "ubuntu" #if error use whats shown in podcast set :use_sudo, false set :admin_runner, "ubuntu" set :rails_env, 'production' #<<<<<<<<< :app, :except => { :no_release => true } do run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" end end 

ubuntu @ ip-10-166-185-18:〜$ ls -l / var / www / apps / capi_app

总共8

lrwxrwxrwx 1 ubuntu ubuntu 46 2011-11-17 19:04当前 – > / var / www /

应用程序/ capi_app /发行/ 20111117190420

drwx-w —- 5 ubuntu ubuntu 4096 2011-11-17 19:04发布

drwx-w —- 6 ubuntu ubuntu 4096 2011-11-17 09:48分享

Ubuntu的@ IP-10-166-185-18:〜$


确保您的vhost位于/etc/apache2/sites-available某个/etc/apache2/sites-available ,然后确保将其添加到apache,方法是使用a2ensite命令,或者手动将系统符号/etc/apache2/sites-enabled/your_vhost_name_here到任何地方你打电话给这个网站。

启用站点的可能命令(使用其中一个):

 sudo a2ensite your_vhost_name sudo ln -s /etc/apache2/sites-available/your_vhost_name /etc/apache2/sites-enabled 

完成此操作后,请确保通过运行以下命令重新加载apache:

 sudo service apache2 restart 

我将应用程序放在var / www / myapplication这个特定的位置。

这解决了错误“不允许符号链接或链接目标无法访问”。 我将采取我采取的所有步骤来解决这个问题。

除此之外,我还将博客讨论如何解决第一次部署rails 3.1到ec2所涉及的错误。 在这里 – >
http://recipe4developer.wordpress.com/2011/11/19/correcting-errors-in-first-time-rails-3-1-deployment-to-ec2/

你有没有使用Heroku的原因? 您可以通过非常轻松的部署获得EC2。