【问题标题】:I get error 503 after upgrading to http 2升级到 http 2 后出现错误 503
【发布时间】:2021-09-26 20:13:58
【问题描述】:

升级到http 2.0后,老是报错503,谁能帮我解决一下?

错误日志:

[Mon Jul 19 11:03:26.351473 2021] [mpm_event:notice] [pid 9022:tid 140512076250176] AH00493: SIGUSR1 received.  Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Mon Jul 19 11:03:26.407467 2021] [mpm_event:notice] [pid 9022:tid 140512076250176] AH00489: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Jul 19 11:03:26.407479 2021] [core:notice] [pid 9022:tid 140512076250176] AH00094: Command line: '/usr/sbin/apache2'

在 /etc/apache2/mods-enabled 我看到 http2.conf(如果我是对的)

通过 mod_macro 虚拟主机:

<Macro VHost $dir $domain>
<VirtualHost *:443>
    Protocols h2 http/1.1
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/my.crt
    SSLCertificateKeyFile /etc/ssl/private/my.key

    AccessFileName .htaccess
    DocumentRoot $dir/$domain/httpdocs/

    ErrorLog $dir/$domain/error.log

    ServerName $domain
    ServerAlias www.$domain

    <Directory />
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    <Directory $dir/$domain>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
        Require all granted
    </Directory>
</VirtualHost>
</Macro>

更新:域错误日志

[Mon Jul 19 12:47:06.338104 2021] [proxy:error] [pid 18649:tid 140511882213120] (13)Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock (*) failed
[Mon Jul 19 12:47:06.338133 2021] [proxy_fcgi:error] [pid 18649:tid 140511882213120] [client 127.0.0.1:51542] AH01079: failed to make connection to backend: httpd-UDS
[Mon Jul 19 12:47:06.519092 2021] [proxy:error] [pid 18649:tid 140511882213120] (13)Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock (*) failed
[Mon Jul 19 12:47:06.519108 2021] [proxy_fcgi:error] [pid 18649:tid 140511882213120] [client 127.0.0.1:51542] AH01079: failed to make connection to backend: httpd-UDS, referer: https://s2019/
[Mon Jul 19 12:47:12.305094 2021] [ssl:warn] [pid 9022:tid 140512076250176] AH01906: s2019:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jul 19 12:47:12.305103 2021] [ssl:warn] [pid 9022:tid 140512076250176] AH01909: s2019:443:0 server certificate does NOT include an ID which matches the server name

感谢您的帮助!

【问题讨论】:

    标签: apache2 http2 http-status-code-503


    【解决方案1】:

    如果你遇到同样的情况,我希望它会有所帮助。我需要做的就是:

    打开/etc/php/&lt;version&gt;/fpm/pool.d 并替换值

    listen.owner = www-data
    listen.group = www-data
    

    /etc/apache2/envvars中的数据

    export APACHE_RUN_USER=someuser
    export APACHE_RUN_GROUP=someuser
    

    结果将是:

    listen.owner = someuser
    listen.group = someuser
    

    最后需要重启fpmsudo service php&lt;version&gt;-fpm start

    顺便说一下,php-fpm 版本可能与您的php 版本不同。例如,输入 php -v 会显示 7.4。但是

     <?php phpinfo();
    

    现在显示 8.0。所以我不得不选择这个目录/etc/php/8.0/fpm/pool.d

    【讨论】:

      猜你喜欢
      • 2021-03-02
      • 2013-09-07
      • 2020-01-19
      • 2014-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-23
      • 2013-11-04
      相关资源
      最近更新 更多