Jagger Kyne

Joined

110 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in 404 Not Found after deploy to Ubuntu server

I followed the tutorial on this site and deploy my rail app on the newly setup ubuntu server.

the rails app is successfully run on heroku, so it must some configuration on my nginx server.

below are the setting on /etc/nginx/site-enabled/default:

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;
        server_name etsydemo.com; #dummy domain I setup on my mac /private/etc/hosts
        passenger_enabled on;
        rails_env    production;
        root         /home/jk/eyideaIS/public;
        redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
         }
 }

settings on config/deploy.rb

# config valid only for Capistrano 3.1
lock '3.1.0'

set :application, 'etsydemo'
set :repo_url, 'git@github.com:jaggerkyne/estydemo.git'

set :deploy_to, '/home/jk/etsydemo'

set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

namespace :deploy do

desc 'Restart application'
task :restart do
   on roles(:app), in: :sequence, wait: 5 do
   execute :touch, release_path.join('tmp/restart.txt')
   end
  end

  after :publishing, 'deploy:restart'
  after :finishing, 'deploy:cleanup'
end

settings on config/deploy/production.rb are:

 set :stage, :production
 # Replace 127.0.0.1 with your server's IP address!
 server '172.16.88.133', user: 'jk', roles: %w{web app}

What did I do wrong? Can someone please point it out?

Finally, how to cretate /tmp/restart.txt for passenger?. Is the tutorial using different version of rails? It seem the file structure is different than rails 4.1.8. My rails app does not have myapp/current/tmp/restart.txt,how to create one?

The file structure is

