DNS lookup failure for:

user270301 asked:

I installed my server with virtualmin, and I am using apache with php fpm.
When I try to open my website I have this error :

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /index.php.

Reason: DNS lookup failure for:

After the “for:” it is empty

Here is my apache2 conf file for this site :

<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>

Thanks

My answer:


The format of your SetHandler directive to pass to a UNIX domain socket is wrong.

It should read as shown in the documentation:

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

Keep in mind you have placed it in two places in your configuration.

Also keep in mind that you may have other configuration problems which are not obvious here.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.