92five icon indicating copy to clipboard operation
92five copied to clipboard

Nginx setup?

Open w33zy opened this issue 11 years ago • 14 comments

Do you have any specific instructions or information on configuring the app to work with Nginx? I am getting a 502 error with my setup

w33zy avatar Sep 21 '14 19:09 w33zy

Could you please provide us Nginx log file, located by default in /var/log/nginx/nginx_error.log ?

dvdpearson avatar Sep 23 '14 17:09 dvdpearson

Here is the nginx error i got. I only masked the domain and ip. Also the 92five app is sitting beside several WordPress sites being served by Nginx. So I am reluctant to try the solutions that I see on StackOverflow

2014/09/23 14:25:45 [crit] 11433#0: *41354 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 184.176.244.217, server: project.website.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "project.website.com"
2014/09/23 14:28:50 [crit] 11433#0: *41366 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 184.176.244.217, server: project.website.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "project.website.com"

w33zy avatar Sep 23 '14 18:09 w33zy

What Distro is running on the server? Can you post your nginx config for the site?

Chaosbit avatar Sep 24 '14 13:09 Chaosbit

As @Chaosbit said, it would be easier for us to investigate with your configuration.

dvdpearson avatar Sep 24 '14 13:09 dvdpearson

I am running Ubuntu 12.04.4 LTS

Here is a copy of my server block

server {

    server_name project.website.com www.project.website.com;

    access_log   /var/log/nginx/project.website.com.access.log rt_cache;
    error_log    /var/log/nginx/project.website.com.error.log;

    root /var/www/project.website.com/htdocs;
    index index.php index.htm index.html;



    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }   

    include common/php.conf;
    include common/locations.conf;

}

w33zy avatar Sep 24 '14 13:09 w33zy

So my Nginx setup to run php5-fpm on 127.0.0.1:9000 not unix:/var/run/php5-fpm.sock.

I editted the location block and now I am getting the Whoops, looks like something went wrong error

w33zy avatar Sep 24 '14 14:09 w33zy

In which step?

Chaosbit avatar Sep 24 '14 14:09 Chaosbit

Just visiting the homepage gives me this error

w33zy avatar Sep 24 '14 14:09 w33zy

I enabled debug mode and saw that it was a file write error. I ended up setting /storage/.. to 0777 in trying to troubleshoot the error.

Can we get more specific details on the chmod/permission values for folders and files?

w33zy avatar Sep 24 '14 15:09 w33zy

~~This is the furthest I have reached http://project.website.com/install/adminaccount, then I get the Oops Something went wrong error.~~

Passed that step. Am I correcting assuming that when the docs say make a folder or file 'writable', it means setting the permission to 0777

w33zy avatar Sep 24 '14 15:09 w33zy

Sorry guys had been busy so couldn't able to participate in the discussion. @w33zy Either 0777 or 0755 according to your configuration. Exactly where have you been stuck. @dvdpearson and @Chaosbit Thanks guys for answering while I wasn't there. :)

chintanbanugaria avatar Sep 24 '14 16:09 chintanbanugaria

@chintanbanugaria I got it working only after setting most folders to 0777 recursively.

BTW... is it possible to change the user avatar pic? My admin account is using the 'CB' avatar pic

w33zy avatar Sep 24 '14 16:09 w33zy

@w33zy Actually I am working on that. Currently you can replace your avataar manually. The profile pics are located at assets/images/profilepics. Please make sure that your image has a png extension and 128 x128 of dimenstion.

chintanbanugaria avatar Sep 26 '14 10:09 chintanbanugaria

For the original issue, I've created wiki instructions, found here: https://github.com/chintanbanugaria/92five/wiki/Installation-Instructions#nginx

The original issue can be closed. If there's anymore problems, separate issues can be created.

lancepioch avatar Dec 16 '14 19:12 lancepioch