DNS 查找失败:

DNS 查找失败:

我使用 virtualmin 安装了服务器,并使用带有 php fpm 的 apache。当我尝试打开我的网站时,出现此错误:

代理错误

代理服务器从上游服务器收到无效响应。代理服务器无法处理请求 GET /index.php。

原因:DNS查找失败:

“for:”之后是空的

以下是我为该站点创建的 apache2 conf 文件:

<VirtualHost xx.xx.xx.xx:80>
SuexecUserGroup "#1005" "#1005"
ServerName test.fr
ServerAlias www.test.fr
ServerAlias mail.test.fr
ServerAlias webmail.test.fr
ServerAlias admin.test.fr
DocumentRoot /home/test/public_html
ErrorLog /var/log/virtualmin/test.fr_error_log
CustomLog /var/log/virtualmin/test.fr_access_log combined
ScriptAlias /cgi-bin/ /home/test/cgi-bin/
ScriptAlias /awstats/ /home/test/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/test/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
</Directory>
<Directory /home/test/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.test.fr
RewriteRule ^(.*) https://test.fr:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.test.fr
RewriteRule ^(.*) https://test.fr:10000/ [R]
RemoveHandler .php
RemoveHandler .php7.0
<Files awstats.pl>
AuthName "test.fr statistics"
AuthType Basic
AuthUserFile /home/test/.awstats-htpasswd
require valid-user
</Files>
<FilesMatch \.php$>
#SetHandler proxy:fcgi://localhost:8000
SetHandler proxy:fcgi:///var/run/154262472926263.sock
</FilesMatch>
</VirtualHost>
<VirtualHost xx.xx.xx.xx:443>
SuexecUserGroup "#1005" "#1005"
ServerName test.fr
ServerAlias www.test.fr
ServerAlias mail.test.fr
ServerAlias webmail.test.fr
ServerAlias admin.test.fr
DocumentRoot /home/test/public_html
ErrorLog /var/log/virtualmin/test.fr_error_log
CustomLog /var/log/virtualmin/test.fr_access_log combined
ScriptAlias /cgi-bin/ /home/test/cgi-bin/
ScriptAlias /awstats/ /home/test/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/test/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
</Directory>
<Directory /home/test/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.test.fr
RewriteRule ^(.*) https://test.fr:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.test.fr
RewriteRule ^(.*) https://test.fr:10000/ [R]
RemoveHandler .php
RemoveHandler .php7.0
SSLEngine on
SSLCertificateFile /home/test/ssl.cert
SSLCertificateKeyFile /home/test/ssl.key
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
<Files awstats.pl>
AuthName "test.fr statistics"
AuthType Basic
AuthUserFile /home/test/.awstats-htpasswd
require valid-user
</Files>
<FilesMatch \.php$>
#SetHandler proxy:fcgi://localhost:8000
SetHandler proxy:fcgi:///var/run/154262472926263.sock
</FilesMatch>
</VirtualHost>

谢谢

答案1

SetHandler传递给 UNIX 域套接字的指令的格式错误。

它应该显示如下内容文档

SetHandler "proxy:unix:/var/run/154262472926263.sock|fcgi://localhost/"

请记住您已将其放置在配置中的两个位置。

还请记住,您可能遇到这里不明显的其他配置问题。

相关内容