First, I already searched stack overflow and followed the suggestions in previous answers, such as How do I connect to this localhost from another computer on the same network?
I have created a PHP/MySQL application for a client. The want to host it locally on that server.
The machine in question is running an application written in another langauge (I’m not sure which one) and running Tomcat on port 8080.
They also do not have separate staging/production environments, so this is not ideal.
Their other web application needs to remain running while I also port over the new app. I installed XAAMP onto their system and got the app running locally using Apache HTTP. However, they want other computers both within and outside their networks to be able to connect to the Windows server as well. They are already doing this for the previously created app that is running on Tomcat.
Ports 80 and 8080 are already being used, so the firewall was updated to allow my application to run on port 8086.
I used ipconfig to the find the local IPv, and then tried updating the http.conf and vhost file and am listening to the IP on port 8086. However, going to the IP/foldername doesn’t resolve on another computer in the network. As a test, I also just typed in the IP of the windows machine, and it never resolves.
I generally don’t implement of windows; until now, all of my production applications have run on some flavor of unix. Their other application is live and I don’t want to disturb it. They access it by going to {servername}:8080. I tried server:8086 to see if my app could be accessed that way, but it can’t.
I confirmed that localhost/foldername resolves.
Here are the exact steps that I have taken. I tried two different solutions.
Solution 1, using How do I connect to this localhost from another computer on the same network? as a guide:
-
Make sure firewall allows port 8086 access
-
I modified the C:xamppapacheconfextrahttpd-vhosts.conf file to include a virtual host for the application:
DocumentRoot “C:/xampp/htdocs/{foldername}”
ServerName dispatchserver -
Went to the Windows host file located at Windowssystem32driversetchosts and added the following:
192.xxx.x.xx dispatchserver -
From a computer outside the network, tried to go to the following URLs (non resolved):
Since they didn’t work, I tried a solution using this older stack overflow answer: Accessing localhost (xampp) from another computer over LAN network – how to?
-
Made sure firewall allows port 8086 access
-
XAMPP control panel > Config > Service and Port Settings > Apache > Changed main port to 8086.
-
XAMPP control panel > Apache > Config > http.conf
-
Searched for “Listen 80” and replaced with Listen 8086
-
Right above that, added Listen 192.xxx.x.xx:8086 (I used the IPv4, but don’t want to include full address for security reasons). I added this line with hashtag at first (#192.xxx.x.xx:8086) and then without hastag after that didn’t work (192.xxx.x.xx:8086).
-
Searched for and set this up as the directory statement:
AllowOverride All
Require all granted -
Restart Apache
What steps can I take to allow the new webapplication I installed via XAMPP to be accessible to other computers?
2
Answers
Normally you just need to open the ports in the windows firewall on both computers (inbound and outbound) for the ports your application is using and then connect to the other machine via ip address and port number if they are on the same network.
In that case it’s a little different if you want to web enable this. You need to set up your router to port forward to your server (app)so that the other network can reach it from the internet. Your router blocks incoming requests by default so a port forwarding rule using the port you mentioned will work. You should also put your server computer (the one with the app) on a static ip address to make things easier. Then for the user to see your app you need to give them the ip address of your internet connection (seen via sites like ipchicken.com) and the port number in the url.