How resolve ERR_CONNECTION_REFUSED - asp.net-core

Hi guys i'm stuck with my web api. i hosted my api locally on my computer. if i request using localhost e.g http://localhost:85/api/user/getallusers it works fine.
see this image
but if i use the my local ip e.g. http://192.168.43.86:85/api/user/getallusers it returns "ERR_CONNECTION_REFUSED".
see this image using locally assigned ip
see my ipconfig result
any idea? thank you...

From this link,you can see rsplak says When you access localhost, your /etc/hosts file will tell your computer not to look any further and redirects you to your own computer. When you access the local IP adress, your computer will ask the router to fetch the data, and your router will then point back to your computer.
So it means the mapping of localhost maybe wrong in localhost(it maybe 127.0.0.1 by default).
You can change it in C:\WINDOWS\system32\drivers\etc\hosts.Change the IP to your 192.168.43.86.

Related

Xampp - How to find my ip address with version 8.1.6

I was watching this YouTube demo of connecting xampp to mysqlworkbench. The only issue I'm having is that this video was uploaded last year 2021, which I'm assuming was a different version of xampp where the ip address was visibly there.
However, my version of xampp does not have that and the closest I got was going on the apache web server openconfig file and going above Listen to find some ip address, however, that is failing when I test the connection on mysqlworkbench. Either the ip address given to me is incorrect or something is wrong with mysqlworkbench.
I would like to know however where I can find my ip address with this current version of xampp.
Are you using the local host address which is: 127.0.0.1
You can also type: localhost in the URL bar of your browser.
You should see the XAMMP welcome screen. That information is coming from a folder that you can access from the main "Open Application Folder". Go to "htdocs" and that is where you will put all your webpage files.

get hostname of remote clients accessing my website using vb.net

I have a Vb.net based website which is a pretty old one can't upgrade it.
I need the hostname of the clients visiting the website.
On page load of the login page I am calling using this which gets me the client's hostname who's accessing the website.
System.Net.Dns.GetHostByAddress(Request.ServerVariables.Item("REMOTE_HOST")).HostName
I am logging the details into my Database which is similar to the below
172.xx.xx.xx ltp-017 RUPESH
I have no problem catching the IP address and hostname of devices accessing my website from home network but when a device(including mobile devices) is accessing from outside my home network the above code does not catch the hostname.
Is there any other option or programming language which I can use inside my VB.Net to achieve this?
Any ideas to get this work is much appreciated.
Thanks for your time in advance.
Request.UserHostAddress gives the IP of the connected remote client.
https://learn.microsoft.com/en-us/dotnet/api/system.web.httprequest.userhostaddress?view=netframework-4.7.2

err_name_not_resolved Win7 Error

I am facing a strange issue on a single PC, all other PC's I have tried are fine so the problem definitely seems localised to this setup.
Windows 7
Google Chrome Version 48.0.2564.82 m
I have developed a simple website on an Apace web server (Windows Server 2012), and assigned it an internal IP address (1.2.3.4), and internal dns name (MyWebsite.MyDomain).
This website is only available within our company. When I type the URL MyWebsite.MyDomain into any browser I am presented with the correct web page, great. When I type the IP address 1.2.3.4 into any browser I am also presented with the correct web page, great again.
This is the case for every PC I have tried so far, apart from one. Instead I am presented with the following error message;
This web page is not available
ERR_NAME_NOT_RESOLVED
Why would this be?
Things I have tried so far on the local PC;
delete history/cache on local PC
ipconfig /flushdns
ipconfig /renew
ipconfig /registerdns
changed to Google public dns (8.8.8.8 / 8.8.4.4)
restart (multiple times)
tried IE and FFOX (same error)
checked hosts file (all looks ok)
The only change I ever made to this individual PC was I installed XAMPP and changed the hosts file (for testing purposes). I have since uninstalled XAMPP and reverted to the original hosts file - could this be the issue? I can't think of any other changes.
I had thought the issue was with my web server setup, but as the web site is accessible from all other PC's it would appear not?
Looks like a re-build may be necessary for this PC, unless somebody can perhaps point me to another suggestion? Any help appreciated.
That machine doesn't happen to have any static ip addressing configured, does it? I'm thinking that perhaps a manual entry for DNS server is conflicting or overriding what DHCP is supposed to be assigning.

