Cant' Access port 8080 from browser even if its open at 0.0.0.0 - virtualhost

netstat -plnt shows that my port 8080 is listening at 0.0.0.0 but I can't access it with external IP where as localhost:8080 works just fine
If it shows this shouldn't I be able to access this using the servers IP using http://167.99.144.42:8080/ or do I need to forward the port for some reason.
I am using Apache2 on Ubuntu and Nodejs.

167.99.144.42 on port 8080 and 22 is working fine from the public Internet
There is probably a problem with access from your browser such as a local proxy

Related

can not access website via localhost but 127.0.0.1

I was using virtual box and have had httpd installed on it, the network was configured as 'nat' and I forward port 8080 of Host Machine to port 80 of Virtual Machine.
Then I tried to access the Website hosted on the virtual machine via curl localhost:8080 -vv, but I got Empty reply from server, instead if I use curl 127.0.0.1:8080 -vv then everything is ok, why would it be like this ?

Virtual Host ServerName without Port

Let's say that I need to setup a virtual host with the server name text.dev, is there a way so I can enter test.dev in my browser without a port number? My xampp is running on port 8080. I have to run on this port.
Currently, I can get test.dev:8080 to go the correct directory, but is there a way I can set test.dev to automatically go to port 8080. Any help would be appreciated, Thanks.
This is not possible directly they way you sketch it. This has nothing to do with the virtual host configuration, but with the browser behavior. If you do not specify a port, then the browser will always connect to port 80. nothing you can do against that.
So your only bet is to listen on port 80. If you cannot or do not want to do that with your http server, then you have to forward requests from that port to the one your virtual host listens on. There are several options for such port forwarding: firewall based, by using a simple socket listener which acts like a proxy or by means of a tunnel, for example setup using the ssh tools.
The only way you can do this is NAT forwarding port 80 to 8080. This is really easy with iptables, but this is only for Linux. I am not sure which OS you use. If you are using Windows, I don't think you have some equivalent.
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080

Apache is running but i cannot connect to local host

I have installed xampp on windows 8 and apache could not start and connect on port 80.
I changed the port to 1337 on the httpd.conf. Apache now starts on xampp and shows that it is running on port 1137 and 443 but when i type localhost on Google chrome i getan error message stating Google chrome could not connect to localhost.
can somebody help me please.
since you changed the port from standardport 80 you have to type localhost:1137
When you type
http://localhost
on your browser, it connects to port 80 by default. and
https://localhost
will connect to port 443 by default. Since you've changed the port numbers, you have to use
localhost:1137
or
https://localhost
in your browser.

Browser can't find localhost while Apache and MySQL are up and running

I have reinstalled my Xampp Application, Apache is running on port 443 and 8080, MySQL is running on 3306.
If I go to Localhost, it still gives me a 404 Error while it should give me a message like "You have succesfully installed Xampp!"
What can be the problem?
If you omit the port, http uses port 80 by default and port 443 for https.
So try to call
http://localhost:8080
or
https://localhost
If this does not help you should check the accesslog of your webserver.

WAMP apache httpd.config and hosts - how to alias localhost to port 8080?

Ok so I configured my apache installation on Windows 7 such that it listens on port 8080 by changing the respective entry in httpd.config.
I was too stupid to realize that now I have to access localhost with :8080 at the end.
Question: is there a way to have my box automagically resolve localhost to 127.0.0.1:8080 ? I don't like haviog to type :8080, and NO I CANNOT change the port to 80, I need that one for firewall.
Thanks
no. hostnames have nothing to do with ports. You'll have to specify the port yourself, or set up a proxy on the usual port 80 that will do the 8080 requests on your behalf. ... or bite the bullet and use port 80 directly and move your firewall elsewhere.