0

i finishing doing my laravel apps on local xampp, i currently in process to up my apps on vps server. I got my own company VPS server.

The server department have help install debian jessie, php 7.0-fpm, nginx, mysql.

Now my part is to deploy the apps.

Already done with composer installing and database migration. I also got 503 and 402 problem, already fix that.

The problem is, the favicon is showing, but the content is not showing.

I don't know where to start, i hope you guys can help me out, thanks.

P/S : Server department cannot help me out on this.

Here are the 2 important configuration...

Laravel .env

APP_NAME=eticket
APP_ENV=production
APP_KEY=secretLOL
APP_DEBUG=flase
APP_LOG_LEVEL=debug
APP_URL=http://sub.domain.com

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=dbname
DB_USERNAME=dbuser
DB_PASSWORD=dbpass

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mail.domain.com
MAIL_PORT=587
MAIL_USERNAME=name@domain.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=

Nginx site-available for sub.domain.com

server {
    listen 80;
    server_name sub.domain.com;
    root /var/www/html/sub.domain.com/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

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

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}
Asyraf
  • 31
  • 9
  • try clearing cache – Bhaumik Pandhi Dec 08 '17 at 06:11
  • have your checked permissions on storage, cache folders. – seravee Dec 08 '17 at 06:13
  • Check with the application log and server logs – seravee Dec 08 '17 at 06:14
  • @Webinion im using chrome incognito, also cleared chrome cache, already cleared cache and config on php artisan – Asyraf Dec 08 '17 at 06:25
  • @seravee already done chgrp -R root /var/...... and chmod -R 775 /var/...../storage. error log got this 2017/12/08 12:29:18 [error] 18788#18788: *7 directory index of "/var/www/html/sub.domain.com/public/" is forbidden, client: ipaddress, server: sub.domain.com, request: "GET / HTTP/1.0", host: "sub.domain.com" – Asyraf Dec 08 '17 at 06:31
  • check this https://stackoverflow.com/questions/19285355/nginx-403-error-directory-index-of-folder-is-forbidden. Might helps you. – seravee Dec 08 '17 at 07:40

2 Answers2

0

You need to give proper access to both storage and bootstrap/cache :

sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache

Also check that your web server has the right to read on your application folders

Mathieu Ferre
  • 4,246
  • 1
  • 14
  • 31
0

i have solve the problem.

i need to do this.

sudo chown -R www-data: app/storage
sudo chmod -R 755 app/storage

reference: http://davidmyers.name/post/laravel-on-digital-ocean

Asyraf
  • 31
  • 9