Network Setup Guide - localhost to IP

Network Setup Guide - localhost to IP

Complete Instructions for LAN IP Configuration (172.16.16.200)

i About This Guide

  • Step-by-step instructions to set up Gate Register on office network
  • Configure XAMPP to use LAN IP: 172.16.16.200 Your Server IP
  • Access Gate Register from any computer on the same network
  • Includes firewall configuration, auto-start setup, and troubleshooting

📌 Server PC Information:

• IP Address: 172.16.16.200

• Port: 80

• Access URL: http://172.16.16.200/gate_register/inout.php

• XAMPP Installation: C:\xampp

• Project Folder: C:\xampp\htdocs\gate_register\

1 Find Your Server PC's IP Address

Open Command Prompt and run the following command to find your IPv4 address:
ipconfig
Look for IPv4 Address under your active connection (Wi-Fi or Ethernet).
Expected output: 172.16.16.200 (as shown in your ipconfig)

2 Configure XAMPP Apache to Use LAN IP

Open XAMPP Control Panel → Apache → Config → httpd.conf

📁 File Location: C:\xampp\apache\conf\httpd.conf

Find these lines (around line 45-50 and 100-105) and change them:

Listen 172.16.16.200:80
ServerName 172.16.16.200:80
Save the file (Ctrl+S) and restart Apache from XAMPP Control Panel.

3 Configure Windows Firewall

Method 1: Using Command Prompt (Run as Administrator)
netsh advfirewall firewall add rule name="Apache HTTP Server" dir=in action=allow protocol=TCP localport=80
Method 2: Using Windows Firewall GUI

1. Press Windows + R, type firewall.cpl and press Enter

2. Click Inbound RulesNew Rule

3. Select Port → Next

4. Select TCP → Specific local ports: 80 → Next

5. Select Allow the connection → Next

6. Check all three boxes (Domain, Private, Public) → Next

7. Name: Gate Register Apache → Finish

4 Update Database Configuration (config.php)

Open C:\xampp\htdocs\gate_register\config.php and update the database host:
$db_host = '172.16.16.200';
Complete config.php example:
<?php
$db_host = '172.16.16.200';
$db_user = 'root';
$db_password = '';
$db_name = 'gate_register';

$conn = mysqli_connect($db_host, $db_user, $db_password, $db_name);

if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
?>

5 Set Network Profile to Private

Windows Settings → Network & Internet → Ethernet/Wi-Fi → Click on connected network → Set Network profile to Private

⚠️ Important: Network must be set to "Private" to allow other computers to connect.

6 Test on Server PC

Open Chrome browser and enter:
http://172.16.16.200/gate_register/inout.php

✅ If the page opens, the server is configured correctly.

✅ Also test: http://localhost/gate_register/inout.php (should also work)

7 Create Auto-Start Batch File (Server PC)

Create a batch file to automatically open Gate Register on startup:
@echo off
timeout /t 5 /nobreak >nul
start chrome http://172.16.16.200/gate_register/inout.php
exit
Save as gate_register.bat and place in Startup folder:
Press Windows + R → type shell:startup → paste the batch file there.

8 Set XAMPP to Start Automatically

Configure XAMPP to start with Windows:

1. Open XAMPP Control Panel as Administrator

2. Click on Config (top right corner)

3. Check Autostart for Apache

4. Click Save

5. Also install Apache as Windows service: Click on Apache → Install Service

9 Access from Another PC (Client)

On the client PC, open Chrome and enter the server URL:
http://172.16.16.200/gate_register/inout.php

✅ Client Requirements:

• Must be on same network (172.16.16.x)

• No installation needed - just a web browser

• Can access from any device (Windows, Mac, Android, iPad)

10 Create Desktop Shortcut on Client PC

Right-click Desktop → New → Shortcut → Location:
http://172.16.16.200/gate_register/inout.php
Name: Gate Register → Finish
To change icon: Right-click shortcut → Properties → Change Icon → Browse → Select an icon

11 Troubleshooting

🔧 If Client PC cannot connect:

Test 1: Ping the server - ping 172.16.16.200

Test 2: Check client IP - run ipconfig - must start with 172.16.16.x

Test 3: Temporarily disable firewall on server to test

Test 4: Restart XAMPP Apache

Test 5: Check if Apache is listening: netstat -an | find ":80"

Test 6: Verify httpd.conf has Listen 172.16.16.200:80

ping 172.16.16.200
netstat -an | find ":80"

12 Access from Mobile/Tablet

On any device connected to the same Wi-Fi network, open browser and enter:
http://172.16.16.200/gate_register/inout.php

📱 The interface is responsive and works on mobile devices!

Summary Checklist

  • ☐ Found server IP address (172.16.16.200)
  • ☐ Changed Apache Listen to 172.16.16.200:80 in httpd.conf
  • ☐ Changed Apache ServerName to 172.16.16.200:80 in httpd.conf
  • ☐ Restarted Apache from XAMPP Control Panel
  • ☐ Added Windows Firewall rule for port 80
  • ☐ Updated config.php with $db_host = '172.16.16.200'
  • ☐ Set network profile to Private
  • ☐ Tested on server: http://172.16.16.200/gate_register/inout.php
  • ☐ Client PC on same network (172.16.16.x)
  • ☐ Client PC can access the URL
  • ☐ Created shortcut on client desktop
  • ☐ (Optional) Set XAMPP to auto-start with Windows

🎉 Once completed, the Gate Register will be accessible from any computer on your office network!

Access URL: http://172.16.16.200/gate_register/inout.php

Admin Credentials: Username: Admin | Password: Admin

📞 Support Information:

• Phone: 9463116032

• Website: www.libauto.in

• Email: support@libauto.in

Post a Comment

0 Comments