Hi Batman
This one interested me, I have never seen the need to use my PC's ComputerName as a domain name in the browser but I have seen people wondering why they cannot do that.
So here are my finding :-
1. Anything you put in the browser is going to be treated as a domainname and an attempt will be made to convert that name to an actual IP address using local or remote DNS lookup.
2. When I use 'http://MyComputerName` in the browser I get the error
-- Forbidden You don't have permission to access / on this server.
3. Now this is a pretty standard error and normally means that Apache is saying I am not allowed to accept connections from the IP address trying to connect to me.
This made me think, well what is the ip address of that domain name so I did a ping on it
--> ping MyComputerName
---Result-- Pinging MyComputerName [fe80::54c8:d12f:6bf1:f6ce%10] with 32 bytes of data:
--> ping /4 MyComputerName
---Result-- Pinging MyComputerName [192.168.2.11] with 32 bytes of data:
Ok so now we know what ip address the browser is getting from some DNS somewhere. This has to be local to my PC as these addresses are both part of the Private Network address space. ( i.e. cannot be routed over the internet) which is why I dont need to pbfiscate them in this reply.
4. So now its obvious.
-- We have not told Apache that it is allowed to accept connections from these addresses.
-- By default WAMPServer is configured as a local development tool. In other words to protect the beginner from
-- themselves the httpd.conf file is configured like this
<Directory "c:/wamp/www/">
## comments removed for brevity
Options Indexes FollowSymLinks
AllowOverride all
# onlineoffline tag - don't remove
Require local
</Directory>
Now
Require local is Apache 2.4 speak for
Only this machines loopback addresses.
-- So only these few ip addresses
127.0.0.1 (ipv4 loopback address)
::1 (ipv6 loopback address)
and
localhost which of course is defined in the hosts file on both 127.0.0.1(ipv4) and ::1(ipv6)
So boil all that down and we get.
You have not told Apache it is allowed to be connect to by the ip address of the MyComputerNameSo to change Apache to allow this I would add the following to httpd.conf, well actually I would not bother, but you might.
I originally considered adding the ip addresses to the list but then I thought why not use the `hosts` option.
Edit httpd.conf as follows
<Directory "c:/wamp/www/">
## comments removed for brevity
Options Indexes FollowSymLinks
AllowOverride all
# onlineoffline tag - don't remove
Require local
Require host MyComputerName
</Directory>
And then Apache allowed my in to my WAMPServer homepage
---------------------------------------------------------------------------------------------
(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 --
phpMyAdminGet 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 3 time(s). Last edit at 06/24/2015 05:45PM by RiggsFolly.