LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   SimpleHTTPServer - How to disable on Debian on boot? (https://www.linuxquestions.org/questions/linux-software-2/simplehttpserver-how-to-disable-on-debian-on-boot-4175539497/)

nicedreams 04-12-2015 02:47 PM

SimpleHTTPServer - How to disable on Debian on boot?
 
I've been trying to run LimboMedia which runs on port 8000 by default and is self contained. When I try to run it I get the error of port 8000 is already in use. I've ran a netstat and found that python/SimpleHTTPServer is running on 0.0.0.0:8000 every time I reboot on my Debian box. This happens on 3 different boxes using mix of Debian and Ubuntu two being PCs and one being an ODROID.

How can I get python/SimpleHTTPServer to not run at boot? I can't find a service for it in /etc/init.d. I can change the port in LimboMedia to 7000 and it work, but want to run on port 8000 if I can.

Do I need SimpleHTTPServer? I've looked all over Google, but can only find out how to run and exit the program and nothing to help with disable or remove so far.

If it has to run to boot, can I change the port and how can I do that since it seems you have to type a command each time to change the port?

T3RM1NVT0R 04-12-2015 04:25 PM

Did you try disabling using the following:

Code:

update-rc.d <daemon> disable
I used it on Debian 6 box for apache2 and it worked!

michaelk 04-12-2015 04:47 PM

So python is installed by default and SimpleHTTPServer which is a python module is also installed by default. However, I'm not sure what was installed that would automatically start the server at boot. Not something part of the basic installation that I know of. Looking at the running processes might provide a clue.

nicedreams 04-13-2015 11:31 AM

I can't find anything in "/etc/init.d" or "service --status-all" that would be part of Python or SimpleHTTPServer or httpd so I can't figure out what to stop or disable.

When I run a netstat I just get 0.0.0.0:8000 used by Python. I go to 127.0.0.1 on the box and get nothing.

I've removed MPD thinking it might be conflicting with 8000 and rebooted, but same issue.

Is there a way to get more in depth to find out why and what Python is using 8000? Is there a way to just disable or stop SimpleHTTPServer from startup inside of Python? I've read SimpleHTTPServer been renamed to httpd in Python3? Still don't see any httpd services. The only way I can think of is to keep killing the port/process, but that isn't a fix.

T3RM1NVT0R 04-13-2015 01:46 PM

It will be good if you share the output of the following:

Code:

netstat -ptan | grep LIST
Run this command when the service you are talking about is using port 8000.

nicedreams 04-13-2015 03:57 PM

Thanks T3RM1NVT0R

That got me in the right direction. I ran "netstat -ptan | grep LIST" and followed the PID and found Ajenti was using it. Don't remember if I saw the PID last time or it just dawned on me now. Wow..can't believe I forgot about Ajenti on this box. I ran service ajenti stop for now and port 8000 if free for LimboMedia. I'll run the update-rc scripts to make it permanent later after playing around some more.

Now to run that command and find out what's going on port 8000 on the other 2 boxes. :)

T3RM1NVT0R 04-13-2015 04:27 PM

You're welcome.

Yup, that command works for me when troubleshooting such issues. Initially when you mentioned that you ran netstat I thought you already saw that. However, from the subsequent post I thought it will be good to have that output to see what is using it.

Please mark the thread as solved!

Enjoy Linux!!!


All times are GMT -5. The time now is 12:46 PM.