access xampp server from other PC over LAN - php

I just downloaded the latest XAMPP version installed it on my new PC.
however I cannot access the local webserver via browser(Google Chrome) from another PC on my LAN.
I allowed MySQL and Apache through my Firewall.
setup a static IP on my server PC. (192.168.1.130)
I also changed the configuration of httpd.conf file
from
<Directory />
AllowOverride none
Require all denied
</Directory>
to
<Directory />
AllowOverride All
Require all denied
</Directory>
then I restarted apache.. still cannot access it via IP or Computer name.

Okay so after tons of searches, I finally found an answer, here's what I did..
Go into the Windows Firewall settings and click the "Advanced" button, and in the next dialog click "Inbound Rules" - click "New Rule"
In the rule type window, choose Port
In the program window, leave All Programs selected
In protocols and ports, leave protocol as TCP, and Local Ports should be "Specific Ports", enter 80,443
In the scope window, don't enter any specific ip addresses
In the action window, Allow the Connection
In the profile window, leave them all ticked
And finally, in the name, call it something useful, like HTTP_ports
credits to this link

Related

WampServer 3.2.3 cant access Lan Network,

i cant access my wampserver machine, this is my specifications
windows 10
wampserver 3.2.3.3 64bits
Apache 2.4.46
i have edited this file "D:\Programs\wamp64\bin\apache\apache2.4.46\conf\extra\httpd-vhosts.conf",
and replaced "Require local" to "Require all granted", below is the complete text in the file
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
and i have restarted all the services, but i cant access the server from other machine connected to the same network
The ip machine that has wampserver is "192.168.1.11", so in the other computer i entered in the browser that ip "192.168.1.11" and keeps loading about 4 minutes and stops.
can anybody help, is there something else i have to do?, thanks in advance
I have found the solution and Wampserver was not the problem.
The problem is the Windows 10 firewall that was blocking the network access.
so these are the steps to allow the network access:
1.- In windows 10 go to Menu "Firewall and network Protection"
2.- click on "Allow an app through firewall" option, it opens a window with title "allowed apps"
3.- Click on button "Change Settings" (You have to have administrator rights to do this)
4.- Click on "Allow another app", and browse to your wamp installation and search for httpd.exe of apache, in my case "D:\Programs\wamp64\bin\apache\apache2.4.46\bin\httpd.exe", and click on button add "Add"
5.- and in the columns "Private and Public", check the checkbox for "Public" column and last click on button "Ok" at the bottom of the window
6.- Now you can access to Wampserver Homepage from another machine in the same network
This works but it is strange, because i didnt have to do these steps with wamp early versions
Hope this help to others with the same problem

WAMP is not responding to external requests

