I can access 127.0.0.1, but not http://localhost:8080 - eclipse

I have a problem. I am trying to run a simple JSP page from Eclipse:
http://postimg.org/image/z268cl1s3/
But when I run this page i get a 404 error:
http://postimg.org/image/h0rosix4z/
When I put in:
localhost
127.0.0.1
in the browser it works fine:
http://postimg.org/image/8js6hlsg3/
I can see eclipse is running it from localhost:8080, but when i type that in at the browser it gives me this error:
http://postimg.org/image/7lbtfbf43/
Does anyone know how I can activate localhost on my mac. I looked up several tutorials, but i didnt find the answer. MySQL is also running fine on the computer, so I guess there is something that dont let me access [http://localhost:8080?]
Hope someone can help me?
Best Regards
Mads

There are two issues you are having:
There is a difference between http://localhost/ (and its equivalent http://127.0.0.1) and http://localhost:8080 - the first uses port 80, the second 8080. The Tomcat server listens only to the latter, that is shown by the servers error messages, and not generic 404 messages. In other words, do not forget to add the 8080 port numbers to the end of the localhost url
The Tomcat error messages show that the resources are not available, so I would look at what Java web applications are installed - e.g. the root web application is missing (the localhost:8080 url) for sure, and I am not sure whether your MySQL connector is.

Search google for how adding an entry to the hosts file on your mac.
You'll basically link localhost to 127.0.0.1 there

Related

Issues with localhost:8080 port in my XAMPP - Visual Studio code stack

After I've updated my Windows 10 my XAMPP got "Port 80 in use by "Unable to open process" with PID 4!" error. I googled and found that "80 port" related issues is a pretty much common one. It can be resolved by replacing port number in XAMPP Apache (httpd.conf) file in
Listen 8080
and
ServerName localhost:8080
lines. This is what I made and my Apache began to work again.
But after I launched my project page from VS code, the browser (I use Chrome) returned "This localhost page can’t be found" error.
I thought this is because the root didn't contain :8080 after "localhost". I added :8080 after "localhost" in Chrome address bar and everything stared working.
I think that the reason is somewhere in VS code settings. I added :8080 in VS code settings but after I click "Open PHP/HTML/JS in browser" the pages of my project are still being opened without :8080 after "localhost" in the root in the address bar.
check out here and
here
I've already spent the half of the day to find out how can I resolve the issue but I think I couldn't manage without an external help.
Could anybody please help me?
I spent up to 3 days until found the answer.
In my case this one helped https://stackoverflow.com/a/22058569/14882824

Expose Ngrok Web interface in same LAN

I have some issue to configurate Ngrok.
I have installed the Ngrok on linux CentOS server dedicated (IP 192.168.1.124), it works correctly the tunneling is ok.
My question is: how i can reach the web page on 127.0.0.1:4040 in order to check the traffic on my Ngrok server?
The web interface page is only accessible on the server where ngrok is running, but if this is a linux minimal server (without gui and any type of browser) I can't see it.
is there a way to make it accessible also in LAN?
e.g. I have another client that can reach the IP where ngrok is running but if i put on web browser http:\192.168.1.124:4040 nothing is showing.
I see from netstat that this port is not listening so isn't a firewall problem or other.
Is possible to change config of Ngrok? otherwise are there other possibilities ? do i have to use a reverse proxy or something like?
Any ideas?
thanks for your help,
Luca
Locate your ngrok's config file:
$ ngrok config check
Valid configuration file at /home/youruser/.config/ngrok/ngrok.yml
Add to the config file the following line:
web_addr: 192.168.1.124:4040
In case you want to expose it to all interfaces, you can replace that value with 0.0.0.0:4040

Keep port in url when usung redirect in Zend Framework

I have a Windows development machine with an Ubuntu VM set up via vagrant. The VM has Nginx running on port 80 and the Vagrant configuration maps port 8080 on the host Windows machine to port 80 on the VM. For various reasons the project that I'm working uses 127.0.0.1 instead of localhost so, in my browser on the Windows machine, I hit a URL such as:
http://127.0.0.1:8080/foo/bar/baz
The application on the VM is built with Zend Framework 1.12.
If I click a link that has an href="/foo/bar/baz" then all is fine and I go to:
http://127.0.0.1:8080/foo/bar/baz
However, if in one of my controllers I use a redirect to "/foo/bar/baz" then the browser loads:
http://127.0.0.1/foo/bar/baz - i.e without the port in it.
If I then manually edit the URL in the browser's address bar to add the port and hit enter then the page comes up correctly.
I've tried various ways of doing the redirect programatically in ZF, and even tried typing a hard coded URL into the code, but whatever I do it always strips out the port component when the redirect takes place.
Any ideas/suggestions as to how to keep the port in the redirect would be much appreciated.

Angular app not working in IE 9 on remote server

I have a simple angular application that works just fine when deployed on my local JBoss instance, but when I deploy the same war file in our sandboxed environment (also JBoss) the application doesn't load. Just shows up as a blank page. When viewed on Chrome or FF it works fine as well.
Not a lot to go on, but any pointers in the right direction would be very helpful.
Edit: Just another piece of info, it doesn't work locally on IE either when the address contains the computer name and not localhost. So http://localhost:8080/angularapp works but http://[machinename]:8080/angularapp does not.
In the post you don't make completely clear in what environments you've the problem (it's clear it doesn't work using IE, but does it work in all cases with Chrome and FF?).
But the problem you're experiencing when trying to access using the machine name (http://machinename:8080/...), may be caused because you've not defined properly the IP bindings in the JBoss startup: by default JBoss binds only to localhost (127.0.0.1), if you want JBoss to be accessed from any other network interface, you've to define it. That can be done using the -b parameter of the startup script (run.sh for Jboss 3.x/4.x/5.x/6.x or standalone.sh if it's JBoss 7). For example:
./run.sh -b xxx.xxx.xxx.xxx (where xxx.xxx.xxx.xxx is your server IP) will make the JBoss accessible only from that IP (and its corresponding machine name, provided is correctly defined in the DNS or /etc/hosts ...), but not from localhost.
./run.sh -b 0.0.0.0 will make the JBoss accessible from all the networks interfaces of your server.

JBoss VPS External ip settings - working fine in local browser but not in external

On beforehand I have to say i'm a bit of a newbie.
I've sucscribed to a VPS with Ubuntu 11.04 server, I installed Jboss and am starting it with the -b 0.0.0.0 option.
Now if I lookup the address ip:8080 on a browser on the VPS itself it's working fine, but if I try to look it up on a browser on an external machine it isn't able to access the page.
I tried to modify the hosts file but without success. Maybe its the iptables? Or something else?
I really appreciate any help thanks.
Take the static IP of the server, ping that from your command line tool with ping. If you are successful in pinging the server you are all set. Now go to the browser of the external pc and type the static ip and give the port as 8080. It will certainly work.
Some good suggestion from my side is, try PaaS(platform as a service) now as that is much easier than VPS and you will get up and running in minutes. Try Jelastic. It has got JBoss hosting. Deploy your WAR file there and you can access it immediately. Ket me know if you really go ahead and use it.
Surya