A
A
Anton Misyagin2015-08-14 14:25:39
Nginx
Anton Misyagin, 2015-08-14 14:25:39

First time running RoR test app on ubuntu + Passenger + nginx?

Windows machine is running Oracle Vm in which ubuntu server 14 x64 sits. Set up ssh, installed rvm, ruby, rails, bundle, nodejs. Created a test RoR application in ~/test_app. Installed gems for test application. rails s - starts.
Next, I set up the nginx + passenger bundle.
So I used the instruction: https://www.phusionpassenger.com/library/walkthrou...
in windows on the locale in the browser I enter the ip of the virtual machine I see: Welcome to nginx on ubuntu. How to see the test application?

passenger-config about ruby-command
passenger-config was invoked through the following Ruby interpreter:
  Command: /home/brainy_code/.rvm/gems/ruby-2.1.5/wrappers/ruby
  Version: ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
  To use in Apache: PassengerRuby /home/brainy_code/.rvm/gems/ruby-2.1.5/wrappers
  To use in Nginx : passenger_ruby /home/brainy_code/.rvm/gems/ruby-2.1.5/wrapper
  To use with Standalone: /home/brainy_code/.rvm/gems/ruby-2.1.5/wrappers/ruby /hm/gems/ruby-2.1.5/gems/passenger-5.0.15/bin/passenger start

sudo nano /etc/nginx/sites-enabled/test_app.conf:

server {
    listen 80;
    server_name yourserver.com;

    # Tell Nginx and Passenger where your app's 'public' directory is
    root ~/test_app/public;

    # Turn on Passenger
    passenger_enabled on;
    passenger_ruby /home/brainy_code/.rvm/gems/ruby-2.1.5/wrapper;
}

sudo service nginx restart
ok

Probably need to ask leading questions, because I do not understand what might be needed to fix the problem. For now, I leave the server name arbitrary and try to access the server by ip. Or is it needed right now?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Misyagin, 2015-08-14
@sunnmas

root /home/deployer/test_app/public;

T
TyzhSysAdmin, 2015-08-14
@POS_troi

And let's bet what you did according to the wrong instruction, or rather according to it, but with free steps to the left and right? :)
not the right question, the right question is "why does nginx look for indexhtml in /usr/share/nginx/~/test_app/public/ and not in the public directory of the project" ;)
and even by the way, they forgot to mention in the instructions that in order for nginx to give you what you want access the address yourserver.comor assign the virtual host as default.
Well, or you can register yourserver.comin the hosts of your OS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question