mercredi 13 janvier 2016

Deploy Laravel 5.1 App Issue

I try to deploy laravel App by DigitalOcean cloud server (LEMP Server)

but when visit my domain name or server ip , I getting this error from Nginx server

404 Not Found

Nginx error /var/log/nginx/error.log

2016/01/13 19:34:36 [crit] 1045#0: *6 stat() "/appPath/laravelApp/public/index.php" failed (13: Permission denied), client: 41.234.157.204, server: myIpServer, request: "GET / HTTP/1.1", host: "myIpServer"

Nginx conf /etc/nginx/nginx.conf

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

 events {
    worker_connections 1024;
  }

  http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' 
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

  access_log  /var/log/nginx/access.log  main;

  sendfile            on;
  tcp_nopush          on;
  tcp_nodelay         on;
  keepalive_timeout   65;
 types_hash_max_size 2048;

 include             /etc/nginx/mime.types;
 default_type        application/octet-stream;

 # Load modular configuration files from the /etc/nginx/conf.d directory.
 # See http://ift.tt/1vmdyUy
 # for more information.
 include /etc/nginx/conf.d/*.conf;

  server {
    #listen       80 default_server;
    #listen       [::]:80 default_server;
    listen        80;
    server_name         104.236.24.116;
    charset utf-8;
    root         /home/ataala/www/crm/public;
    index        index.php index.html index.htm;
    # Load configuration files for the default server block.
    include /etc/nginx/default.d/*.conf;

    location / {
      try_files $uri $uri/ /index.php?$query_string;

    }

              location ~ \.php$ {
         root        /home/ataala/www/crm/public;
        #root           /usr/share/nginx/html/crm/public;
          try_files $uri =404;
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
          include        fastcgi_params;
}

    error_page 404 /404.html;
        location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
     }

   }
 }

www.conf /etc/php-fpm.d/www.conf

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web      server.
; Default Values: user and group are set as the running user
;                 mode is set to 0660
listen.owner = www-data
listen.group = www-data
listen.mode = 0660

In www.conf i set listen.owner and listen.group after research a round this point but i need to know does www-data is something like keyword or user on my server or something else

In fact i spent two days to deploy this app from issue to another If you can help me please do it , Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire