vhosts break remote access to sites
Posted by: SuperTech (---.44.233.25.res-cmts.hzl2.ptd.net)
Date: April 01, 2015 07:19AM

my vhost.conf file looks like this:

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

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/ACT30PerDay-1"
ServerName ACT30PerDay-1
<Directory "c:/wamp/www/ACT30PerDay-1">
AllowOverride All
</Directory>
</VirtualHost>

I am anable to access the default www since it is set to require local however if vhosts.conf is enabled I also am unable to access the second site remotely as well. Both sites can be accessed if I disable the vhosts.conf in httpd.conf

I followed the setup in the forums but do not know what the issue is. Any help is very appreciated.

Options: ReplyQuote
Re: vhosts break remote access to sites
Posted by: RiggsFolly (---.as43234.net)
Date: April 01, 2015 01:58PM

Hi Super,

Each VHOST is treated as a unique domain, so you need to add the instructions to tell Apache who is allowed to connect via each vhosted domain.

So chnage your second vhost definition to

<VirtualHost *:80>
    DocumentRoot "c:/wamp/www/ACT30PerDay-1"
    ServerName ACT30PerDay-1
    <Directory "c:/wamp/www/ACT30PerDay-1">
        AllowOverride All
        Require local
        # maybe add access allowed from local networked PC's on your subnet
        Require ip 192.168.0
    </Directory>
</VirtualHost>

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


Sorry, only registered users may post in this forum.