Wamp Virtual Host Error 502
Posted by: sombir_aricent (165.225.104.---)
Date: August 11, 2017 07:33AM


I am facing an issue when accessing when accessing wampserver 3.0.6 64bit virtual host.

Same is working when I connected on WiFi, but not working on LAN.

Getting 502 bad Gateway Error (DNS Error)

Following are my configurations :

--------- httpd.conf ------------

Listen [::0]:82

ServerName localhost:82

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

--------- httpd-vhosts.conf ------------

<VirtualHost *:82>
ServerName localhost
ServerAlias localhost
DocumentRoot "D:/wamp/www"
<Directory "D:/wamp/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Allow from all
Require all granted

<VirtualHost *:82>
ServerName mysite.local
DocumentRoot "D:/wamp/www/test"
<Directory "D:/wamp/www/test/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Allow from all
Require all granted

------------etc/hosts----------- localhost mysite.local

::1 localhost
::1 mysite.local

After all these changes i have restarted all wamp servies, but no luck.

[localhost] this URL is working fine but the below virtual host is not working

[mysite.local] Getting error 502 bad gateway, i also tried to access url like [mysite.local] but no luck again.

DNS error

DNS error (the host name of the page you are looking for does not exist)

Please check that the host name has been spelled correctly.

Any help will be appreciated.

Thanks in Advance.

Options: ReplyQuote
Re: Wamp Virtual Host Error 502
Posted by: RiggsFolly (Moderator)
Date: August 11, 2017 09:18PM


Start by removing this line

Allow from all

That is old Apache 2.2 syntax and does not mix well with the equivalent Apache 2.4 syntax which is
Require all granted

Also dont make localhost `Require all granted`, leave that as `Require local`

(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote

Sorry, only registered users may post in this forum.