tree
.
|-- app
| |-- assets
| | |-- images
| | | -- default.png
| | |-- javascripts
| | | |-- application.js
| | | |-- listings.js.coffee
| | |
-- pages.js.coffee
| | -- stylesheets
| | |-- application.css
| | |-- custom.css.scss
| | |-- listings.css.scss
| |
-- pages.css.scss
| |-- controllers
| | |-- application_controller.rb
| | |-- concerns
| | |-- listings_controller.rb
| | -- pages_controller.rb
| |-- helpers
| | |-- application_helper.rb
| | |-- listings_helper.rb
| |
-- pages_helper.rb
| |-- mailers
| |-- models
| | |-- concerns
| | -- listing.rb
|
-- views
| |-- layouts
| | |-- application.html.erb
| | |-- _footer.html.erb
| | -- _header.html.erb
| |-- listings
| | |-- edit.html.erb
| | |-- _form.html.erb
| | |-- index.html.erb
| | |-- index.json.jbuilder
| | |-- new.html.erb
| | |-- show.html.erb
| |
-- show.json.jbuilder
| -- pages
| |-- about.html.erb
|
-- contact.html.erb
|-- bin
| |-- bundle
| |-- bundler
| |-- cap
| |-- capify
| |-- erubis
| |-- figaro
| |-- rackup
| |-- rails
| |-- rake
| |-- rdoc
| |-- ri
| |-- sass
| |-- sass-convert
| |-- scss
| |-- sdoc
| |-- sdoc-merge
| |-- spring
| |-- sprockets
| |-- thor
| -- tilt
|-- Capfile
|-- config
| |-- application.rb
| |-- application.yml
| |-- boot.rb
| |-- database.yml
| |-- deploy
| |
-- production.rb
| |-- deploy.rb
| |-- dropbox.yml
| |-- environment.rb
| |-- environments
| | |-- development.rb
| | |-- production.rb
| | -- test.rb
| |-- initializers
| | |-- assets.rb
| | |-- backtrace_silencers.rb
| | |-- cookies_serializer.rb
| | |-- filter_parameter_logging.rb
| | |-- inflections.rb
| | |-- mime_types.rb
| | |-- session_store.rb
| |
-- wrap_parameters.rb
| |-- locales
| | -- en.yml
| |-- routes.rb
|
-- secrets.yml
|-- config.ru
|-- db
| |-- development.sqlite3
| |-- migrate
| | |-- 20141212141828_create_listings.rb
| | -- 20141215124718_add_attachment_image_to_listings.rb
| |-- schema.rb
|
-- seeds.rb
|-- Gemfile
|-- Gemfile.lock
|-- lib
| |-- assets
| |-- capistrano
| | -- tasks
|
-- tasks
|-- log
| -- development.log
|-- public
| |-- 404.html
| |-- 422.html
| |-- 500.html
| |-- favicon.ico
| |-- robots.txt
|
-- system
| -- listings
|
-- images
| -- 000
|
-- 000
| |-- 001
| | |-- medium
| | | |-- phone.png
| | | -- Screen_Shot_2014-12-15_at_9.13.52_PM.png
| | |-- original
| | | |-- phone.png
| | |
-- Screen_Shot_2014-12-15_at_9.13.52_PM.png
| | -- thumb
| | |-- phone.png
| |
-- Screen_Shot_2014-12-15_at_9.13.52_PM.png
| |-- 002
| | |-- medium
| | | |-- hd.png
| | | -- Screen_Shot_2014-12-15_at_9.13.44_PM.png
| | |-- original
| | | |-- hd.png
| | |
-- Screen_Shot_2014-12-15_at_9.13.44_PM.png
| | -- thumb
| | |-- hd.png
| |
-- Screen_Shot_2014-12-15_at_9.13.44_PM.png
| |-- 003
| | |-- medium
| | | -- Screen_Shot_2014-12-15_at_9.13.34_PM.png
| | |-- original
| | |
-- Screen_Shot_2014-12-15_at_9.13.34_PM.png
| | -- thumb
| |
-- Screen_Shot_2014-12-15_at_9.13.34_PM.png
| -- 004
| |-- medium
| |
-- Screen_Shot_2014-12-15_at_9.13.30_PM.png
| |-- original
| | -- Screen_Shot_2014-12-15_at_9.13.30_PM.png
|
-- thumb
| -- Screen_Shot_2014-12-15_at_9.13.30_PM.png
|-- Rakefile
|-- README.rdoc
|-- test
| |-- controllers
| | |-- listings_controller_test.rb
| |
-- pages_controller_test.rb
| |-- fixtures
| | -- listings.yml
| |-- helpers
| | |-- listings_helper_test.rb
| |
-- pages_helper_test.rb
| |-- integration
| |-- mailers
| |-- models
| | -- listing_test.rb
|
-- test_helper.rb
|-- tmp
| |-- cache
| | -- assets
| |
-- development
| | |-- sass
| | | |-- 011d7d1c91621eb84ae479ad82604e98facf777f
| | | | -- _bootstrap.scssc
| | | |-- 08f3718b183ed495627ef8fb45fa8c16ccf02b1c
| | | | |-- _alerts.scssc
| | | | |-- _background-variant.scssc
| | | | |-- _border-radius.scssc
| | | | |-- _buttons.scssc
| | | | |-- _center-block.scssc
| | | | |-- _clearfix.scssc
| | | | |-- _forms.scssc
| | | | |-- _gradients.scssc
| | | | |-- _grid-framework.scssc
| | | | |-- _grid.scssc
| | | | |-- _hide-text.scssc
| | | | |-- _image.scssc
| | | | |-- _labels.scssc
| | | | |-- _list-group.scssc
| | | | |-- _nav-divider.scssc
| | | | |-- _nav-vertical-align.scssc
| | | | |-- _opacity.scssc
| | | | |-- _pagination.scssc
| | | | |-- _panels.scssc
| | | | |-- _progress-bar.scssc
| | | | |-- _reset-filter.scssc
| | | | |-- _resize.scssc
| | | | |-- _responsive-visibility.scssc
| | | | |-- _size.scssc
| | | | |-- _tab-focus.scssc
| | | | |-- _table-row.scssc
| | | | |-- _text-emphasis.scssc
| | | | |-- _text-overflow.scssc
| | | |
-- _vendor-prefixes.scssc
| | | |-- 14240636049bc7c63728ba63268a1660abe04d73
| | | | |-- custom.css.scssc
| | | | |-- listings.css.scssc
| | | | |-- pages.css.scssc
| | | | -- scaffolds.css.scssc
| | |
-- 88ce3d55e747cffd224466b3c05ec9a6eef5f9ed
| | | |-- _alerts.scssc
| | | |-- _badges.scssc
| | | |-- _breadcrumbs.scssc
| | | |-- _button-groups.scssc
| | | |-- _buttons.scssc
| | | |-- _carousel.scssc
| | | |-- _close.scssc
| | | |-- _code.scssc
| | | |-- _component-animations.scssc
| | | |-- _dropdowns.scssc
| | | |-- _forms.scssc
| | | |-- _glyphicons.scssc
| | | |-- _grid.scssc
| | | |-- _input-groups.scssc
| | | |-- _jumbotron.scssc
| | | |-- _labels.scssc
| | | |-- _list-group.scssc
| | | |-- _media.scssc
| | | |-- _mixins.scssc
| | | |-- _modals.scssc
| | | |-- _navbar.scssc
| | | |-- _navs.scssc
| | | |-- _normalize.scssc
| | | |-- _pager.scssc
| | | |-- _pagination.scssc
| | | |-- _panels.scssc
| | | |-- _popovers.scssc
| | | |-- _print.scssc
| | | |-- _progress-bars.scssc
| | | |-- _responsive-embed.scssc
| | | |-- _responsive-utilities.scssc
| | | |-- _scaffolding.scssc
| | | |-- _tables.scssc
| | | |-- _thumbnails.scssc
| | | |-- _tooltip.scssc
| | | |-- _type.scssc
| | | |-- _utilities.scssc
| | | |-- _variables.scssc
| | | -- _wells.scssc
| |
-- sprockets
| | |-- 049a3ce71585e88d07628c4795902718
| | |-- 05a64f05f85cc44051c23e111f84b821
| | |-- 0634ea3136e394f7fe9bb2f929f16caa
| | |-- 094987eebfef43714f8ee25bbcdbf8bb
| | |-- 0bb111ba43bf6c799028bbdfb0841a88
| | |-- 0c6b4ac44585c7d4a3f60923691aa8fa
| | |-- 10fcfbe6ebae11a40c8eac41939a1b9a
| | |-- 13fe41fee1fe35b49d145bcc06610705
| | |-- 153837ca0d87efe2424624752dcc8a0c
| | |-- 1a66d8334bb82817e826dbeba46cf0cc
| | |-- 1b2a18bf7b5e8796bfe1275d11497748
| | |-- 1b7f88dd906f7476a56e8b9400ece544
| | |-- 1ba2331aab000dc355521d376087bf32
| | |-- 1c743674003b159f5c665fba7f8da053
| | |-- 1d72ed474742ca0a7915812eca5565de
| | |-- 1de186e934cea9614395a0ced31c4759
| | |-- 21fa475f07fc4b3da9f47aef7a3240ea
| | |-- 2344effab1de12d8426bf375da04ee00
| | |-- 296874a1bdab68e6ab4c07ad63388048
| | |-- 2c03908a0fbcbabd507d28e2b2c1e879
| | |-- 2d2cb554d01b1d94d004db84691412dd
| | |-- 2e0561245d22058dcea96e981ad36870
| | |-- 2f5173deea6c795b8fdde723bb4b63af
| | |-- 30532792da1f23fe031b3c139d2eb054
| | |-- 3077080a122a4d61ad06a47f442208ae
| | |-- 357970feca3ac29060c1e3861e2c0953
| | |-- 412399f16269e5df93a563569c1f34b4
| | |-- 425017a3f725f63fd369ce91a9400463
| | |-- 425c32d33ac312bdebf65df9fef9f74a
| | |-- 44e826b7b80c2e1c8463a1d11bd09022
| | |-- 466986a3e30b269d61008bb5b13dbbc8
| | |-- 490042f2e01331c4cbada74607a0c80c
| | |-- 4ca64b61cefe5e9c6f00c8eee2681535
| | |-- 553a243e9ca40f7d91b5b91d40a4400c
| | |-- 5667f66bfa8361bb1a63654f999d9370
| | |-- 56c208d486847cf4c82586e17b865ef1
| | |-- 58d13fa8238ddbe40924e2b2b8e2b892
| | |-- 59d5034ef7c78865bfde4af7dd0f1e2b
| | |-- 59f8a396c2cdbd4bcdc1755d11e6acf8
| | |-- 6bc96ed1cc4758da0c1f91086fab2257
| | |-- 797446d303aa1284ddb8e9f390572d09
| | |-- 84c7383184be3a7e520139788876a8e4
| | |-- 86569f9e6967043a5622a3c992cb8f0e
| | |-- 8d467b2390a5eab42a9d2d3d89792e32
| | |-- 8f2511830f6e103d24928dac99a5cf5a
| | |-- 93aa0ed9523a9fe2cd1b41f7c89f1fca
| | |-- 9487b16aab65ac33783993cd1aa26c8c
| | |-- 98644db9b18b3aa2daffc0876e35dbab
| | |-- 9c54a601654ebf545d1155fc6cc861b0
| | |-- a3077e2993b2e351d733533cfed3ee62
| | |-- a5290c7ae66e97020d75d77ab6d4dcde
| | |-- abc7b4f156244d95ead5ca48619efc87
| | |-- b09fb77d5362619535bc263bee250bdd
| | |-- b0d385dd56e97af95b780c08b2ffc29a
| | |-- b5653879ca3f66cb3572391cc51b2a80
| | |-- b6ca62a1ed9d7bc52d1953dbf6b20360
| | |-- b7cf1ee5c56fa85d2cf039f2541df071
| | |-- b7e4202e5a791b88efa285d17909b04e
| | |-- bd3936370d0f952ada5774e2230046ed
| | |-- bed026be6c3a2370d790f750f603f4df
| | |-- c1577dcd9ff4025295c9e4851559b1d2
| | |-- c43bb19dceef544a12248d0518e0a29d
| | |-- cffd775d018f68ce5dba1ee0d951a994
| | |-- d5345a6be82e3c90f3d0b37f874c72dd
| | |-- d6c7ce3ac277094b04690a43947ede22
| | |-- d771ace226fc8215a3572e0aa35bb0d6
| | |-- dfb233e571e2e958529a410e0bd19c30
| | |-- e459168835a5f27b832ace20874f7c10
| | |-- e7c135e11fde55286c34c65473d974d3
| | |-- edbf63d87f211c17de329b8a471a7caf
| | |-- f1788a65939bf623a4c07d83ece3d72b
| | |-- f190bc9359d3edadeb45dca87a0cb758
| | |-- f323bb3f86983aab0ac47b682a91ba59
| | |-- f5f738b65b700d4d150982435be7b758
| | |-- f7cbd26ba1d28d48de824f0e94586655
| | |-- f98e89c72ac1d9ec856dd622a1a741e4
| | -- fa39cd56508900f281b1e795eb1020b3
| |-- pids
| |-- sessions
|
-- sockets
-- vendor
-- assets
|-- javascripts
`-- stylesheets

Posted in Nginx.conf failed

You are right Chris,

I have similar message as yours. I will uninstall them and try again. So, the tutorial need to be updated.

In the gorails' tutorial, the code is:

sudo apt-get install nginx-full passenger

but on the official tutorial is:

sudo apt-get install nginx-extras passenger

after use the above command to reinstall, the problem solve, I can move forward to the rest of the tutorial, hopefully someone can update the tutorial to avoid future problem.

Posted in Nginx.conf failed

I followed line by line in this tutorialto setup my own production server.

After Nginx is installed and up and running, I followed the instruction to modified nginx.conf:

Find the following lines, and uncomment them at /etc/nginx/nginx.conf:

# Phusion Passenger

# Uncomment it if you installed ruby-passenger or ruby-passenger-enterprise

passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;

passenger_ruby /home/jk/.rvm/rubies/ruby-2.1.5/bin/ruby;

passenger_ruby /home/jk/.rvm/wrappers/ruby-2.1.5/ruby;

When I run:

which passenger
in terminal give me:
gives:

/usr/bin/passenger

My ruby on the server is at

/home/jk/.rvm/rubies/ruby-2.1.5/bin/ruby

I am using rvm, and the rvm wrappers location is correct. However, when I run a test using

sudo nginx -t

The system throws this error:

nginx: [emerg] unknown directive "passenger_root" in /etc/nginx/nginx.conf:67

nginx: configuration file /etc/nginx/nginx.conf test failed

I have searched on google, but somehow all solutions direct me to reinstall nginx with passenger module.
But passenger module have already been installed by following the tutorial.

How can I fix this? Can anyone help?

Cheers,

JK