Reputation: 108
I have four windows PCs wirelessly connected to a local network and I want to host my PHP website on a server so that all PCs connected to the server can access web applications via an IP address.
Upvotes: 1
Views: 6369
Reputation: 39
At first connect the PCs in network using router.
here is diagram
_____________
| Router | Router IP 10.0.0.2
| |
-------------
; ; ; ;
; ; ; ;
; ; ; ;
; ; ; ;
; ; ; ;
; ; ; ;
; ; ; ;
_____________ _____________ ______________ ___________
| PC 1 | | PC 2 | | PC 3 | | PC 4 |
| | | | | | | |
------------- ------------- -------------- -----------
IP 10.0.0.2 IP 10.0.0.3 IP 10.0.0.4 IP 10.0.0.5
Server PC Client PC Client PC Client PC
This IP should
always be
static
Steps Below
Always use Ethernet connection for server pc to router connection
get the MAC address of server PC
in Router
Login into Server
Go to LAN Settings menu add the static IP 10.0.0.2 with server MAC address
Go to Port forwarding menu and forward port 80 and 8080 towards IP 10.0.0.2
in Server PC
Install apache server for PHP hosting
Go to httpd.conf file and find the code
AllowOverride All
#
# Controls who can get stuff from this server.
#
# Require all granted
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
Add this code below after "Allow from localhost
"
Allow from 10.0.0.2
Allow from 10.0.0.3
Allow from 10.0.0.4
Allow from 10.0.0.5
You can increase the client PC and add the IP into the server httpd.conf file
Now it is the time for celebrating
Upvotes: 2
Reputation: 18460
There is no much difference between hosting your server on local network or on external server it all come down to the following general steps:
Install your webserver e.g. Apache and ensure it has the php
extension active (default)
Make sure that your webserver binds to the correct IP (e.g. 192.168.1.xx or 0.0.0.0 to be accessible from outside the network)
Make sure that the firewall (both on the server and client) allows the communication (IP and port)
Upvotes: 0