virtual host error
Posted by: Chukwura (197.211.56.---)
Date: July 26, 2016 08:42AM

I use Windows 10 Pro, Version 64; Apache2.4.18; PHP Version 5.6.19; MySQL Version 5.7.11. The color of the Wampserver icon is Green.

I am creating a virtual host but at this point got this error: "The number of <Directory or </Directory> does not match the number of ServerName in c:/wamp/bin/apache/apache2.4.18/conf/extra/httpd-vhosts.conf file".

Please I 'd appreciate any help to solve this becaues I have checked the file and did not notice the error.

Chuks



Edited 1 time(s). Last edit at 07/26/2016 09:49AM by Otomatic.

Options: ReplyQuote
Re: virtual host error
Posted by: RiggsFolly (Moderator)
Date: July 26, 2016 09:48AM

Hi,

Can you show us your httpd-vhosts.conf file please.

---------------------------------------------------------------------------------------------
(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: virtual host error
Posted by: Chukwura (197.211.57.---)
Date: July 27, 2016 04:46PM

<VirtualHost *:8080>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "c:/wamp/www/project1"
ServerName project1
<Directory "c:/wamp/www/project1">
AllowOverride All
Require local
</Directory>
</VirtualHost>

Options: ReplyQuote
Re: virtual host error
Posted by: Chukwura (197.211.57.---)
Date: July 27, 2016 05:14PM

<VirtualHost *:8080>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "c:/wamp/www/project1"
ServerName project1
<Directory "c:/wamp/www/project1">
AllowOverride All
Require local
</Directory>
</VirtualHost>

Options: ReplyQuote
Re: virtual host error
Posted by: Otomatic (Moderator)
Date: July 27, 2016 05:27PM

Hi,

A priori there is no error.
However:
- VirtualHost were not created by WampServer
- ServerAlias localhost is useless
- Why use port 8080 ?
- There must always be a blank line at the end of the Apache configuration files. This applies to the conf files and also for .htaccess files

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

Options: ReplyQuote
Re: virtual host error
Posted by: Chukwura (197.211.57.---)
Date: July 27, 2016 06:03PM

Please, I don't understand what you mean by "VirtualHost were not created by Wampserver"
Moreover, I used port 8080 because Microsoft IIS is using port 80 and efforts I made to disable it proved abortive.
I now understand that ServerAlias to be localhost is a misnomer, it should bear a different name, and that I should always add a blank line at the end of the Apache configuration file

Options: ReplyQuote
Re: virtual host error
Posted by: Otomatic (Moderator)
Date: July 27, 2016 06:17PM

Hi,

>Please, I don't understand what you mean by "VirtualHost were not created by Wampserver"
With Wampserver 3. there is the possibility to create VirtualHost with three Clicks.
- Wampserver homepage -> Create VirtualHost link
and, the VirtualHost created by Wampserver is :

#
<VirtualHost *:80>    or used port number
	ServerName localhost
	DocumentRoot "c:/wamp"
	<Directory  "c:/wamp/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>
>I used port 8080 because Microsoft IIS is using port 80 and efforts I made to disable it proved abortive.
Point n°08 of TROUBLESHOOTING TIPS

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.