dov11020 2019-02-20 16:00
浏览 182

Apache在所有页面上发送“找不到文件”

I'm using Laravel and when I uploaded the project to the server it returned 500, 503 and other types of errors. Because I'm using Virtualmin I checked the error_log in /var/log/virtualmin and I found that php-fpm hadn't enabled. So I enabled that and get File not found error on all pages now!

So I added ProxyErrorOverride on into /etc/httpd/conf/httpd.conf file but then got Not Found The requested URL /index.php was not found on this server. I commented it and added <FilesMatch \.php$> SetHandler "proxy:fcgi://127.0.0.1:9000" </FilesMatch> but again it returned File not found.

Then I went into /etc/php-fpm.d/www.conf and edited this part from ;chroot = to chroot = /home/mysite/public_html/public. But no result :(

UPDATE

I don't have any .htaccess file in root folder but in public folder and inside this I have:

<IfModule mod_rewrite.c>
    Options +SymLinksIfOwnerMatch

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

UPDATE 2

Screenshot of error

UPDATE 3

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

from this:

user = apache
group = apache

to this:

user = php-fpm
group = php-fpm

from this:

listen = 127.0.0.1:9000
;listen = /run/php-fpm/www.sock

to this:

;listen = 127.0.0.1:9000
listen = /run/php-fpm/www.sock

and vice-versa.

from this:

listen.owner = apache
listen.group = apache

to this:

listen.owner = php-fpm
listen.group = php-fpm

from this:

;listen.acl_users = apache,nginx

to this:

listen.acl_users = apache,nginx

from this:

;listen.allowed_clients = 127.0.0.1

to this:

listen.allowed_clients = any

from this:

;chroot = /

to this:

chroot = /home/mysite/public_html

from this:

;chdir = /

to this:

chdir = /public

Sorry I said each one separately because I did it with various changes, each one may be varied on each time on changing values.

and now the Error is:

Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

and my error_log:

[Thu Feb 21 02:58:13.318048 2019] [proxy:error] [pid 4170] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9000 (127.0.0.1) failed
[Thu Feb 21 02:58:13.318146 2019] [proxy:error] [pid 4170] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s
[Thu Feb 21 02:58:13.318155 2019] [proxy_fcgi:error] [pid 4170] [client 69.689.30.21:64560] AH01079: failed to make connection to backend: 127.0.0.1

PLEASE HELP ME

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示
    • ¥15 求三国群英传pl国战时间的修改方法
    • ¥15 matlab代码代写,需写出详细代码,代价私
    • ¥15 ROS系统搭建请教(跨境电商用途)
    • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。