Access from client to server on same machine by browser - client-server

I have a simple question about client-server , please help me to solved it :
Assume that I have :
Server A (Using apache http server )
Web application B ( Also using another apache http server)
A and B is located on the same machine
If on local browser , I access to a page from B ,and this page send a request to A :
$.ajax { url: localhost:8080/service_from_A,..}
It's work nomarly
And on browser from another machine I access to page from B ,and now ,the ajax request is failed because url is localhost of another machine
So , how can I access from another machine with above ajax calling (url still is localhost )then it could be exactly redirect server A . I do not want to fix IP address in ajax call

On the computer running your Apache servers, get it's local IP address. For a Windows computer, you'd open up cmd.exe and type in
ipconfig
Then look for something that says "Wireless Adapter" if you're using a wireless connection or "Ethernet Adapter" if it's wired. Now look for the part that says "IPv4 Address" and read what's next to that.
I'm going to be assuming your local IPv4 address is 192.168.1.82
In your AJAX script, replace "localhost" or "127.0.0.1" with the IP address of your server host computer, in this case: "192.168.1.82".
Once you've done that, try connecting a computer that's on the same LAN (Local Area Network) as your host computer using the IP address of the host. To allow a computer from a different LAN to connect to your server, you need to do something called port forwarding.

Related

connect to server script on xampp

I have a remote Windows server 2008, and install xampp on the server. I write a server script, and on the server, I can invoke the server script with http://localhost/fire/myfile.php
My question is: how do I invoke this script from another computer? If the IP address of Windows server is 192.168.1.1, is the URL to invoke the script http://192.168.1.1/fire/myfile.php?
But the URL doesn't work.
If your other computer is in the same network, your attempt will work. Otherwise, if it is outside of your network you cannot access your PHP-File by an internal IP-Address.
In that case you have to use your WAN Address, or you could set up a DNS on your WAN-Address and redirect all incoming requests from port 80 (or the port you want to use) to your internal IP-Address on your computer running xampp.

Xampp port not working

I've got xampp installed on ubuntu. The port which I'm using is 3000. Let's say that my IP address is 123.123.123.123
When from another device I'm checking port 3000 for page 123.123.123.123 it's saying it is open.
When I'm opening page 123.123.123.123:3000 on my computer it's working. However when I'm opening 123.123.123.123:3000 on another device it's not working.
How is it possible? (The port is open)
*it looks like client is being redirected to localhost.
Let's say you are running Xampp server (apache) on port 8000. In this case, your local server access address would be localhost:8000/ or 127.0.0.1:8000/
Let us consider your ip address to be 123.123.123.12. So in your LAN network, the server access address would be 123.123.123.12:8000/. So the address you have used will work in case of devices connected in a LAN network.

IIS https website can't enter

Update 4/12:
I'm using Vigor 2910 (router) to connect to my server. I found out that I cloud view the website correctly by external ip from other PC. But everytime I try to login the browser redirects me to internal ip. Is there any settings I should know besides port forwarding 80 and 443 from external ip to internal ip?
I found a way to fix the problem.
My problem is, when I use another PC connected to different router trying to connect to the PHP site with external IP, it always redirect me to internal IP address.
For example:
Entering site https://140.XXX.XX.XXX
After clicking any objects on the site, then I was redirect to https://192.XXX.X.XXX
Cause I'm connected to the router that I didn't notice it not only affects my PC but also in PHP config.php. In config.php, the redirecting address is written in internal IP instead of external IP.
Just simply change the IP to external IP, then it works.

setting up home ftp server using filezilla

I googled, followed all the instructions but still stuck, and unable to create a home ftp server.
My internet is from dsl modem -> vonage router -> wifi router
FileZilla server ip is 127.0.0.1 and it works fine when tried from command prompt. But I need it to be accessible from outside.
I enabled ftp on wifi router's web settings page using virtual server setting.
I am stuck at this point, I don't know what else to do further. Any help is greatly appreciated.
Also, if you are planning on accessing your server remotely, (not in your network) you will have to enable port forwarding on your router. (Use the ip address of the machine running the server and use port 21) Otherwise, you only be able to connect while in your LAN.
This pretty much summarizes your needs(via lifehacker.com)
If you're FTP'ing across your home
network (like from your upstairs PC to
your bedroom PC), you can reach the
server by using its internal network
address (most likely something like
192.168.xx.xx.) From the command line, type ipconfig to see what that address
is. If you want to log into your FTP
server over the internet, set up a
memorable URL for it and allow
connections from outside your network.
To do so, check out how to assign a
domain name to your home server and
how to access your home server behind
a router and firewall.
Original Article
How to assign a domain name to your home server
How to access a server behind a router and firewall
You need to be able to access your internal network from the internet. Consider using a service like dynDNS if your router supports it.

Do we have to buy a domain to serve Bugzilla?

I tried putting my IP from whatismyip.com in the urlbase of Bugzilla but it did not work. I wasn't able to create a new account for my team mate, and he wasnt able to access the server by typing the my ip address in his browse. And surely, when I connect again, my IP address will change. Do we have to buy a www address to host Bugzilla?
You can setup a dynamic dns service, for example via http://www.dyndns.com or http://www.no-ip.com or http://freedns.afraid.org to solve the changing ip problem without buying a domain (or buying a domain as well, but it's not a requirement).
But the real problem is that your team mate cannot access the server via the current IP address which points to either a misconfiguration of the webserver (listening only on localhost?), to a firewall in between, or most likely, that port forwarding isn't set up in your router for requests coming to your external IP address to be forwarded to the machine where you have Bugzilla set up. Additionally, you must set the urlbase to your local IP address, not to the external IP address, as blak3r says.
Check http://www.portforward.com for instructions on how to do port forwarding. But don't forget that everything mentioned has to be working:
Web server listening to outside requests: This can be tested from the same internal network via the local network IP address (what you see typing in a command line console ipconfig in Windows and ifconfig in Linux). If you can connect from a different machine on the same network via the local IP address, this is solved.
Firewalls (in router and the webserver machine) accepting connections to the web server port: For firewalls in the web server, the same test as above covers it.
Port forwarding so the router forwards the requests received on the web server port to the web server machine: This gets tested in the same way as firewalls in the router, that is, you must have your friend (or yourself from the house of your friend) try to connect to the dyn dns name set up or to the external IP as reported by whatsmyip.org.
This is all assuming your test mate is not on your same network, if he is, just using the local IP address (shown via ipconfig or ifconfig) instead of the external IP address and making sure the first step is covered (web server listening to outside requests) should be enough and nothing else is needed!
You most likely do not have your port 80 forwarded to your machine which is the reason he cannot connect when using the IP that was returned from whatismyip.com.
Assuming you're on a windows box... do
Start->Run->cmd then type
ipconfig
If your address starts with 192...* or 10...* this is your Local Area Network (LAN) IP. If this is the case, then your isp provided you with a router. Look for a setting called port forwarding or "application setting" which allows you to forward all incoming traffic on your router to a particular IP address. Go into your router's configuration settings and make sure port 80 (and maybe 443 if you're using ssl are forwarded to your local ip).
The other problem you mentioned is you do not have a static IP. This is a common problem and no you do not need to buy an address. There are several sites which can provide you a free dynamic dns host. Try no-ip.org.

Resources