Apache在服务器出现问题时停止所有服务器

Apache在服务器出现问题时停止所有服务器,apache,Apache,我对Apache比较陌生,遇到了一个问题,即当其中一个出现问题时,所有虚拟服务器都会被停止。我们遇到了一个问题,导致后端服务(testing.my domain name.ch)无法进行测试,并导致502错误,apache为我们的生产设施()提供了相同的错误,尽管它仍在运行(通过使用wget进行验证) 我的httpd.conf文件如下所示: ServerRoot "/etc/httpd" PidFile run/httpd.pid Timeout 120 KeepAlive

我对Apache比较陌生,遇到了一个问题,即当其中一个出现问题时,所有虚拟服务器都会被停止。我们遇到了一个问题,导致后端服务(testing.my domain name.ch)无法进行测试,并导致502错误,apache为我们的生产设施()提供了相同的错误,尽管它仍在运行(通过使用wget进行验证)

我的httpd.conf文件如下所示:

ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
Listen 0.0.0.0:80
Include conf.modules.d/*.conf  # Everything in conf.d is at default values
User apache
Group apache
ServerAdmin root@localhost
ServerName test.my-domain-name.ch:80
UseCanonicalName Off
#
<Directory />
    Options FollowSymLinks
    AllowOverride none
    Require all denied
</Directory>

DocumentRoot "/var/www/html"

<Directory "/var/www">
    AllowOverride None
    Require all granted
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>
#
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
#
<Files ".ht*">
    Require all denied
</Files>

ErrorLog "logs/error_log"
LogLevel warn

<IfModule log_config_module>
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog "logs/access_log" combined
</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    TypesConfig /etc/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    #
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>

AddDefaultCharset UTF-8

<IfModule mime_magic_module>
    MIMEMagicFile conf/magic
</IfModule>

EnableSendfile on
IncludeOptional conf.d/*.conf # Everything in conf.d is at default values

<VirtualHost *:80>
    ServerName my-domain-name.ch
    Redirect permanent / https://www.my-domain-name.ch/
</VirtualHost>

<VirtualHost *:80>
    ServerName production.my-domain-name.ch
    ServerAlias www.my-domain-name.ch
    DocumentRoot /var/www/node/prod/production

    SSLProxyEngine on
    ProxyPass /account/ https://www.account-server.com/account/ retry=1
    ProxyPassReverse /account/ https://www.account-server.com/account/
    ProxyPass /oauth2/ https://www.account-server.com/oauth2/ retry=1
    ProxyPassReverse /oauth2/ https://www.account-server.com/oauth2/

    ProxyPass / http://localhost:3001/ retry=1 Keepalive=on
    ProxyPassReverse / http://localhost:3001/

    CustomLog logs/access_log_production "%v %h %l %u %t \"%r\" %>s %b production"

    <Directory /var/www/node/prod/production>
        AllowOverride All
    </Directory>

</VirtualHost>

<VirtualHost *:80>
        ServerName test.my-domain-name.ch
        DocumentRoot /var/www/node/test/testing

        SSLProxyEngine on
        ProxyPass /account/ https://www.account-server.com/account/ retry=1
        ProxyPassReverse /account/ https://www.account-server.com/account/
        ProxyPass /oauth2/ https://www.account-server.com/oauth2/ retry=1
        ProxyPassReverse /oauth2/ https://www.account-server.com/oauth2/

        ProxyPass / http://localhost:3000/ retry=1 Keepalive=on
        ProxyPassReverse / http://localhost:3000/

        CustomLog logs/access_log_staging "%v %h %l %u %t \"%r\" %>s %b staging" 

      <Directory /var/www/node/test/testing>
              AllowOverride All
     </Directory>

</VirtualHost>
anybod可以帮助我理解如何配置当一个虚拟主机宕机时,其他虚拟主机不会宕机的情况吗


非常感谢。

Nic3500-感谢您的回答:


只要所有配置都在同一文件中,就不能在同一进程下运行。如果您想要有一个测试设置,它应该在一个单独的Apache配置下。您可以在同一台计算机上运行两个具有不同配置的实例,只要两个实例不使用相同的端口。或者设置一个VM,您可以将测试配置(或docker,或…)放入其中。您可以在重新启动之前运行apache-t来检查配置。

您不能,只要所有配置都在相同的文件中,并且在相同的进程下运行。如果您想要有一个测试设置,它应该在一个单独的Apache配置下。您可以在同一台计算机上运行两个具有不同配置的实例,只要两个实例不使用相同的端口。或者设置一个VM,您可以将测试配置(或docker,或…)放入其中。您可以运行apache-t来检查您的配置,然后再重新启动它。
[Mon Sep 07 11:47:35.784583 2020] [proxy_http:error] [pid 46205] [client 10.19.65.68:44942] AH01114: HTTP: failed to make connection to backend: localhost
[Mon Sep 07 11:47:46.049988 2020] [proxy:error] [pid 46206] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:3000 (localhost) failed