0

I went thru all the tutorials here but none could solve my issue.

I have a site on localhost example.localhost.com WAMP in my computer which I want to access from my laptop which is connected to my PC/computer via modem.

I put WAMP online, edited the httpd.conf file and added the following

<Directory>
Allow from 192.168.1.3
</Directory>

Note: 192.168.1.3 is the IPv4 address of my Laptop

Then I edited the hosts file in my laptop and added the following in the bottom most

192.168.1.3       example.localhost.com

Still, nothing seems to work and I am still unable to access my site example.localhost.com.

Just sharing, I also have WAMP installed in my laptop. I started the server but also no effect then.

KBD
  • 43
  • 1
  • 9
  • Do you really mean the 2 PC's are connected via a MODEM? Or do you mean the 2 PC's are connected on a local network using a Router? – RiggsFolly Oct 28 '14 at 09:35
  • Sorry my words were a bit vague. Yeah, 2 PCs are connected on a local network using a Router. – KBD Oct 28 '14 at 11:52

1 Answers1

0

First when you change the HOSTS file on your laptop, you need to add the ip address of the PC running Apache and not the ip address of the laptop

So assuming the PC running Apache is 192.168.1.2 then on the laptop you would change the hosts file to

192.168.1.2  example.localhost.com

The

<Directory>
Allow from 192.168.1.3
</Directory>

Can be removed, it is doing nothing anyway as it does not actually identify any directory that you are attempting to give access to.

You dont say in which folder you have put your example website, but if you want it to work when the laptop user enters example.localhost.com into the browser then you should create a Virtual Host so Apache knows where to server the site from and who has access to it .

This post should help you create a Virtual Host properly and define the access rights to it in the correct way and in the correct place.

Create Virtual Hosts in WampServer

Community
  • 1
  • 1
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149