WAMPServer 3 Create a Virtual Host -Problem
Posted by: johandut (196.7.68.---)
Date: May 11, 2018 02:18PM

I have followed the steps as decribed in WAMPServer 3 Create a Virtual Host, the easy way"", but when I click on the virtual host created, the page is not displayed with the error "This page cannot be displayed". Reason: UNKNOWN
Notification: DNS_FAIL.

I also included this virtual host to my hosts file. What can the problem be.

Options: ReplyQuote
Re: WAMPServer 3 Create a Virtual Host -Problem
Posted by: Otomatic (Moderator)
Date: May 11, 2018 02:48PM

Hi,

Please : READ (and answer) BEFORE YOU ASK A QUESTION

Have you performed:
Right-click -> Tools -> DNS Restart

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: WAMPServer 3 Create a Virtual Host -Problem
Posted by: RiggsFolly (Moderator)
Date: May 11, 2018 02:50PM

Hi,

Ok so show us your httpd-vhosts.conf file and you HOST file as well as the question and answer requested by Oto

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

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 databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: WAMPServer 3 Create a Virtual Host -Problem
Posted by: johandut (196.7.68.---)
Date: May 11, 2018 03:16PM

Hi

Yes I restarted the entire PC

httpd-vhost.conf

<VirtualHost *:81>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:81>
DocumentRoot "c:/wamp64/www/HTA"
ServerName hta.site
<Directory "c:/wamp64/www/HTA/public">
AllowOverride All
Require local
</Directory>
</VirtualHost>

hosts file
127.0.0.1 localhost
127.0.0.1 hta.site

::1 localhost
::1 HTA.nhls

Regards



Edited 1 time(s). Last edit at 05/11/2018 03:37PM by johandut.

Options: ReplyQuote
Re: WAMPServer 3 Create a Virtual Host -Problem
Posted by: Otomatic (Moderator)
Date: May 11, 2018 03:36PM

Hi,

Unlike what you wrote, this shows that you did not create your VirtualHost through the tools built into Wampserver.
The domain names in the hosts file MUST be the same for IPv4 and IPv6.

Why are DocumentRoot and Directory different?
Why do you use port 81?
How did you define it as a port for Apache?

And you didn't answer READ (and answer) BEFORE YOU ASK A QUESTION

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: WAMPServer 3 Create a Virtual Host -Problem
Posted by: johandut (196.7.68.---)
Date: May 11, 2018 03:46PM

Hi

I have used the option ""Use other port than 80" to amend the port. I am usimng port 81 as port 80 is used by Skype.


I was told the landing page (use Laravel) is in public thus the reason for different DocumentRoot and Directory


I follwed the manual route as the tools in WampServer gave me the the error "The first VirtualHost must be localhost in c:/wamp64/bin/apache/apache2.4.33/conf/extra/httpd-vhosts.conf file"

What I dont understand is that Localhost is the first VirtualHost



Edited 2 time(s). Last edit at 05/11/2018 03:50PM by johandut.

Options: ReplyQuote
Re: WAMPServer 3 Create a Virtual Host -Problem
Posted by: Otomatic (Moderator)
Date: May 11, 2018 04:26PM

Hi,

> I am usimng port 81 as port 80 is used by Skype.
Port 80 is the port reserved for the HTTP protocol, i.e. Apache. If another application want to use port 80, it is up to that application to change port, not Apache.
Point 03 of TROUBLESHOOTING TIPS

> I was told the landing page (use Laravel) is in public thus the reason for different DocumentRoot and Directory
You need to read the Apache documentation about DocumentRoot and Directory.
If you declare a DocumentRoot "c:/wamp64/www/HTA", when you give the ServerName in a browser, the browser will go to the DocumentRoot, not to Directory.

What is the result of Right-Click -> Tools ->
- 1 - Check httpd.conf syntax
- 2 - Test port 81
- 3 - Show VirtualHost examined by Apache

hosts file MUST be
127.0.0.1 localhost
::1 localhost

127.0.0.1 hta.site
::1 hta.site

And you didn't answer READ (and answer) BEFORE YOU ASK A QUESTION

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 05/11/2018 04:40PM by Otomatic.

Options: ReplyQuote


Sorry, only registered users may post in this forum.