Installed WAMPServer
Version : 3.0.4
OS type : 64 bit
Apache : 2.4.18
PHP : 5.6.19 / 7.0.4 (5.6.19 checked)
MySQL : 5.7.11
I've tried to look at the older overflow questions and answers and tried to do along as they said, however, I still do not have any connection to the wampserver.
What I've done to test
Use localhost on the host laptop to check if wampserver is operational
[SUCCESS]
Use my IP on host to check if wampserver is operational [SUCCESS]
Use my IP on other devices on the network in attempt to access a php file of the server in a directory. [FAILED]
Use other devices to on the network to ping my host [Request timed out x4]
Use tracert command as an alternative to 4 [Request timed out]
What I've done to the server
Modification to httpd.conf
Listen 12.34.56.78:80//commented
Listen 0.0.0.0:80
Listen [::0]:80
Dynamic Shared Object (DSO) Support//commented
miscellaneous for LOAD MODULE
ServerName localhost:80
Deny access to the entirety of your server's filesystem. You must
explicitly permit access to web content directories in other
blocks below.
Directory//This directory tag has no reference to server
AllowOverride All
Require all granted
Directory
DocumentRoot "E:/Server/wamp64/www"
Directory "E:/Server/wamp64/www/"
Options Indexes FollowSymLinks
AllowOverride All
# onlineoffline tag - don't remove
Require all granted
Directory
What I've done to the host laptop
Fresh installation of WAMP
Backup original httpd.conf
Edited httpd.conf (Refer above)
[FAILED]Added rule for port 80 to enable all - Deleted
Disable all rules for inbound for port 80
Look for rules in outbound for port 80 [NONE]
All of the steps I've described does not work at all. Has no experience in firewall configuration and WAMP configuration. And no virtual hosts except localhost
P/S: The example link I tried testing was 1.1.1.1/testPHP/testPHP.php. The host is Win10 while the device on the similar network tested was XP. Any advice is greatly appreciated.
The apache configuration seems correct.
Check this if you're using Wifi on server or client
Check if the router/AP has enabled something called Wifi Isolation, or Client Isolation.
I looked on a similar router like yours and there it's one option called Client Isolation on the Wireless Basic setup of your router. Uncheck it, save and retry.
Check this on the Windows firewall
Press on your keyboard WindowsKey+R, write control.exe. Press enter
Double click on Windows Firewall
On the left vertical bar select Advanced Settings
Click Inbound Rules
On the right pane click New Rule...
Select Port and click Next button
On the top leave TCP option selected. And below select Specific local ports and write there 80 or the port your apache uses. Looking to your Listen line on the apache config you should write here 80. Press Next
Leave selected Allow the connection and press Next.
Select the profiles of the Firewall you want to use for this rule. If you doubt select all. Press Next
Set a name for the rule, and press Finish
Try it another time ;-)
Found the problem. Win 10 apparently had this setting I have had forgotten about - Make this PC discoverable (OFF)
I turned it off in the heydays of using Win 10 because of privacy concerns. Now it can be accessed. The next step is to figure out the forbidden access.
Edit
The culprit for this post is the Windows 10 OS Settings. In order for all the settings to work (Assuming the person has done all the tinkering with httpd.conf and firewall and/or router), the PC hosting the server must be checked whether is the PC discoverable in the network settings.
How to make sure it is discovered
Open Network Settings by left clicking the network icon on your taskbar (either lan or WiFi) then click Network Settings right above the bottom most icons.
Select Advanced Settings
Under the item Make this PC discoverable, there will be a switch button. Make sure the button is turned ON otherwise, left click on that particular button.

How to access my Wamp Server on another Local Computer

How can i access my local wamp server on another computer
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
i use this code in http.config file but not work
You could simply use the Put Online option of your WAMP Server and you can use this current system IP address and to directly access from the other computer.
Do this on system tray
Then, you could find your IP address using typing ipconfig or whatismyip.com website and then access it on another system.
As you are able to access it from the local computer that run the server by http://localhost you have two options to access it from your local area network LAN:
Using the local IP of the computer for example: http://192.168.1.20
Using the computer name for example: http://computer1/
To know your current IP:
Start -> in search field write cmd and hit enter to open the command line -> in the command line write: ipconfig you will get something like that:
Your computer IP address is the value of IPv4 Address.
To know your computer name just right click on the computer icon in the start menu then choose properties to get this screen shot:
However, for computer name method you have to be sure that every computer in your LAN has a unique name.
Update
There are some routers firmware supports local DNS on the router, so you have not need to edit the hosts files for every machine in the network. For example that I already have, dd-wrt firmware on Linksys WRT54G:
Mine wasn't working before when I tried using my computer's IP in the URL.
I found the reason to be the line in httpd.conf:
ServerName localhost:80
which I updated to be
ServerName {My comp's IP}:80
Step 1 : Press window button + R at the same time which opens the run tool of Windows.
Step 2 : Write CMD, then press 'Enter' button. This operation opens CMD terminal.
Step 3 : Then write 'ipconfig' command
Step 4 : Then note your ipv4 Address : 192.168.x.x (From Wireless Lan Adapter Wi-Fi Header) (This Ip address is needed by other computers in the place of localhost in URL)
Step 5 : Go to phpmyadmin.conf file of hosting system(Where wamp is installed...File path -> C:\wamp\alias\phpmyadmin.conf)
Step 6 : Replace this statement
<ifDefine APACHE24>
Require local
</ifDefine>
<ifDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from localhost ::1 127.0.0.1
</ifDefine>
with
Require local
Require ip 192.168.0
Note : (If your Ip is something like 192.147.x.x) then you write 'Require 192.147.0' instead of 'require 192.168.0')
Step 7 : Restart your Wamp server
Step 8 : Enter the link 192.x.x.x/phpmyadmin in the url bar of your own system from which you want to access the hosting wamp server
Step 9 : End.
If you just need to access the wamp server from another LAN PC, as some of the answers have pointed out, you can use the LAN IP or Computer-Name in the URL, as long as VirtualHost's ServerName or ServerAlias directive contains that LAN IP or Computer-Name (so Apache can return the correct website).
But if you need to use a domain-name, you'll have to edit every PC's Hosts file and update it with the correct domain-name to LAN IP address resolve (and make sure that LAN IP is assigned each time to the correct device by the Router).
Though there are much better solutions that will work for all devices (including Mac, Linux, mobile devices such as iPhones, Android phones, etc) if you have a WiFi Router that can either be flashed with one of the open firmwares or is already capable of DNS Masquerading as outlined here: Accessing Websites on a Local Network (LAN) Web Server. "DNS Masquerading" (in this context) is basically using the WiFi Router's own "Hosts file" to do the domain-name to LAN IP resolve.
Hope this helps
I couldn't connect event after doing all the above-mentioned steps. Then I uninstalled my current wampserver (3.0 version) and installed 2.5 version of wampserver. And it worked perfectly. You just need to click on 'Put Online' and you are done. Others can access your server by putting your ip address in the URL instead of localhost.
stop the wamp server and open C:\wamp64\bin\apache\apache2.4.41\conf\extra\httpd-vhosts.conf
replace
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
add
Require all granted
above the Directory closing tag.
Then turn off the windows firewall for [domain, private,
public] networks in my case only [private network] works
Re-Start wamp server

