Problems with virtual hosts..??
Posted by: angelleye (---.kc.res.rr.com)
Date: July 26, 2014 01:13PM

I've just installed WAMP on a new computer (D:/Program Files/wamp/) and for some reason I'm struggling to get virtual hosts to work.

If I leave vhosts disabled in httpd.conf then I can load [localhost] (or any other domain that points to my IP) just fine and I get to the WAMPServer Homepage as expected.

If I simply go into httpd.conf and uncomment the virtual host line to enable it...

Include conf/extra/httpd-vhosts.conf

Then everything becomes 403 Forbidden. I can't load localhost or any vhost I configure in my httpd-vhosts.conf file. Here's what I currently have in that file...

<VirtualHost *:80>
DocumentRoot "D:/Program Files/wamp/www"
ServerName localhost
<Directory "D:/Program Files/wamp/www">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Allow from 127.0.0.1
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "D:/Websites/paypal-glass/public"
ServerName paypal-glass.angelleye.com
ErrorLog "logs/paypal-glass.angelleye.com-error.log"
CustomLog "logs/paypal-glass.angelleye.com-access.log" common
<directory "D:/Websites/paypal-glass">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Allow from all
</directory>
</VirtualHost>

Any information on what I'm missing here would be greatly appreciated. Thanks!

Options: ReplyQuote
Re: Problems with virtual hosts..??
Posted by: angelleye (---.kc.res.rr.com)
Date: July 26, 2014 03:12PM

Ok, well, I found another guide (the only one out of many) that shows an additional step I've never needed to do before (I've always used Zend Server in the past.)

I added this at the top of my httpd-vhosts.conf file...

<Directory D:/Websites>
Require all granted
</Directory>

With that, everything works now as expected, but I'm curious why this is necessary and why I've never needed it before..?? Is it safe, or is there a better way?

I guess I thought the <Directory> element included within the <VirtualHost> elements would be granting me the permission I need.

Any info would be great. Thanks!

Options: ReplyQuote
Re: Problems with virtual hosts..??
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: July 27, 2014 08:27PM

That should really go in here

<VirtualHost *:80>
    DocumentRoot "D:/Websites/paypal-glass/public"
    ServerName paypal-glass.angelleye.com
    ErrorLog "logs/paypal-glass.angelleye.com-error.log"
    CustomLog "logs/paypal-glass.angelleye.com-access.log" common
    <directory "D:/Websites/paypal-glass">
        Options Indexes FollowSymLinks
        AllowOverride all
        Require local 
    </directory>
</VirtualHost>

Use
'Require local'
if you are just testing
Use
'Require local
Require ip 192.168.1'
if you want local and the internal network (asssuming your subnet starts with 192.168.1)

Use
'Require all granted'
if you want the whole world to get access.


PS
See the Apache manual, In Apache 2.4 the access control statements changed [httpd.apache.org]

---------------------------------------------------------------------------------------------
(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: Problems with virtual hosts..??
Posted by: angelleye (---.kc.res.rr.com)
Date: July 27, 2014 11:11PM

Ah, gotcha. The statement changes seem to be what threw me. I've got it working the way I expected now. Thanks!

Options: ReplyQuote


Sorry, only registered users may post in this forum.