我在虚拟主机下运行一个网站 apache服务器运行php7和php-fpm。我在CentOS 7上运行这一切。 每当我尝试访问网站时,它都会处理PHP文件,但不处理css文件或任何其他文件,如jpg。
<VirtualHost www.example.com:80>
DocumentRoot "/var/www/htdocs"
ServerName example.com
ServerAlias www.example.com
ErrorLog /var/www/example.com/logs/error.log
CustomLog /var/www/example.com/logs/access.log combined
<IfModule mpm_event_module>
#ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/example.com/htdocs/$1
ProxyPassMatch ^/(.*)$ fcgi://127.0.0.1:9000/var/www/example.com/htdocs/$1
</IfModule>
<Directory "/var/www/example.com/htdocs">
#Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
allow from all
</Directory>
日志报告403用于css文件和除php之外的其他资源。
xx.xx.xx.xx - - [04/Dec/2016:14:07:45 +0100] "GET /admin/index.php HTTP/1.1" 200 5957 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"
xx.xx.xx.xx - - [04/Dec/2016:14:07:45 +0100] "GET /admin/css/style.css HTTP/1.1" 403 15 "http..../admin/index.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"
xx.xx.xx.xx - - [04/Dec/2016:14:07:45 +0100] "GET /admin/css/demo.css HTTP/1.1" 403 15 "http..../admin/index.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"
xx.xx.xx.xx - - [04/Dec/2016:14:07:45 +0100] "GET /admin/css/animate-custom.css HTTP/1.1" 403 15 "http..../admin/index.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"
我迷失了我做错的事。 我对任何建议持开放态度。
感谢阅读。