I don't think if it's possible, but I would like to bring my server temporarily online.
The thing is, I have been working on a PHP project lately from my home computer, and I need to show the progress to my follow team mates on their PC. Unfortunately I cannot go to them, but I wish if my website could.
We don't have a registered domain for it yet.
It's an APACHE v2.0 server installed, running PHP 5 and MySQL at the same time.
Is there some way I could possibly do that.
I heard some where that it's possible with Forwarding ports on DNS using static IP address or something like that. I am using Internet Connection using a HUWAEI Data Card Modem Model: E1550. Unfortunately, I cannot forward ports wit hit.
Any possibility I could share the website temporarily?
Why not just open up a free hosting account on a real good free host service like 000webhost, export your local database, upload your site to the remote host using ftp, then import your databases export file into the remote host's mysql and share the link to your site with your buddies?
That's what I do.
Install and set up Apache properly
Forward port 80 (or other, if you want) to your local IP, through your gateway settings
Register with your IP on DynDns.org or no-ip.org or something like that.
Edit: Well, you said "temporarily", you can just forward port 80 to your local IP and be happy with your "http://xxx.xxx.xxx.xxx/" but beware that it will change whenever you restart the router, or reestablish the connection.
What #MarkoD said, but until then -
If you have access to your router's firmware, you forward ports from there, not your actual PC. Just forward the port Apache is listening on, then put WAMP/XAMPP online.
Once it's online, share your IP and the port you chose with your team mates and they should be able to connect.
The link should look something like: http://111.111.111.111:2222.
For example, Cox Communications doesn't allow outgoing data on port 80 or 443, so use 8080
http://111.111.111.111:8080
If your ISP does, then just use 80 and drop the :xxxx.
Related
I want to make a php application and it must host in a computer and open from many branches of my schools using web.
I installed XAMPP on my pc server, and if i try to open the application in the same LAN network it works, but if i change the network it is not working.
The browser say that ip 192.168.1.22 take large time to load and not open.
how can i config that problem please
You need to set up a static IP on your machine, then set your router to forward ports so that all requests that come to your router on a particular port would be forwarded to your machine. This should do for testing purposes, but if you want to host a website for example you will need to get a permanent static IP for your router, this usually costs money from your ISP(internet service provider).
192.168.1.22 is your local IP address, you cannot access it from a different network. You can get your external IP address for example using whatismyip.com. Also, if you are behind a router, you have to open and forward the port which is used by your web server to your machine.
I have set up a websockets chat with the purpose of learning. Everything is working but I can't figure this issue out.
When I supply 127.0.0.1 as the address of the connection on the client side then I can access the server from the computer that's hosting it, but when I change the address to the actual LAN address of the hosting computer I can't connect the server even from the host itself. See:
Server = new FancyWebSocket('ws://127.0.0.1:9300'); Appears to work but only the computer that's hosting the server can connect ( for obvious reasons )
Server = new FancyWebSocket('ws://192.168.1.3:9300'); No computers can connect. I confirm 192.168.1.3 is the LAN address of the hosting computer.
What address do I need to put in there so that other computers from my local network can connect?
I solved the problem. Since it was a combination of two answers I thought the only fair thing to do was add another answer with an explanation.
As #Mehran suggested, I have had the server address set up as 127.0.0.1 instead of the network address. After changing that to 192.186.1.3 I was able to connect from the server itself, but other machines were unable to connect. Then I did the steps from the guide provided in #vtortola's answer to add a new inbound rule into the server's firewall in order to allow that port to be used.
So finally it all works now, thank you very much for helping me. +rep to everyone!
I'm pretty sure this is due to the configuration of your WebSocket server. It must be listening to localhost (127.0.0.1) to accept incoming connections in which case it won't answer to those aiming 192.168.1.3.
Since you didn't mention which server you are using I can not be specific but in general there are two ways to instantiate a listening socket, binding it to a specific IP address or * to bind whatever addresses system has. You need to configure the later if you intend to answer server connections coming from any computer within your LAN.
It looks like a Firewall/Policies issue to me.
IIS 7 Windows 2008, Localhost work but not local ip or external ip
Your TCP 80 could be allowed because the IIS installation will open it, that will explain why normal web browsing works. But you are trying to connect to the TCP 9300, that is very unlikely that is allowed by default.
Give a try to this: How to Open a Port in the Windows 7 Firewall , and allow that port.
Here are some things that you can safely assume while troubleshooting this issue:
If the service is able to work on 127.0.0.1 on the same machine, you can assume that the problem is not in the code or the PHP configuration
If you are not receiving an error when the server tries to bind to 192.168.1.3:9003 you can safely presume that the service is working. Try opening the Resource Monitor to see if it is actually listening on this port to confirm. To do so, go to 'Start Menu' in Windows and type 'Resource Monitor' in the 'Search programs and files' box. After opening the Resource Monitor, click the 'Overview' tab and find the name of the server process (typically 'php' if your using a CLI). With your process selected, switch over to the 'Network' tab and you will be able to see if it is listening on any ports within the 'TCP Connections' panel. This will show you what address and port it is listing on, as well as the remote address and port of any clients connected to the service.
If you know the server is running, and you know that it is actively listening on the expected address and port, it is very likely a firewall issue within Windows or your router. Note that even though 192.168.1.3 is the IP assigned to your interface, this is not a local IP and all communication to and from 192.168.1.3 will still go through the Windows firewall, including if being sent on the same machine. If your already at this point, I would strongly suggest checking your windows firewall first. If it is not the Windows firewall, check your router to see if it is blocking the port, and also check port forwarding and other setting to make sure that the router isn't otherwise interfering. We can likely help you with router issues here, but have your router's manual handy.
HTTP is a common service port so it is very possible that the router is not blocking the port, and windows may have automatically opened it if you are using IIS. 9300 is not a common port so it is unlikely to be open by default under any situation, unless your default is "all in", which effectively means your not using a firewall.
Another thing you might try (if possible) is closing your existing HTTP service and bind to port 80 using your Websocket service, or if possible (and while exercising caution) turn off your windows firewall completely to see if it works long enough to connect.
In general, don't try to reach your local network IP address from your own machine. There are very confusing things that happen at the socket layer here that I'll try not to delve too far into. The OS goes out of its way to make this work. Sometimes. I would expect that you cannot reach 192.168.1.3 (the server I'm assuming) from itself. There's a translation between local endpoint addresses when you do that which complicates everything.
A network switch will typically not send a frame back down a port it just received it from, so what you're seeing when you ping your local IP in cmd prompt is a loopback shortcut the OS is taking.
Not being able to reach it from another machine causes me suspect that the socket is not bound correctly on the server. Double check that you are explicitly declaring the socket on the server (address and port), and that your're binding your listener to that socket. Also ensure that the address you're binding to is for the correct network adapter. I see this all the time with laptops or machines that have multiple connected adapters.
Unfortunately I cannot be more targeted with my response as I am unfamiliar with what a FancyWebSocket is or how it is constructed.
I can help you if its a linux system.
If there is no name server on the local network, it is still possible to establish a small table mapping IP addresses and machine hostnames in the /etc/hosts file, usually reserved for local network stations.
This file is available even during network outages or when DNS servers are unreachable, but will only really be useful when duplicated on all the machines on the network. The slightest alteration in correspondence will require the file to be updated everywhere. This is why /etc/hosts generally only contains the most important entries.
This file will be sufficient for a small network not connected to the Internet, but with 5 machines or more, it is recommended to install a proper DNS server.
Try adding all the 'ip:port' along with a hostname and copy the template in file /etc/hosts in all the system.
Hope it resolves the issue!
I'm new to PHP, so I don't know how to explain it. I'm running WAMP on my computer and I would like to be able to access my localhost from another computer.
Is it possible? How can I do this?
This is provided that all machines are on the same network and that you have
administrative privileges on the machines (you'll have to edit some system files).
You can easily do this but it would have to be a manual process.
You have to create an entry in the hosts file -
On Windows machines is is located in %SystemRoot%\system32\drivers\etc\hosts
On UNIX like systems it is located in /etc/hosts
http://en.wikipedia.org/wiki/Hosts_(file)#Location_in_the_file_system.
See the link for details on where your hosts file is located. It depends on the operating system.
The following will have to be done on every machine that you would like
to have access to your localhost machine.
Add a line at the very end of your hosts file similar to this :
10.0.0.42 prathyash-localhost.com
The IP address (in the example above it is 10.0.0.42) is the address of your localhost; Your computers IP address. The domain name (prathyash-localhost.com) is what is mapped
to the IP address.
After you save that file, whenever that computer points to prathyash-localhost.com, it will be directed to your IP address. Firewalls are still a barrier - however the other answers covered that so I will not repeat their contribution.
Depending on your situation, manually editing tens maybe hundreds of files might not be feasible. In this case, you might want to consult the networks administrator (he probably hangs around on Server Fault), and he may have a better solution for you.
This problem can be fixed as follows.This is for one using a wamp server or a similar local server.
first ensure that you have modified the httpd.conf.scroll until you find this line:
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
If you have a smartphone turn on your wifi hotspot to connect with your pc and the one you want to connect with.
Open the command prompt in your pc and type ipconfig. Note down the ip4 address of your pc (eg. 192.168.43.47) under wireless LAN adapter Wireless Network Connection.
In the pc you want to connect to set "Obtain IP address automatically".
Before you connect ensure your wamp server is online.
Open the browser of the client pc and type the IP address noted down earlier.This should work just fine. In some cases you may be required to switch off your antivirus.
Yes if they are on the same network, simply target the computer's IP address and ensure anything on either computer that would block access to port 80 (firewalls) is off
#Shaun Hare explained it pretty good, however, if those computers are not in the same network (my case, when remote presentation is needed) you would also need to set port forwarding on your router and remote side would need router's public IP address.
Basically, remote side would enter http://123.123.123.123/index.php in their browser and router would point that request (via port forwarding) to WAMP server installed at 192.168.10.10 (for instance).
You can't. Bind the appropriate daemon to 0.0.0.0/:: or an external interface and use the machine's IP address.
If it's for testing you could use a service like http://localhost.run/ or https://ngrok.com/ to temporarily put localhost on the internet.
Post forward port 80 on your router configuration. Start wamp. Now when your IP address is accessed from any external machine it will jump to the "www" folder and show the index file. If you are not able to do so, it means your firewall is blocking the request: Disable it and try again.
You could just tinker around the firewall. I found that the inbound and outbound rules were blocking all public network traffic (that is, all traffic to my router which is seen as public, even though it has a password) and proceeded to check the box to allow traffic on a public network (both inbound and outbound) for all the rules bearing the Apache name. Also, I did turn on the mySQL server, but that shouldn't do anything at all in this matter (though life has surprised me like this before where something insignificant turned out to be quite significant in the end, so I would do this as a last resort, but unlikely). Also, I think this should work at least over the same WiFi network (and I know that's a part of LAN, but just to clear up any ambiguity) since I only tested with my Android phone (oh how I wish I had a Windows Phone). Hope this of any use to anyone!
I tried Google and it failed.
I want to set up a localhost website from my computer that people from the Internet can access...
I am using Windows Vista (64-bit). I use WAMP but am open to others... I plan on using no-ip.org for DNS.
If anyone knows of a definitive guide.. please let me know -- thanks
If you are able to setup WAMP and access your webserver using "localhost," you will need your IP. If people cannot access the IP, make sure you allow these daemons to run through Windows Firewall and if you have a router, you may need to do some port forwarding (very simple) or, if this computer is always public access, look into DMZ (demilitarized zone) to remove the computer from the router's firewall.
An easy WAMP solution is using XAMPP which is an all-in-one package.
Step-by-step guide:
http://www.dkszone.net/install-xampp-windows-step-step-guide
You need:
a webserver,know your IP adress.
If dynamic.. Dynamic DNS, this will bind your new routerIP to a domainname
make sure your router allow traffic by the port 80 and you are done!
ppl will access your home server just by setting the dynamicDNS domain.
Key points-
0) To install IIS on vista: http://www.howtogeek.com/howto/windows-vista/how-to-install-iis-on-windows-vista/
1) Your cable/dsl company has to open port 80 for you, or else it will not be accessible outside of your house.
2) You're router will have to forward port 80 to the server. You can find out how to do that here: http://portforward.com/english/routers/port_forwarding/Linksys/BEFSR41/BEFSR41index.htm
3) before picking a dns service, check if your router supports one, it is the easiest way to maintain it.
So I'm using this website:
http://www.howtoforge.com/ubuntu_debian_lamp_server
to setup LAMP on my Ubuntu Virtual Machine.
Here is my question though,
This will enable me to program and test through localhost. How can I set this up so anyone on the web can access my .php pages from any Internet capable device, and they will still interact with my local database, etc?
If you open port 80 in your firewall to your local machine, it should be available to the outside world via your ip address. You will need to check your router settings to figure out how to do this, but usually it's called port forwarding.
You could then use a free service like dyndns to give yourself a domain name that you can then type into your browser such as
myserver.dyndns.org
You have a couple of options...
1) Find a site that hosts LAMP and put you site up there. Many of them allow you to register a domain name and they manage the machine.
2) Do what Ben Rowe suggested, use a DNS forwarding service (Some are free, some not). Host the site on your own machine, some ISPs do not allow you to use port 80, you might need to use another port.