Why can't I open a website in the browser even though I can curl on my linux localhost? - browser

I can curl the contents of an internally hosted site using curl http://localhost:9000 but cannot connect when I try to open the same in the windows browser http://ip-address:9000/. I am trying to do this from within the internal network.

The admin needed to open up iptables port 3000 and then it worked on the browser.

Getting the site via curl using localhost as the address implies that your machine (the local host) is the one hosting the site. Then you say that you're on Windows and the site's being served by a linux machine. Which is it?
Regardless, if you can get the contents via curl using http://localhost:9000, then you should be able to get the contents via your web browser using http://localhost:9000. Try that.

Related

How can one access http://localhost/ using the command line

I installed apache2 on ubuntu and I want to check that it works by accessing http://localhost/. The problem is I installed ubuntu(17.04) server, so there is no web browser, only the command line.
What can I do?
curl localhost (curl localhost:8080 if it's not port 80)
or
curl 127.0.0.1
or just test with
ping localhost
or download your index.html or something
wget localhost
I recommend installing a browser for a command line like lynx ,Browsh.
Lynx is light-weight. Fast. An img element is always shown in their alt text.
Browsh is a bit slower than Lynx. An img element is always shown ing(but as low quality as your command line can display).
I use different above depending on the purpose.
If you just want to see the localhost is working well, use lynx.
If you want to check your server working well and see details, use Browsh.
I hope my answer will help you. Any questions, google or ask me.
You can also port forward it...
You can use ngrok service(just google it) and you can port forward your local host and open it on your own web browser. . . even on your phone..
./ngrok http 80
I think this should work and give you temporary address

I can only access NodeJS server locally

My server's hosted at DigitalOcean (it's a droplet) and basically, I cannot access my NodeJS app via Internet, only server-side. It's running on port 9000, I've allowed traffic to the port via ufw and iptables, no luck. When I run curl || wget while SSH-ed to the server, I get a normal response as if everything's in order. But when I try to access the server from an another machine, I just get timed out because the server returns nothing. I've heard DigitalOcean sometimes disable connections to all ports except ssh,www and ssl, but I think I've successfully 'opened' them. Any suggestions?
This is what I get when I run netstat -tulp | grep LISTEN
Turns out my dashboard was all messed up when it comes to ports, which I forgot to check, of course, so opening them directly on the server gave no results whatsoever.

How can I access my nodejs web server from my local computer using the server domain name?

I installed nodejs and created a sample app. When I run npm start I get a message saying that I can open my web browser to http://localhost:3000 to see the app in action, but this installation is on a web server - not my local computer, so, instead of localhost:3000 I want to get there using something like mydomain.com:3000
I can't find the answer, it's very likely I just don't know how to search for it... any ideas?
I'm following the tutorial here: https://facebook.github.io/react/tutorial/tutorial.html
I think I only needed to get away from this for a while. I got it working using ssh local forwarding.
I already used an ssh config file to log in to my server without having to remember the password, so I just added this line to my config file:
LocalForward localhost:3000 xxx.xxx.xxx.xxx:3000
where xxx.xxx.xxx.xxx is my server IP address.
Then, I connected to my server via ssh:
ssh -f -N mysite
Once connected, I open up the browser and go to localhost:3000 and there it is now.
I used my ssh config file, but it should also work without it.
ssh -f -N -R 3000:localhost:3000 mydomain.com
I found this command that eventually led me to solve my problem in this link: http://stuff-things.net/2016/01/20/tunneling-to-localhost/

how to run nodejs app in vps with plesk enable

Hi guys im newbie in vps... I've bought an ovh not managed vps . I like to face problems... But I don't find any documents to these one. Is simple like I said I want to run a nodejs app in centos vps environment but I have enabled plesk.. and I saw in console running the app with the trace but I try to open website with the port and doesn't find anything.
http://vps406315.ovh.net
Thx for all guys
-----------------EDIT-------------------
I'm going to explain better,sorry for previous post.
There is no error, in my console all is ok. Like I said i have an CentOS VPS. Steps that I did:
Connect with PUTTY
Go to folder where is the NodeJS project.
I set the port to 8080
Write node index.js
The app is running and writing the right trace.
I use chrome to check the ip, and show me the default plesk page.
I use wget to check it, and with only http://92.222.71.137/. I attach
an screenshot
I tried to use with the port 8080 with the chrome and wget in putty,
and the response was the same.
In the other hand if I use http://92.222.71.137:8080/login with putty
download the right login.html, and the nodejs app write a trace
indicate me that someone connect to that page. But if I access with
chrome is not working.
Now I would like no know how to make access frome Chrome.
Thx 4 all and sorry for my newbie knowledge
You should give some other details on the configuration or eventual errors you get (both on the browser and the VPS) and how you run the node app (behind a web server, for example)
If you are not running you node app behind a web server, are the node app listening on the correct interface ? 127.0.0.1 and 92.222.71.137 (your site external address) are not the same.
On your VPS you can try to call the node app from the VPS itself using wget or cURL and looking for what happen in the app trace.
Finally it was easy... only i had to open a port to use with TCP, using
iptables -I INPUT -p tcp --dport 8856 --syn -j ACCEPT –

Accessing remote linux server's localhost:8080 from windows desktop

I am a complete beginner with Linux. I have ssh access (I think that's what it is) to a linux server. I have a program called SpagoBI installed on the server, and it needs to be accessed through localhost:8080 in a browser. I have changed the xml file that points to localhost to the ip of the server but I still can't access it. Does anyone have any suggestions on how to access the localhost through the ip?
With SpagoBI configured to answer on localhost (the default), you can use Putty on Windows create an SSH tunnel from your local system to the SpagoBI system. If you were to redirect local 8080 (of your local system) to 8080 of the SpagoBI system, then you could access the remote SpagoBI server like this http://localhost:8080/SpagoBI while the SSH tunnel is up.
Now... to configure the SpagoBI server correctly so that it answers on a specific FQDNS... you'll need to modify the Tomcat server.xml
Go to the Tomcat config directory and edit server.xml. These are two entries you'll need to modify. Then restart tomcat and try to access SpagoBI using the FQDNS and URL.
<Environment name="spagobi_service_url" type="java.lang.String" value="http://spagobi.example.com:8080/SpagoBI"/>
<Environment name="spagobi_host_url" type="java.lang.String" value="http://spagobi.example.com:8080"/>
After restart, try accessing SpagoBI like http://spagobi.example.com:8080/SpagoBI
I hope I understood. Do you write "localhost:8080" on your remote windows machine? If so, you should write the SpagoBI's address instead of localhost.
If you already doing so, I see on SpagoBI troubleshooting that you should try with http://serverIP:8080/SpagoBI/servlet/AdapterHTTP?PAGE=LoginPage&NEW_SESSION=TRUE.
I would check that 8080 port is open on firewall anyway.
If you have access to the GUI on server I would try to open in a browser that http://localhost:8080 is actually working at least locally.
Check whether the spagoBI is working in linux server or not. If not follow these steps: http://www.2daygeek.com/spagobi-5-0-release-notes-installation-steps/
If it's working in linux server, it can be opened in you windows system with the url:http://ipaddress of linux server:portnumber/SpagoBI.

Resources