[closed with workaround] Have 64 bit running correctly, installed 32 bit and getting errors trying to create a virtual host
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 20, 2016 09:10AM

I have WAMP 3 64 bit running correctly. It is installed in \wamp64

I downloaded and installed the 32 bit version in \wamp32

I forgot that I needed to enable the WAMP Virtualhost sub-menu before going to the Localhost page and clicking the Add Virtual Host link. The Add Virtual Host page told me to enable the sub-menu. I do so.

Then I went to the Localhost page it showed the following:

"Uncomment or add Include conf/extra/httpd-vhosts.conf in file wamp/bin/apache/apache2.4.17/conf/httpd.conf"

I went and editted the httpd.conf file and uncommented that line. I saved the file, and restarted the services.

I tried to get to the Localhost page (I using the icon and the Localhost menu item to get there) and I got:

"Forbidden

You don't have permission to access / on this server.
Apache/2.4.17 (Win32) PHP/5.6.15 Server at localhost Port 80"

I confirmed it is an HTTP 403 error via Firefox/Firebug - "NetworkError: 403 Forbidden - [localhost]; - in the network console.

If I recomment the httpd.conf line, save the file, and restart the services, I am able to get to the Localhost page.

If I uncomment the line again, save the file and restart the services, I get the 403 on the Localhost page.

I can consistently reproduce the 403 error by uncommenting the line and eliminate by commenting the line.

The Virtualhost sub-menu can show checked or not - it does not matter whether it is enabled or not.

The 403 error appears to be dependent upon the state of the line in httpd.conf:

#Include conf/extra/httpd-vhosts.conf

How do I get around error so that I can create virtual hosts on the 32 bit installation.

FYI -

I will not be running the 32 bit and the 64 bit at the same time, only one at a time.

They will share nothing - separate databases in the MySQL data directory and separate "projects" under the www directory.

I have tried installing WAMP 3 32 bit three times and continue to get the 403 error.

I tried the second install because I wanted to make sure I had not done anything which I had forgotten before trying to make a virtual host and un-installed and installed again because it looked like the symptoms had changed.

After installing the 32 bit version the third time, I am sure that I did nothing except what I describe above and that the problem in repeatable by flipping the line from commented to uncommented and back again.

The file I installed the 32 bit version from was downloaded on June 18, 2016 at 3:57 pm CDT (Central Daylight savings Time zone in the the USA) We are GMT-6 hours. That would have been 0957 GMT.

The file name is wampserver3_x86_apache2.4.17_mysql5.7.9_php5.6.15.exe

I scanned it for malware before executing it. Nothing was found.

The only difference I made in the installation was to put it in \wamp32 instead of \wamp and to name the Windows Start Menu folder Wampserver32 instead of Wampserver.

I created a directory under the \wamp32\www directory named bobroot and copied a web site into that directory.

Immediately after creating that project directory and copying in a working web site, I began to try to create a virtual host, as I describe above.

As I was trying to pin this problem done, and document it, I uncovered the error I posted about at [forum.wampserver.com] which is about the link on the Localhost for both 32 bit and 64 bit being [bobroot] instead of localhost/bobroot

But - unless these two problems are related, I don't want access projects via the localhost, I want to use virtual hosts.

I'm already doing so on the 64 bit version but I'm having the problem described above in trying to create virtual hosts on the 32 bit version.

What more information would you like to have?



Edited 1 time(s). Last edit at 06/22/2016 10:09PM by SimonT.

Options: ReplyQuote
Re: Have 64 bit running correctly, installed 32 bit and getting errors trying to create a virtual host
Posted by: Otomatic (Moderator)
Date: June 20, 2016 10:50AM

Hi,

On my system:
- J:\wamp64\bin\apache\apache2.4.20\conf\extra\httpd-vhosts.conf for Apache 64 bit
- J:\wamp\bin\apache\apache2.4.20\conf\extra\httpd-vhosts.conf for Apache 32 bit
both files contain exactly the same content, except for the first VirtualHost localhost
For 64 bit:
<VirtualHost *:80>
	ServerName localhost
	DocumentRoot J:/wamp64/www
	<Directory  "J:wamp64/www/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>
For 32 bit
<VirtualHost *:80>
	ServerName localhost
	DocumentRoot J:/wamp/www
	<Directory  "J:wamp/www/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>
Of course, since it is the same system, the hosts file is common and does not change between the 32 and 64 bit.
And both Wampserver versions are 3.0.4

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