Public IP Web Page "Connection Timed Out" When Connected To

Recently, I made a website server on my server PC running Windows 7. I used WampServer, and I configured it as follows:
Download and install WampServer.
Check http://localhost (worked).
Program out the HTML files necessary.
Put it inside of the 'www' directory (the default directory of WampServer for HTML files)
Go to http://localhost to see if it worked (yes, it did). Then right click WAMP notification and "Put online".
Go to my main PC and go to http://[local-ip-of-server-computer] to see if it worked. It did.
Now, I configured the httpd.conf to "Request all granted"
Next, I went on ahead to port forward. My router is Frontier Netgear router.
I went to 192.168.254.254 (Frontier's router addresss) > Firewall Settings > Port Forwarding > Add
I selected "World Wide Web (HTTP)" and "OK".
Then I went to the menu and to "DMZ Host". I enabled my server computer for that.
With my main PC, I went on ahead to my public WAN IP mentioned on the router page. It didn't work.
Whenever I try to load my http://[router-public-wan-ip], Google Chrome gets a "Webpage not avaliable. ERR_CONNECTION_TIMED_OUT"
I have port forwarded on my server PC's Windows Firewall.
My httpd.conf is set to be on port 80. Also, I have changed my ServerName to [local-server-computer-ip]:80.
Can anyone provide any advice? Thanks.
This was my mistake. The solution to this problem is that, well, there was no problem at all. I simply hadn't realized that external IP addresses cannot be accessed by their own servers - one inside of the server LAN has to use the server computer's local private IP address.
I sincerely apologize. Thank you to all who contributed.

How to access WAMP Server form everywhere?

I just created my first homepage in the last weeks and now I want it to show it to my friends.
I am using WAMPSERVER 2.5 and followed A LOT of guides but nothing really worked for me.
First of all I am new to this, I have no idea how all this accessing works exactly. I guess I point out how I understand that it should work.
On my PC where I wrote my htmls css php and so on I can access via
localhost:8080/foldername/homepage.php
Okay I changed the port from 80 to 8080 cause a lot of guides recommenced it.
A few days ago I was able to reach this with my local IP
192.168.2.103/foldername/homepage.php
or something like this
I have no Idea how I did that and at the moment it doesn't work anymore.
My httpd.config file is also pretty messed up (and too long to post here), maybe I should reinstall WAMP.
Okay to come back to my question: If I set up everything correctly will I be able to access my homepage on my PC via
http://IPv4-address/homepage.php
like http://91.11.87.45/homepage.php
without buying a domain and only having WAMP installed? The page is intended not to be online 24/7 only when I and my friends need it, or WAMP is always online when my PC is powered.
I already did
- "Put Online"
- portforwarding on router and firewall
- turned off firewall/antivir
- changed httpd.conf and httpd-vhost.conf accordingly to the guides I read
- tried every combination of ips and ports to access homepage.php
and now I am out of Ideas. But I guess I'm not the only one with problems, because all those guides comments where full of questions and problems^^
I hope I explained the problem well enough :P
When you access it from inside the same network, you would still need the 8080:
192.168.2.103:8080/foldername/homepage.php
But if you are outside the network, it would depend on how your port is forwarded. If you have port 8080 forwarded to 192.168.2.103 port 8080, then you would need:
http://91.11.87.45:8080/foldername/homepage.php (also folder name would still be same as if it were localhost)
If on your router you have port 80 forwarded to 192.168.2.103 port 8080, then
http://91.11.87.45/foldername/homepage.php
should work, but some routers are funny and can only do the in port as the same as outport, just to a specific internal address.
so if you can do:
localhost:8080/foldername/homepage.php
and can also do:
192.168.2.103:8080/foldername/homepage.php
but CAN'T do:
-http://91.11.87.45:8080/foldername/homepage.php
OR
-http://91.11.87.45/foldername/homepage.php
then the trouble is in the port forwarding of the router.
If you CAN'T do:
192.168.2.103:8080/foldername/homepage.php
Then sounds like something in WAMP config