You are on page 1of 2

These are the steps to follow when you want your PHP application to be installed on a LAN

server (not on web)

1. Get the internal IP or Static IP of the server (Ex: 192.168.1.193)


2. Open XAMPP>apache>conf>httpd.conf file in notepad
3. Search for Listen 80
4. Above line would read like- #Listen 0.0.0.0:80 / 12.34.56.78:80
5. Change the IP address and replace it with the static IP
6. Save the httpd.conf file ensuring that the server is pointed to #Listen 192.168.1.193:80
7. In the application root config.php (db connection) replace localhost with IP address of the
server

Note: If firewall is installed, ensure that you add the http port 80 and 8080 to exceptions and
allow to listen. Go to Control Panel>Windows Firewall>Allow a program to communicate
through windows firewall>Add another program Name: http Port: 80 Add one more as http -
8080

If IIS (Microsoft .Net Application Internet Information Server) is installed with any Microsoft
.Net application already on server, then it would have already occupied 80 port. In that case
change the #Listen 192.168.1.193:80 to #Listen 192.168.1.193:8080

This should be all you need for a basic setup

This kind of configuration doesn't break phpMyAdmin on localhost

A static IP is recommended on the device running the server

This example uses the 192.168.1.x IP. Your network configuration might use a different IP

In the httpd.conf in Apache you should have:

# Listen: Allows you to bind Apache to specific IP addresses and/or


# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
I would leave blank the name so it gets the defaults:

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#

Allow the guest machines and yourself. As a security caution, you might avoid Allow from all
but instead use specific guest IP for example Allow from 192.168.1.xxx where xxx is the guest
machine IP. In this case you might need to consider static IPs on guest machines also

# Controls who can get stuff from this server.


#
# Require all granted
# onlineoffline tag - don't remove
Order Deny,Allow
# Deny from all
Allow from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
Allow from 192.168.1.*YOURguestIP*
Allow from 192.168.1.*YOURselfIP*
</Directory>

You might also like