0

i'm developing an iot project at university. I have an old linux pc that is used as a server. I've installed noip as in the official guide and it works. Now i'm trying to expose my webpage out of my local network (everything works in local), but i have this error:

pcelementary@pcelementary-X51L:~/IoT$ python3 webpage.py
[16/Apr/2020:14:47:06] ENGINE Bus STARTING
CherryPy Checker:
The config entry 'tool.session.on' is invalid, because the 'tool' config namespace is unknown.
section: [/]

[16/Apr/2020:14:47:06] ENGINE Started monitor thread 'Autoreloader'.
[16/Apr/2020:14:47:06] ENGINE Serving on http://192.168.1.184:8080
[16/Apr/2020:14:47:06] ENGINE Bus STARTED
Connected to mqtt.eclipse.org with result code: 0
[16/Apr/2020:14:48:12] ENGINE Restarting because /home/pcelementary/IoT/webpage.py changed.
[16/Apr/2020:14:48:12] ENGINE Stopped thread 'Autoreloader'.
[16/Apr/2020:14:48:12] ENGINE Bus STOPPING
[16/Apr/2020:14:48:12] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('192.168.1.184', 8080)) shut down
[16/Apr/2020:14:48:12] ENGINE Bus STOPPED
[16/Apr/2020:14:48:12] ENGINE Bus EXITING
[16/Apr/2020:14:48:12] ENGINE Bus EXITED
[16/Apr/2020:14:48:12] ENGINE Waiting for child threads to terminate...
[16/Apr/2020:14:48:12] ENGINE Re-spawning python3 webpage.py
[16/Apr/2020:14:48:13] ENGINE Bus STARTING
CherryPy Checker:
The config entry 'tool.session.on' is invalid, because the 'tool' config namespace is unknown.
section: [/]

[16/Apr/2020:14:48:13] ENGINE Started monitor thread 'Autoreloader'.
[16/Apr/2020:14:48:13] ENGINE Error in HTTP server: shutting down
Traceback (most recent call last):
  File "/home/pcelementary/.local/lib/python3.6/site-packages/cherrypy/process/servers.py", line 225, in _start_http_thread
    self.httpserver.start()
  File "/home/pcelementary/.local/lib/python3.6/site-packages/cheroot/server.py", line 1801, in start
    self.prepare()
  File "/home/pcelementary/.local/lib/python3.6/site-packages/cheroot/server.py", line 1760, in prepare
    raise socket.error(msg)
OSError: No socket could be created -- (('79.35.205.107', 8080): [Errno 99] Cannot assign requested address)

[16/Apr/2020:14:48:13] ENGINE Bus STOPPING
[16/Apr/2020:14:48:13] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('79.35.205.107', 8080)) already shut down
[16/Apr/2020:14:48:13] ENGINE Stopped thread 'Autoreloader'.
[16/Apr/2020:14:48:13] ENGINE Bus STOPPED
[16/Apr/2020:14:48:13] ENGINE Bus EXITING
[16/Apr/2020:14:48:13] ENGINE Bus EXITED

I only switched the local ip with the one that i found in my No-IP page, as i did using ssh protocol. I don't what is the problem.

leonheess
  • 16,068
  • 14
  • 77
  • 112
Sam
  • 51
  • 6
  • You have to read more about how tcp/ip works and how to forward a port in your LAN (assuming you can configure your local router). Maybe this post could help https://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/ – cyraxjoe Apr 16 '20 at 19:48
  • I did port forwading and it should be ok. I tried to ping and it works. I don't know why cherrypy doesn't work – Sam Apr 17 '20 at 16:43
  • You cannot bind to your public ip. Bind to 0.0.0.0 or the ip on the LAN that is connected to the router. Make sure is the right port and that the port forward is indeed working fine with some other command to listen in the same port. – cyraxjoe Apr 17 '20 at 20:04
  • So you're saying that on cherrypy configuration I need to use my local ip but when i look for my service i can find it using my public address? – Sam Apr 18 '20 at 19:58
  • Exactly, if you want to understand it better, look for information about how NAT and TCP/IP works. – cyraxjoe Apr 19 '20 at 00:17
  • Thank you it works great! :) – Sam Apr 19 '20 at 19:01

0 Answers0