Cannot Access VirtualHost created in WAMP
Posted by: 0000WAMP (223.187.91.---)
Date: September 10, 2021 02:52PM

Virtual Host definition
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


#
<VirtualHost *:80> (My Virtual Host)
ServerName something.inc
ServerAlias www. something.inc
DocumentRoot "c:/wamp64/www/home"
<Directory "c:/wamp64/www/home/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


I can access something.inc from my localmachine (localhost) on my server computer but can't access it from my mobile through i can access wamp server homepage from my mobile through my ip address.I cannot access it through the servername (something.inc) but if I access it through 192.168.*.*/Home (I have kept the project files under wamp64/www/Home directory, it displays the customised 404 | NOT FOUND page. How to resolve this issue and access my sites through it's server name over LAN?.Also I cannot use othe listen ports other than 80 even if I have defined them as Apache listen ports.I use WAMP v 3.2.3.

Any Help will be greatly help me

Options: ReplyQuote
Re: Cannot Access VirtualHost created in WAMP
Posted by: Otomatic (Moderator)
Date: September 10, 2021 03:18PM

Hi,

RiggsFolly explain this on Stackoverflow

With Wampserver, you MUST add a listen port by:

Right-Click -> Tools -> Add a Listen Port to Apache

Then you can create your VirtualHost with the Add a VirtualHost page.

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

Options: ReplyQuote
Re: Cannot Access VirtualHost created in WAMP
Posted by: 0000WAMP (157.41.126.---)
Date: September 10, 2021 04:03PM

I have added 3 ports:81,8081,43172 as Apache Listen ports but when I use any of these ports instead of 80 in my virtual host, there occurs an error: port 81 or 8081 is not an Apache defined variable.

Options: ReplyQuote
Re: Cannot Access VirtualHost created in WAMP
Posted by: Otomatic (Moderator)
Date: September 10, 2021 05:15PM

Hi,

Did you add the ListenPorts through the built-in Wampserver tool?
Right-Click -> Tools -> Add a Listen Port to Apache

If Yes, you must see them in Right-Click -> Tools… … … Listen Ports: 80 81 8081 43172

In VirtualHosts, listening ports other than 80 should not be added numerically, but as an Apache variable, which is what the Add VirtualHost tool does.
<VirtualHost *:${MYPORT43172}>
  ServerName mysite
  .....
  ....
</VirtualHost>

#
<VirtualHost *:${MYPORT8081}>
  ServerName myothersite
  ...
  ...
</VirtualHost>

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

Options: ReplyQuote
Re: Cannot Access VirtualHost created in WAMP
Posted by: 0000WAMP (106.222.145.---)
Date: September 10, 2021 05:23PM

It works but I can't access this virtual host on another computer (when I use 192.168.*.*/Home)
Dispalys: 404 | Not Found (A customised error page in my website)



Edited 2 time(s). Last edit at 09/10/2021 05:50PM by 0000WAMP.

Options: ReplyQuote
Re: Cannot Access VirtualHost created in WAMP
Posted by: 0000WAMP (106.207.91.---)
Date: September 10, 2021 05:45PM

When I click on the servername(something.inc on my mobile) which redirects to the same page as 192.168.*.*
It Displays:
This Site Can't Be Reached
something.inc's DNS address could not be found. Diagnosing the problem
DNS_PROBE_POSSIBLE

Options: ReplyQuote
Re: Cannot Access VirtualHost created in WAMP
Posted by: RiggsFolly (Moderator)
Date: September 13, 2021 04:27PM

Do you mean you are launching the WAMPServer homepage on your Phone? That of course wont work as all those links are based upon being on the PC running WAMPserver so from the phone they dont work.

Can you show us the newly created Virtual Host definition, (it should have changed if you re did the process again properly) better still the whole httpd-vhosts.conf file again 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


Sorry, only registered users may post in this forum.