Webserver not starts after RPi2 reboot

Hi all,

I did setup the Webserver as per the point 3 Webserver, it works after setup.
But then I did RPi2 restart and now the web is not reachable, even the Webserver is still checked in the menu.

The nmap show no port 80 open on the RPi2 now, it was open before reboot.
It seems like the Webserver did not auto start after RPi2 reboot…
I´m googling for last 2 hours, but I did not find any solution for this Frown
Any idea how to force Webserver to start after RPi2 reboot?

Thank you.

There should be no configuration required as the webserver is enabled by default on every OSMC installation.

Yeah, I know that, problem is that port 80 is not listed in the nmap output and then web access (webpage) doesn’t work.
I even tried to switch it off in OSMC GUI, restart and enable again, but website still down.
So, what now?

What web server is used on OSMC? I check for Apache, but its not there…

Ok, I think you are getting things a bit confused. I believe you are talking about the Webinterface of Kodi (which is to control Kodi either via browser or JSON), correct?
That is not a separate webserver like apache but a build in function of Kodi.
Please explain what exactly you are looking for and I suggest you post some logs so that we can better understand your situation. Please see How to submit a useful support request - General - OSMC for advice on how to help us.

Kodi’s web server is based on libmicrohttpd.

Sam

Yes, I mean the “Webinterface of Kodi” as per Kodi Wiki point 3… and yes, I mean web for remote Kodi control.

Any httpd running:
osmc@XXX:~$ ps -ef |grep httpd|grep -v grep
osmc@XXX:~$

http://paste.osmc.io/fulanepuje
http://paste.osmc.io/boyitacizi [and I will have to change password now]
http://paste.osmc.io/fifumaxati
http://paste.osmc.io/efusexozib

Any other you would need?
I’m not with RPi2, I have remove ssh access only now.

You will not see it as it is run by kodi.bin.
sudo netstat netstat -tulpn | grep kodi
and
dpkg -l | grep httpd

Actually dmesg, apt and Kodi logs would be helpful if you are on ssh just do a grab-logs -A.

Here we go… thank you very much…

osmc@XXX:~$ sudo netstat netstat -tulpn | grep kodi
udp 0 0 0.0.0.0:9777 0.0.0.0:* 375/kodi.bin

osmc@XXX:~$ dpkg -l | grep httpd
ii libmicrohttpd10 0.9.37+dfsg-1+b1 armhf library embedding HTTP server functionality

osmc@XXX:~$ grab-logs -A
Logs successfully uploaded.
Logs available at http://paste.osmc.io/uqebowenog

Just to avoid a port collision also post sudo netstat -tulpn

osmc@XXX:~$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 376/rpcbind
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 258/sshd
tcp6 0 0 :::111 :::* LISTEN 376/rpcbind
tcp6 0 0 :::22 :::* LISTEN 258/sshd
udp 0 0 0.0.0.0:968 0.0.0.0:* 376/rpcbind
udp 0 0 0.0.0.0:9777 0.0.0.0:* 375/kodi.bin
udp 0 0 0.0.0.0:111 0.0.0.0:* 376/rpcbind
udp 0 0 192.168.13.4:123 0.0.0.0:* 437/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 437/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 437/ntpd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 231/avahi-daemon: r
udp 0 0 0.0.0.0:34074 0.0.0.0:* 231/avahi-daemon: r
udp6 0 0 :::968 :::* 376/rpcbind
udp6 0 0 :::50781 :::* 231/avahi-daemon: r
udp6 0 0 :::111 :::* 376/rpcbind
udp6 0 0 ::1:123 :::* 437/ntpd
udp6 0 0 :::123 :::* 437/ntpd
udp6 0 0 :::5353 :::* 231/avahi-daemon: r

Ok, thanks at least no port conflict on port 80.
I will read thru the looks and will let you know if I see anything

Thank you very much fzinken.

I didn’t have much time to play with my new toy, so basically I just mount the NAS to the /mnt sub-folders and run scan over the video files (and nfo, which I prepared by MCM on my PC).
I installed couple addons for Czech internet TVs.
I installed nmap tool.
And I enable Kodi web access and set credentials… which worked till first RPi2 reboot.

And that should be it, no other system changes.

Have checked your log. I have to admit I am not an expert on this and hope soemone else will look at it later. But what I can see is that there seems to be an issue with and addon and after that the webserver is torn down.

