removing busybox-httpd to install other web server

When installing another web server you might run into problems, because by default the busybox-httpd is already started and port 80 is in use.

You might try to patch busybox to disable the httpd applet, but some other tools depending on it might fail (even fail to compile).

Another solution is to disable automatic startup of busybox-httpd (while keeping the binary in the busybox) such that you are able to start your own web server.

Example after beeing logged into Linux:

root@ccimx6ulsbc:~# ps|grep http
  750 root      2904 S    /usr/sbin/httpd -h /srv/www

root@ccimx6ulsbc:~# netstat -nlp
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:21              0.0.0.0:*               LISTEN      802/vsftpd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      611/dropbear
tcp        0      0 :::80                   :::*                    LISTEN      750/httpd
tcp        0      0 :::22                   :::*                    LISTEN      611/dropbear

root@ccimx6ulsbc:~# find /etc/ -iname \*httpd\* -exec ls -l {} \;
-rwxr-xr-x    1 root     root           747 Jul 27 21:38 /etc/init.d/busybox-httpd
lrwxrwxrwx    1 root     root            23 Jul 27 22:18 /etc/rc0.d/K20busybox-httpd -> ../init.d/busybox-httpd
lrwxrwxrwx    1 root     root            23 Jul 27 22:18 /etc/rc1.d/K20busybox-httpd -> ../init.d/busybox-httpd
lrwxrwxrwx    1 root     root            23 Jul 27 22:18 /etc/rc2.d/S20busybox-httpd -> ../init.d/busybox-httpd
lrwxrwxrwx    1 root     root            23 Jul 27 22:18 /etc/rc3.d/S20busybox-httpd -> ../init.d/busybox-httpd
lrwxrwxrwx    1 root     root            23 Jul 27 22:18 /etc/rc4.d/S20busybox-httpd -> ../init.d/busybox-httpd
lrwxrwxrwx    1 root     root            23 Jul 27 22:18 /etc/rc5.d/S20busybox-httpd -> ../init.d/busybox-httpd
lrwxrwxrwx    1 root     root            23 Jul 27 22:18 /etc/rc6.d/K20busybox-httpd -> ../init.d/busybox-httpd

Since the /etc/rc?.d/S20busybox-httpd startup scripts are all linking to /etc/init.d/busybox-httpd, just remove or rename this file, such that during next boot it will not be found any more, so busybox-httpd will not be started:

# mv /etc/init.d/busybox-httpd /etc/init.d/busybox-httpd.old

# reboot


Last updated: Jun 11, 2019

Filed Under

Embedded

Recently Viewed

No recently viewed articles

Did you find this article helpful?