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.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.6 32 bit - Apache 2.4.51 - PHP 8.0.11…5.6.40 - MySQL 5.7.35 - MariaDB 10.5.12/10.6.4
Wampserver 3.2.6 64 bit - Apache 2.4.51 - PHP 8.0.11…5.6.40 - MySQL 5.7.35/8.0.26 - MariaDB 10.5.12/10.6.4
PhPMyadmin 5.1.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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>

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.6 32 bit - Apache 2.4.51 - PHP 8.0.11…5.6.40 - MySQL 5.7.35 - MariaDB 10.5.12/10.6.4
Wampserver 3.2.6 64 bit - Apache 2.4.51 - PHP 8.0.11…5.6.40 - MySQL 5.7.35/8.0.26 - MariaDB 10.5.12/10.6.4
PhPMyadmin 5.1.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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.2.5 32bit & 64bit)
<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.