升级到 http 2 后出现错误 503

时间:2021-07-19 06:15:35

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

升级到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>

更新:域 error.log

[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

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

如果你遇到同样的情况,希望对你有用。我需要做的一切:

打开 private fun packagesLiveData(string: String): LiveData<List<Packages>> { Log.d(TAG, "switchMap: $string") return tvRepository .getUserPackage(string) .asLiveData() } 并替换值

/etc/php/<version>/fpm/pool.d

数据在 listen.owner = www-data listen.group = www-data

/etc/apache2/envvars

结果将是:

export APACHE_RUN_USER=someuser
export APACHE_RUN_GROUP=someuser

最后需要重启 fpm listen.owner = someuser listen.group = someuser

顺便说一下,php-fpm 版本可能与您的 php 版本不同。例如,输入 sudo service php<version>-fpm start 显示 7.4。但是

php -v

现在向我展示 8.0。所以我不得不选择这个目录 <?php phpinfo();