I am trying to use this command to see the running status of my port, but I am getting this error in a loop. Kindlly help!
I am trying to let other computers to access my local server but I tried myself locally that I cannot access it locally even myself.
Several things you should know:
My target
Visit my server via http://172.26.141.106:5201/
What I can do now
I can access my server via these two ways:
IP configuration
Result of ifconfig | grep inet
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet addr:172.26.141.106 Bcast:172.26.141.255 Mask:255.255.255.0
inet6 addr: fe80::f767:cd56:9641:d3a9/64 Scope:Link
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
Hosts
Output of cat /etc/hosts
:
127.0.0.1 localhost.localdomain localhost
127.0.0.1 hearen.pc
127.0.0.1 hearen-OptiPlex-7050
127.0.0.1 staging
127.0.0.1 arthas
172.26.141.106 localhost hearen.pc
Firewall
$ sudo ufw disable
Firewall stopped and disabled on system startup
$ sudo ufw status
Status: inactive
Is there some way that I missed out? All I want is to let others access my server via http://172.26.141.106:5201/
Any help will be appreciated :)
Updated 2019-01-10
With the help of @Ed King, I check the ports via sudo lsof -i -P -n | grep LISTEN | grep 5201
and only 127.0.0.1
was listenned on.
Problem solved after I configured my Angular server to listen on 0.0.0.0
.
I use the R Studio IDE to do many things, one of which is to serve local websites utilizing the blogdown package which is a fork of hugo. I write the code in R Studio and preview the site utilizing the blogdown::serve_site()
command. This is the easiest way I know of previewing static HTML sites. Utilizing hugo R Studio coerces my browser to go to the 127.0.0.1:XXXX
location and my local site is previewed before my eyes.
Can I serve local sites natively with Ubuntu 18.04? How? I imagine it should be very simple. Searching online I can't find any simple way to do it though. If I simply open the static HTML files directly in my browser they showup wonky. All image links are immediately broken. Formatting of headings, hyperlinks, etc is not the same as when I serve the page locally with hugo.
EDIT - I did not really define my term 'simplicity'. There are two different approaches (so far) in the answers, one that is simplest to the end user, and one that is simple with regard to operations being performed by my computer. I like both approaches and will welcome answers utilizing any approach as I test them. Thank you.
I am asking this question from an awkward situation. As you may know or not know, Google is blocked in China. A discouraging consequence (at least to me) is that visiting Stack Exchange sites, like Stack Overflow where I used to be very active while I was doing my degree in UK, is very hard. It can take more than 20s to load a page. The problem is that Stack Exchange sites rely on an external JAVA script from
http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
but since Google is blocked, this script can't be accessed. But Firefox would spend considerable time trying to get this script. (Note that the jquery version may change in future, but it is 1.12.4 when this question is asked. Use F12 to check the most up-to-date version.)
In fact, this script can be accessed freely from
https://code.jquery.com/jquery-1.12.4.min.js
So, an ideal solution is to redirect the page under Google domain to Jquery domain.
Is this possible by modifying /etc/hosts
files? At the moment I am simply doing a brutal webpage blocking:
127.0.0.1 ajax.googleapis.com
Although Firefox now will stop trying to load this script so visiting stack exchange sites becomes as fast as normal, many site features are not useable, like voting etc. So the best solution is a redirection.
If immediate redirection is impossible, then I guess I need to download the JAVA script from Jquery to my laptop, then redirect the googleapis page to my localhost. However, I don't know how to set up a localhost, especially where to place my downloaded script.
Can anyone help me out? Very appreciated.
I am trying to send data to port 2003 I am using tcpflow to listen however i cannot see any data being printed or sent ?
Sending Data to port 127.0.0.1 2003
echo hello | nc localhost 2003
or
echo "test.count 4 `date +%s`" | nc -q0 127.0.0.1 2003
Listening Data
tcpflow -i lo port 2003
tcpflow: listening on lo