Rail Deployment

I am trying to deploy a rail application that is located in / opt / rails / my_app . To do this, I installed the pearls and configured nginx using passenger-install-nginx-module . I can access the static welcome page, however, when I try to use another page, for example home (which is generated by rails, generates the controllerโ€™s home index), the browser continues to wait and wait for a response.

This does not happen when I deploy the application using rails son port 3000.

UPDATE When I execute passenger-install-apache2-module, I get g ++: the unrecognized option '-R / usr / local / lib' . I decided that I needed to change '-R / usr / local / lib' to 'Wl, -R / usr / local / lib' in order to compile the LoggingAgent correctly. Could you tell me how to modify the make file?

+3
source share
1 answer

As for NGINX, it sounds like it is a permission issue on some of your files and / or directories. Instead, I moved the application to the dedicated / home directory. For example, if you had a user named tester, your nginx.conf would say (the following works for me in Production:

server {
    listen       YOURIPADDRESSHERE:80; #use :443 if SSL is being used.

    server_name YOURFULLDOMAINNAMEHERE;
    #uncomment out following if ssl is used.
    #ssl on;
    #ssl_certificate  /etc/ssl/private/YOUR_chained.crt;
    #ssl_certificate_key  /etc/ssl/private/YOUR.key;
    #ssl_session_cache shared:SSL:1m;
    #ssl_session_timeout  5m;
    #ssl_protocols  SSLv3 TLSv1;
    #ssl_ciphers    HIGH:MEDIUM;
    #ssl_prefer_server_ciphers   on;
    root /home/tester/YOURRAILSAPPNAME/public;   # <--- be sure to point to 'public'!
    passenger_enabled on;
    charset utf-8;
    access_log /var/log/nginx/YOURFULLDOMAINNAMEHERE-ssl_access.log;
    error_log /var/log/nginx/YOURFULLDOMAINNAMEHERE-ssl_error.log warn;
    location /home/tester/YOURRAILSAPPNAME/public/ {
        root   html;
        index  index.html index.htm;
    }
    error_page  404              /404.html;
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}

Then make sure your rights are right (755 for all files, 644 for directories).

0

All Articles