How to add public virtual host in Apache 2.4 with WAMP
Posted by: jacman (40.86.95.---)
Date: December 06, 2016 07:14PM

I have an Apache 2.4 server that handles two virtual host on port 8080, one is private and a second one is public. The private virtual host works fine but the public keeps redirecting all public requests to the localhost and I'm not sure what I'm doing wrong. Please help! Below is the httpd-vhost.conf file:

# Virtual Hosts

<VirtualHost *:8080>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:8080>
ServerName mydomain.com
DocumentRoot c:/wamp64/www/App
<Directory "c:/wamp64/www/App/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
DirectoryIndex index.html index.php
</VirtualHost>
#

Is there anything wrong with this file or should I be looking at the host file in windows server 2012?

Options: ReplyQuote
Re: How to add public virtual host in Apache 2.4 with WAMP
Posted by: RiggsFolly (Moderator)
Date: December 06, 2016 09:26PM

Hi

By public do you mean it should be visible to anyone on the internet?

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



Edited 1 time(s). Last edit at 12/06/2016 09:26PM by RiggsFolly.

Options: ReplyQuote
Re: How to add public virtual host in Apache 2.4 with WAMP
Posted by: jacman (40.86.95.---)
Date: December 07, 2016 06:54PM

Hi Riggs - yes please, available to the internet. I read some of your articles but for some reason is not working for me. Thanks a lot for your help!

Options: ReplyQuote
Re: How to add public virtual host in Apache 2.4 with WAMP
Posted by: RiggsFolly (Moderator)
Date: December 07, 2016 09:39PM

Start by reading this THE NEED for VIRTUAL HOSTS

---------------------------------------------------------------------------------------------
(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: How to add public virtual host in Apache 2.4 with WAMP
Posted by: jacman (40.86.95.---)
Date: December 08, 2016 10:54PM

Got all that covered from the article you sent and still no access from the internet. the 'Require all granted' defeats the purpose of sub-folders because when I change the VirtualHost of the localhost to Require all granted, I get access to the WAMPSERVER located at 'www' from the internet but not to the 'www/app' sub-folder as I get 'Forbidden Access' code 403. My question is how could this happen? I know is not port 8080/firewall or server blocking it. I think the problem resides in the Apache Server or WampServer. Any suggestions
P.S. Also, can the WampServer interpret SubDomains like myapp.gameportal.mydomain.com or could this be the problem?



Edited 2 time(s). Last edit at 12/08/2016 11:18PM by jacman.

Options: ReplyQuote
Re: How to add public virtual host in Apache 2.4 with WAMP
Posted by: RiggsFolly (Moderator)
Date: December 09, 2016 12:35AM

Hi

When done properly it works. I know this as I use it myself.

There is nothing wrong with WAMPServer as in fact that would be saying that there is something wrong with Apache the most used web server in the world.

So it is just a case of working out what has been done wrong.

While we are always willing to help, remember that WAMPServer is provided free of charge for the purposes of you learning how to use Apache/MySQL & PHP. It is not a simple utility like an editor and installation does not come with all the knowledge requred to use it or its many many features and configurations.

The last issue I solved for a user, in a very similiar area, was all down to incorrect usage of a Dynamic DNS Service. So be aware that there are many areas where mistakes can be made.

---------------------------------------------------------------------------------------------
(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: How to add public virtual host in Apache 2.4 with WAMP
Posted by: pitties4 (---.dsl.spfdil.ameritech.net)
Date: December 20, 2016 04:35PM

Just went thru this myself. Take a look at my post and see if it helps.

[forum.wampserver.com]

Just change things to fit your domain.

Options: ReplyQuote


Sorry, only registered users may post in this forum.