Accessing server from local intranet
Posted by: Exastify (---.mit.edu)
Date: July 31, 2013 04:15AM

Hi, I have a setup using WAMP on a very primitive local intranet. I am getting a "Forbidden You don't have permission to access /test on this server" error from the client laptop, but not from the server laptop.

Server laptop is running WAMP, connected wirelessly to a Tenda wireless router. The router is not connected to the internet. A client laptop is also connected to the router wirelessly.

Router is running in DHCP mode, with IPs kept for 1 week. My server laptop has the IP 192.168.0.100, while the client laptop has the IP 192.169.0.101.

I have a folder called "test" in my www folder, inside is just a hello world HTML file. On the server, accessing localhost/test works great. On the client, I get the Forbidden error.

At first I thought this was a WAMP issue, so I searched and did all the posted solutions such as modifying the alias file for allow from all, modifying http conf file to 0.0.0.0:80, etc etc but nothing worked.

Now I'm thinking it's my router, but it seems to be setup properly. I have port forwarding setup so that port 80 gets forwarded to 192.168.0.100 (the server). Note that the router is not connected to a modem/internet.

Any ideas? Thanks!

Options: ReplyQuote
Re: Accessing server from local intranet
Posted by: RiggsFolly (---.as13285.net)
Date: July 31, 2013 10:09AM

First you dont need port forwarding setup if you just want to have access from inside your router i.e your local network. Setting port forwarding has in fact let the universe into your local network so if you didnt intend this turn it off.

Second, make the pc running WAMP have a static ip address. Routers normally have a small range of numbers that are used by the DHCP server, in your case it looks like 100 to maybe 150. Its on one of the configuration pages. So set you server pc to have a static ip address outside that range used by DHCP.
There are hundreds of tutorials on the net to show you how to setup a static ip on windows.

To allow access to your test website you need to tell apache that some ip addresses are allowed to access it. By default wamp sets apache's config to only allow 'localhost', '127.0.0.1', '::1' which are all actually alias's for THIS PC ONLY.
To allow other pc's on your internal network to access it you need to change :-

httpd.conf

Find this line
# onlineoffline tag - don't remove

Depending on the version of WAMP you have installed what follows that line will be different so if you see

Order Deny,Allow
Deny from all
Allow from 127.0.0.1

Change it to

Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
Allow from 192.168.0


The line 'Allow from 192.168.0' says allow anybody coming from my local network ( any ip ) to access apache


Or it may say

Require local

So change that to

Require local
Require ip 192.168.0

To achieve the same thing. The reason for the difference is that Apache 2.4 changed the syntax for allowing access to itself.




Now if youwant to allow remote ( from your internal network ) access to phpmyadmin you will have to do this

Edit C:\wamp\alias\phpmyadmin.conf You should see a similiar syntax to the above so make a similiar change to that security setting as well.





Hope I covered everything.

Options: ReplyQuote
Re: Accessing server from local intranet
Posted by: Exastify (---.hfc.comcastbusiness.net)
Date: August 01, 2013 05:58PM

Thanks! Setup router with port forwarding and DHCP, and adjust the permissions in httpd.conf. Works great!

Options: ReplyQuote
Re: Accessing server from local intranet
Posted by: erwindelrosario (202.90.149.---)
Date: May 29, 2014 12:44PM

hi, sir...i just want to ask. i had the same problem with regards my local intranet. i haveset up a wamp server with my 2 laptop (one server and one client) connected with a linksys router. now i made some changes just like the one you have explain here..but the thing is i cannot connect with mysql...pls help error i got is " USER-PC CANNOT CONNECT WITH MYSQL..."

*NOTE: USER-PC IS THE NAME OF THE CLIENT LAPTOP I HAVE"

Options: ReplyQuote
Re: Accessing server from local intranet
Posted by: RiggsFolly (---.as13285.net)
Date: May 29, 2014 01:19PM

How are you trying to connect with the MySQL on the other PC?

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