I currently use Apache on my machine to test PHP websites locally. I was just wondering how I can allow computers connected to my local network to access the website hosted on my local machine.
Machines on your local network should be able to access your machine, if only by IP (assuming you don't have a firewall blocking port 80 (HTTP).
Once that's done, you can setup Virtual Hosts in your httpd.conf (look at the very bottom, there should be some sample directives to get you started).
If you want the machines to be able to access multiple different websites on your machine, then you'll need to create local/fake domain names in your VirtualHost setup and also spoof the dns in their .hosts files (c:\windows\system32\drivers\etc\hosts on windows machines).
Essentially what you'll be doing is telling their machines that the website www.testsite.local can be reached at the ip address x.x.x.x, and then your VirtualHost directives will tell apache that the website www.testsite.local can be found at /home/user/public_html/
Providing you enabled the settings during the initial configuration, it should just be a case of entering the IP address of the computer hosting Apache into a web browser on another computer. Check that the ports are open and no firewalls are blocking the application.
© 2022 - 2024 — McMap. All rights reserved.