【发布时间】:2018-05-22 08:45:32
【问题描述】:
我在本地 xampp 上完成了我的 laravel 应用程序,我目前正在处理我在 vps 服务器上的应用程序。我有自己的公司 VPS 服务器。
服务器部门有帮助安装debian jessie、php 7.0-fpm、nginx、mysql。
现在我的职责是部署应用程序。
已完成作曲家安装和数据库迁移。 我也遇到了 503 和 402 的问题,已经解决了。
问题是,网站图标正在显示,但内容没有显示。
我不知道从哪里开始,希望你们能帮助我,谢谢。
P/S : 服务器部门无法帮助我解决这个问题。
这里有两个重要的配置...
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 站点可用于 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;
}
}
【问题讨论】:
-
尝试清除缓存
-
检查存储、缓存文件夹的权限。
-
检查应用程序日志和服务器日志
-
@Webinion im 使用 chrome incognito,还清除了 chrome 缓存,已经清除了 php artisan 上的缓存和配置
-
@seravee 已经完成 chgrp -R root /var/...... 和 chmod -R 775 /var/...../storage。错误日志得到了这个 2017/12/08 12:29:18 [错误] 18788#18788: *7 "/var/www/html/sub.domain.com/public/" 的目录索引被禁止,客户端:ipaddress,服务器:sub.domain.com,请求:“GET / HTTP/1.0”,主机:“sub.domain.com”