Am able to access site via my IP, but not localhost anymore

I'm working on a wordpress website installed on my box using WAMP, so I've always typed in 'localhost' into the address bar in order to access the site.
I've always had the apache rewrite module enabled
I then had the idea of allowing people on our LAN to access the site via my LAN IP.
To do this I edited this line of Apache's httpd.conf file (per instructions on this page http://www.sourcecodester.com/tutorials/php/5155/how-access-wampserver-another-computer-lan.html) :
# 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
(I changed 'Deny from all' to 'Allow from all')
Saved the file,
accessed my box via IP on an iPad mini, then another windows PC.
Come back to the machine that is running WAMP and I'm developing the site on, click one of the navigation links on the page, then I get the 500 Internal Server Error
So I can now only see the wamp menu and the site by typing my own IP in. Some images aren't loaded, and I get Error 500 when trying to login by typing my IP with '/wp-admin' after it (meaning that I can't log in to wordpress to edit anything either)
What is the problem here? I really need to be able to access 'localhost' and continue developing the website, but I can not figure this one out!
Thank you
Try to access localhost/your-wp-dir-path/wp-admin/options-general.php and in
WordPress Address (URL) option give value as http://localhost/your-wp-dir-path

Virtual not working in other system wamp

Virtual host not working in the NETWORK
I just followed this site tutorial,
Virtual host steps
The tutorial was excellent but when I try this alias URL in another system, its not working. I have checked in my other system, I am able to see my application, after I did these changes I am not able to see my application on the other system.
I have even changed Allow from 127.0.0 to all but that is not working.
My C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf
This what I added
<VirtualHost *:80>
ServerAdmin webmaster#developertalk
DocumentRoot "C:/wamp/www/developertalk"
ServerName developertalk
ServerAlias www.developertalk
ErrorLog "logs/developertalk-error.log"
CustomLog "logs/developertalk-access.log" common
<directory "C:/wamp/www/developertalk">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from all
</directory>
</VirtualHost>
When hitting URL in another system, getting following error:
Server not found
In my local host i am having 3 web application.
Due to above changes my local host other sites not working.
How to make it work other sites.
You need to use local DNS to say every PC in Your network, that You have on Your PC host 'myApp', also You can add to every client's hosts file something like myapp 192.168.1.2 where 192.168.1.2 Your static IP in network
For every computer you want to have access to http://developertalk, you need to edit the Hosts file in each one.
Located at (xp/win7): C:\Windows\System32\drivers\etc\
You need to add only 1 line on every computer.
(your static internal ip) www.developertalk
example:
192.168.1.71 www.developertalk
you can check your internal ip address on your windows by opening cmd and typing ipconfig.
Look for the IPv4 address under the Ethernet adapter Local Area Connection column.
If you don't request or assign a static internal IP to your computer, others will not be able to connect to http://developertalk which was forwarded to your old internal IP.
Egor Sazanovich has actually answered your question and provided you with extra information, so accept his instead of this one, if this helped at all.

Categories