Localhost vs ip-address (e.g. 192.xxx.x.xxx) - apache

When I host a page in /var/www/page, I can view it via:
localhost/page
192.xxx.x.xxx/page
Recently, I have started playing with websockets (using this repository).
When I activate the server, I can connect using localhost/page but not with 192.xxx.x.xxx/page (note that I can access the page but not connect to the server)
Can someone explain why?

"On most computer systems, localhost resolves to the address 127.0.0.1, which is the most-commonly used IPv4 loopback address..." (https://en.wikipedia.org/wiki/Localhost)
It's likely that the "localhost" host name is being resolved to the loopback interface IP address (127.0.0.1), as that is the standard on most machines.
If you want the server to respond to another IP address, you'll have to configure it.

Related

XAMPP - can not access from public ip

before I was accessing to my xampp server from my dynamic ip. Now I installed latest version of xampp under c:\xampp3
i have no antivirus windows firewall disabled still I can not access.
Forwarding is done correctly.
My local ip is: 192.168.0.13
In router interface displayed WAN IP:
100.98.20....
but when I check it from browser that is:
94.54.225....
if I type 100.98.20.... which is displayed in router's interface it is okay from local computer but if I type it in different net not responding.
When I type 94.54.225.... not responding from anywhere.
Whats wrong here ?
My ISP gives ips many times to each other and that is why I can not access from public ? Should I buy a static ip ?
It depends on your ISP.
Your "WAN" IP is 100.98.20.... it's IPv4 ISP: Carrier-Grade NAT RFC6598
By the wiki https://en.wikipedia.org/wiki/Carrier-grade_NAT
Disadvantages
* It makes it impossible to host services
Read the wiki for more details and/or contact with your ISP for public IP address.

Access SVN repository from outside local network

I set up an svn server on my Ubuntu 16.04 server as described in this article: https://tecadmin.net/install-subversion-server-on-ubuntu/
I am able to access it via http://LOCAL_IP_OF_SERVER/svn/myrepo
I also enabled port forwarding of port 80 to the mac address of my server in my router settings.
Yet, I am unable to access the svn via the server's external IP address. What am I missing?
EDIT: there only seem to be ipv6 related settings in my router. Could this be the issue?
Greetings
It works when using IPv6. Seems to bei ISP related.

Unable to Ssh on another ISP

When I ssh to my host vps I am able to connect and login easily when on different ISP's i.e.,
My Phone's internet connection
My Friends internet connection
But when I do it at my home,
I get response by ping but unable to connect to ssh using either of,
dns name
ip address
First, make sure that the IP you tried to connect to is a public IP.
Second, if you are using a router, make sure that port forwarding from the router to the destination PC is properly configured. You can usually set it on the router's settings page.
If the ping is entered correctly but the connection is denied, it is likely to be a configuration problem on the router. Or, your ISP may have blocked that port, so use the port scan site to make sure that the port is blocked. If you search for port scanner online on Google, you will see many sites.

How to access a web server installed on Hyper-V

I have installed Ubuntu on Windows 8 using Hyper V. Having also installed Apache 2 I had the notion that I was going to use this as a web dev environment. I set up an external switch so that my ubuntu installation could access the internet. So far everything was progressing swimmingly. The problem I am encountering is that I have no idea how to access the web server from my machine. I can get the IP address that ubuntu picks up and type that into my browser whereupon I am informed "It works!". That's all good but I move around among several networks and I should not have to look up the IP address every time, and that can't facilitate having multiple sites installed. I just want to be able to enter something like
"http://mytestserver/"
into my browser to access it.
Any pointers on how to set this up properly would be much appreciated.
I have always had the most success with Bridged networking in VM Guests and would definitley recommend you go with that option. What you then could do and what I have done is to assign a static IP for the server and assign the hostname as below. You will have to know what IP addressing is available or you can use 192.168.1.x if your inside your network.
The easiest way would be to assign a static IP in /etc/network/interfaces replacing the 0.0.0.0 with the correct entries for your network
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 0.0.0.0.0
netmask 0.0.0.0.0
gateway 0.0.0.0.0
broadcast 0.0.0.0.0
dns-nameservers 0.0.0.0.0 0.0.0.0.0
and then edit your /etc/hosts file and add that static IP and add the Hostname mytestserver. You will already have the localhost entry and possibly others. Just make sure you assign the Static IP address you assigned in interfaces to mytestserver. You may also have to make this same entry in your machines hosts file simply because it will not have a DNS record.
127.0.0.1 localhost
0.0.0.0 mytestserver

Unable to Access my own website from the Server console

I am having a weird issue hosting my web application. I am able to access the website from any other computer (from outside the network and from within the network) but unable to
access it from the Server!! (using the browser )
The details are as follows
Windows Server 2003
IIS 6.0
The system has got a private IP and a public ip
Accessing by Domain name/Public IP from external and intranet clients works fine.
Accessing by Private IP from the intranet clients works fine
Accessing by PrivateIP or localhost works from the server
Accessing by Public IP or Domain name from the server doesn't work!!
As an extra troubleshooting, I did
telnet localhost 443 - works
telnet publicip 443 - doesn't work
Maybe public IP isn't routeable from your server.
Verify what happens when you try to access publicip:
tracert publicip
Check your network settings:
ipconfig /all
Check your socket listenings:
netstat -a -n
Local firewall rules?
Also, there's always the issue of server loopback, wherein a server cannot resolve a named reference to itself from within the server. Most commonly occurs on intranets, or on SharePoint sites, I've noticed.
The problem was with our DNS settings. We recently changed from Public IP to Private IP and the DNS reply was somewhat messed up when we tried opening it from the Server!!.
Thanks for your answers!