Options: ReplyQuote
Re: Have 64 bit running correctly, installed 32 bit and getting errors trying to create a virtual host
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 20, 2016 11:42PM

The error I'm getting is well before I even get the chance to create a virtual host on the 32 bit version.

I turn on the virtualhost sub-menu

I uncomment the line #Include conf/extra/httpd-vhosts.conf in httpd.conf, restart the services and try to pull up the Localhost page -

I get a 403, Forbidden error.

As I said in my question about project file links [forum.wampserver.com], I'll update to the latest version. Then I will try this again.

I'll post a follow up here regarding the results of an attempt to create a virtual host after upgrading the 32 bit version.

Options: ReplyQuote
Re: Have 64 bit running correctly, installed 32 bit and getting errors trying to create a virtual host
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 21, 2016 04:17AM

I used the file wampserver3_x86_x64_update3.0.4.exe which I downloaded today, 2016-06-20 1734 CDT (GMT-6)

I scanned it for malware, none was found, and then I ran it and selected the \wamp32 directory where I had installed WAMP 3.0 32 bit

The About after the upgrade is:

WampServer Version 3.0.4 32bit
Created by Romain Bourdon
Maintainer / Upgrade to 2.5 by Herve Leclerc
Upgrade 2.5 to 3.0.0 by Otomatic (wampserver@otomatic.net)
Multi styles for homepage by Jojaba
Installer by Inno Setup
[forum.wampserver.com]
______________________ Versions used ______________________
Apache 2.4.17 - PHP 5.6.15 - MySQL 5.7.9
PHP 5.6.15 for CLI (Command-Line Interface)


I am still getting the same error when I try to create a virutalhost:

- I first enable the VirtualHosts sub-menu

- I then uncomment the line Include conf/extra/httpd-vhosts.conf in httpd.conf and save the file.

- I restart the services

- I try to go the the Localhost page by left clicking the WAMP icon and left clicking the Localhost menu item.

I get error message:


"Forbidden

You don't have permission to access / on this server.
Apache/2.4.17 (Win32) PHP/5.6.15 Server at localhost Port 80"


If I look at it with Firefox/Firebug debugger, it shows as:

"NetworkError: 403 Forbidden - [localhost];


I have WAMP 3.0.4 running correctly in the directory \wamp64. I have created virtual hosts without any problems and they work as they should.

But with WAMP 3.0.4 32 bit I get the Forbidden error when I try to go to Localhost after enabling the sub-menu and uncommenting the line in httpd.conf

If I re-comment the line in httpd.conf, I can then get to the Localhost page but still have the message telling me to uncomment the line in httpd.conf

Thus - uncommenting that line in httpd.conf causes the problem.

I can at least load the Localhost page whether the VirtualHost sub-menu is on or off.

Uncommenting the line causes the error, regardless of whether the VirtualHost sub-menu is on or off.

BY THE WAY - when I uncomment or re-comment the line in httpd.conf, I always restart the services after saving it and trying to get to Localhost..

Here is the Windows hosts file, all of the virtual host material was put in there by the WAMP 64 bit version
-------------------------

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost

127.0.0.1 bob
::1 bob

127.0.0.1 novell
::1 novell

127.0.0.1 justblog
::1 justblog



Here is the C:\wamp32\bin\apache\apache2.4.17\conf\extra\httpd-vhosts.conf file:
-------------------------------

# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:[httpd.apache.org];
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>



I have made no other changes to the Apache conf except for uncommenting and re-commenting the line Include conf/extra/httpd-vhosts.conf while trying to pin down the exact symptoms.

To repeat:

With the line #Include conf/extra/httpd-vhosts.conf in httpd.conf uncommented, I get:

"Forbidden

You don't have permission to access / on this server.
Apache/2.4.17 (Win32) PHP/5.6.15 Server at localhost Port 80"

The VirtualHosts sub-menu can be on or off - doesn't make any difference. Uncommenting that line causes the 403 error.

Where do I go from here?

Do you want to see the C:\wamp32\bin\apache\apache2.4.17\conf\httpd.conf file? I'll post it if you want to see it.

I'll post anything you want to see, just tell me what you need.

Options: ReplyQuote
Re: Have 64 bit running correctly, installed 32 bit and getting errors trying to create a virtual host
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 21, 2016 05:03AM

I made a virtual host manually by inserting this the http-vhosts.conf file:

