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

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.35 - PHP 7.2.10/7.1.22/7.0.32/5.6.38 - MySQL 5.7.23 - MariaDB 10.3.9
Wampserver 3.1.3 64 bit - Apache 2.4.35 - PHP 7.2.10/7.1.22/7.0.32/5.6.38 - MySQL 5.7.23 - MariaDB 10.3.9
PhPMyadmin 4.8.3 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.35 - PHP 7.2.10/7.1.22/7.0.32/5.6.38 - MySQL 5.7.23 - MariaDB 10.3.9
Wampserver 3.1.3 64 bit - Apache 2.4.35 - PHP 7.2.10/7.1.22/7.0.32/5.6.38 - MySQL 5.7.23 - MariaDB 10.3.9
PhPMyadmin 4.8.3 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.35 - PHP 7.2.10/7.1.22/7.0.32/5.6.38 - MySQL 5.7.23 - MariaDB 10.3.9
Wampserver 3.1.3 64 bit - Apache 2.4.35 - PHP 7.2.10/7.1.22/7.0.32/5.6.38 - MySQL 5.7.23 - MariaDB 10.3.9
PhPMyadmin 4.8.3 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »



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.