17:48:18  31.569082 T:1770177568   ERROR: EXCEPTION: Unknown addon id 'script.mcuphone'.
17:48:18  31.572599 T:1770177568   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.RuntimeError'>
                                            Error Contents: Unknown addon id 'script.mcuphone'.
                                            Traceback (most recent call last):
                                              File "/home/osmc/.kodi/addons/script.mcuphone_pip/default.py", line 25, in <module>
                                                __settings__   = xbmcaddon.Addon(id=__scriptId__)
                                            RuntimeError: Unknown addon id 'script.mcuphone'.
                                            -->End of Python script error report<--
17:48:29  41.984238 T:1958359600  NOTICE: ES: Stopping event server
17:48:29  42.524612 T:1694417952  NOTICE: ES: UDP Event server stopped
17:48:29  42.665527 T:1958359600  NOTICE: stopping upnp
17:48:30  42.819870 T:1958359600  NOTICE: stopping zeroconf publishing
17:48:30  42.826637 T:1958359600  NOTICE: Webserver: Stopping...
17:48:30  42.827919 T:1958359600  NOTICE: WebServer: Stopped the webserver
17:48:30  42.828094 T:1958359600  NOTICE: Webserver: Stopped...

So it might actually be related to one of the addons you installed. How about you try uninstalling them first to get the Webserver back and then adding them 1 by 1.
Maybe also share the section of your .kodi/userdata/guisettings.xml

Ohh, you might be right, I did check logs too, but I overlook this :frowning:
Yes, I did install the mcuphone, but as it “failed” on the start, I did uninstall it, at least I thought it was…
As I just found it was NOT :frowning: :rage:
Uninstalled again :sunglasses: and Webserver works, jupiiiiiiiiiiiiii!!!
Thank you thank you :wink:

Btw. I also found that there is add-on for each language there, can I at least disable them? Or it has no influence to performance? Thank you.

And I´m gonna change passwords :innocent:

Feel free to do so, but generally I would not expose OSMC to the internet. And as long as you are in your LAN it doesn’t matter if anyone knows your passwords.

This was my first experience with “sharing logs”, so I didnot know what will happened once I ran the “grab-logs -A”… I would say this is quite big security risk this tool… Now I thinking about setting FireWall to do not let RPi2 accessible from Internet and let only necessary Add-ons from RPi2 to internet TVs or necessary Web sites…
I have to admin, this tools get me goose, man …

Btw Webserver is running now, but port 80 is still not in list:
sudo netstat netstat -tulpn | grep kodi
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 388/kodi.bin
tcp 0 0 0.0.0.0:36666 0.0.0.0:* LISTEN 388/kodi.bin
tcp 0 0 0.0.0.0:1245 0.0.0.0:* LISTEN 388/kodi.bin
tcp6 0 0 :::80 :::* LISTEN 388/kodi.bin
tcp6 0 0 :::36666 :::* LISTEN 388/kodi.bin
tcp6 0 0 :::36667 :::* LISTEN 388/kodi.bin
tcp6 0 0 ::1:9090 :::* LISTEN 388/kodi.bin
udp 0 0 0.0.0.0:1900 0.0.0.0:* 388/kodi.bin
udp 0 0 0.0.0.0:9777 0.0.0.0:* 388/kodi.bin
udp 0 0 0.0.0.0:15452 0.0.0.0:* 388/kodi.bin

And btw it is horribly slow to get list of Profiles or movies in there :snail:

This is port 80!

Is your RPi2 directly connected to the internet with a public IP address? This is cleary a no go! But I doubt that as you use private IP’s
So that would mean you must have forwarded all ports of your router to the RPi2

Uff, sorry, I´m blind, I just woke up 30mins ago after night shift.

Nope, RPi2 is connected to AP and then to provide modem. I have had forward two ports to internal network, for SSH and for web…
So, I disable the web port now, but kept ssh for while…

But what I would be more interested it is, what OSMC or plugins are sending to “who knows” from RPi2 to internet, then who is accessing RPi2 from internet. I can manage the second part, but I have no control of what OS or Add-on do…

If you want to use SSH from remote I suggest to use a high port (>1024) instead of the standard port 22 with that you at least avoid 90% of the attacks (script kiddies)

Agree that part is a bigger challenge and not easy to solve without a huge amount of manual work.
If you just want to know what is going on in terms of outgoing connections you could just install iptraf which would give you an overview of destination IP and Port. Or you could use nethogs to see the traffic per process. But your issue will be that all your addons are behind the kodi process.

Thank you for advise, yes I do run SSH on high port.
And also thank you for the iptraf tool.