# Novell 2016-06-20 2150 CDT (GMT-6) - copied from \wamp64 installatiion
# and directory was changed from \wamp64 to \wamp32
<VirtualHost *:80>
ServerName bob
DocumentRoot c:/wamp32/www/bobroot
<Directory "c:/wamp32/www/bobroot/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>


WIth the line Include conf/extra/httpd-vhosts.conf uncommented in httpd.conf, I can get to the site via the virtual host.


However - I can't get to the WAMP Localhost page - still getting 403 when the httpd.conf line is uncommented

With the line uncommeded and the Virutalhost sub-menu enabled, I see:" X Virtual Host ERROR" when I click or hover over the Your VirtualHost menu item

If I click on that line "X Virtual Host ERROR" a command line prompt window opens and displays:
---------------------------------------------------------
Sorry,

To have the VirtualHost, the line:

#Include conf/extra/httpd-vhosts.conf

must be uncommented in httpd.conf file

Switch cancelled

Press ENTER to continue...
----------------------------------------------------------

The bloody line is uncommented, I just checked it, restarted the servers, just to be safe, and clicked "X Virtual Host Host ERROR" again and get the command prompt window. If it weren't I could not use the virtual host named bob to get the the web site.

If I use the Show Virtual host examined by Apache under Tools, I get a command prompt window showing:

--------------------------------------------------------
AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host.example.com] does no
t exist
AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host2.example.com] does n
ot exist
VirtualHost configuration:

Default server: dummy-host.example.com
Virtual Host: dummy-host.example.com
Virtual Host: dummy-host2.example.com
Virtual Host: bob
*** WARNING: The name of the default server must be 'localhost'


--- Do you want to copy the results into Clipboard?
--- Type 'y' to confirm - Press ENTER to continue...
---------------------------------------------------------

Again, here is the http-vhosts.conf file:

---------------------------
# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:[httpd.apache.org];
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

# Novell 2016-06-20 2150 CDT (GMT-6) - copied from \wamp64 installatiion
# and directory was changed from \wamp64 to \wamp32
<VirtualHost *:80>
ServerName bob
DocumentRoot c:/wamp32/www/bobroot
<Directory "c:/wamp32/www/bobroot/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

--------------------------------


Any suggestions?

At least I can use the virtual host I created manually but I can't load the WAMP Localhost page - I get the 403 error.

Options: ReplyQuote
Re: Have 64 bit running correctly, installed 32 bit and getting errors trying to create a virtual host
Posted by: Otomatic (Moderator)
Date: June 21, 2016 02:59PM

Hi,

Quote

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

What is there in explanation : The need for Virtual Host ?
-- If this is the first time you edit this file, remove the default example code, it is of no use.

So why not let "Wampserver Add a VirtualHost" do all the work?
- It cleanses the http-vhosts.conf file
- It creates the VirtualHost localhost if not existing
- It creates your VirtualHost
- It checks the consistency of the total
and so on...

The content of your httpd-vhosts.conf must be :
<VirtualHost *:80>
  ServerName localhost
  DocumentRoot c:/wamp32/www
  <Directory "c:/wamp32/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

<VirtualHost *:80>
  ServerName bob
  DocumentRoot c:/wamp32/www/bobroot
  <Directory "c:/wamp32/www/bobroot/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>
and nothing else.

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

Options: ReplyQuote
Re: Have 64 bit running correctly, installed 32 bit and getting errors trying to create a virtual host
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 22, 2016 10:08PM

You miss the point:

As installed with the x86 package, the httpd-vhosts.conf file does not contain a defintion for localhost.

If I enabled the VirtualHost sub-menu and uncommented the include for httpd-vhosts.conf in httpd.conf file and then try to use the Add Virtual Host fuunctin, via the Localhost page, form the WAMP menu, I get a 403 error - I can't load the Localhost page.

I updated the 32 bit version to 3.0.4 as you suggested and things are as they were, I get the 403. There still is no definition for localhost in the httpd-vhosts.conf file.

If I make the httpd.conf file include a comment again, I don't get the 403,

You seem to be ignoring that - uncommenting the include for the httpd-vhosts.conf causes the problem, making it a comment eliminates the 403 but, of course, I can't use "Add Virtual Host"

We are getting no where with this, I'm going to un-install and then install 32bit 3.0.4 from the file wampserver3.0.4_x86_apache2.4.18_mysql5.7.11_php5.6.19-7.0.4.exe That should eliminate my problem.

I will mark this thread closed.

Options: ReplyQuote


Sorry, only registered users may post in this forum.