WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Busybox-httpd - how is a non-default port set?  (Read 3491 times)

Offline Joe_H

  • Newbie
  • *
  • Posts: 16
Busybox-httpd - how is a non-default port set?
« on: April 03, 2020, 01:29:20 PM »
Hi, I've spent a frustrating few hours trying to get the downloaded busybox-httpd.tcz to listen on a port other than 80. I know it is supposed to be -p 8080 called with the service but that isn't working. I've tried -port 8080 -P 8080 etc. and it doesn't read any of the options at all (I've tried others such as -f or -v and they don't work either) . How exactly is the service run with the options? I am calling the service with sudo busybox-httpd (+ attempted options) as it won't permit me without sudo. I wrote a config file /etc/httpd.conf and tried some combinations there but cannot find syntax of how to set the port in the conf file either. The service starts but it is always listening on port 80. Any help would be greatly appreciated. Thanks.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Busybox-httpd - how is a non-default port set?
« Reply #1 on: April 03, 2020, 03:13:06 PM »
Hi Joe_H
You did read the  .info  file:
http://tinycorelinux.net/11.x/x86/tcz/busybox-httpd.tcz.info

Offline moB

  • Newbie
  • *
  • Posts: 49
Re: Busybox-httpd - how is a non-default port set?
« Reply #2 on: April 03, 2020, 04:19:06 PM »
A few things one might overlook comes to mind.

1. Have you tried specifying the IP with the port (-p IP:port) setting?
        http://server.ip:8080

2. Multiple instances can run at once, with different configs. have you killed instances with "wrong" config option?

One must stop and restart  web server for changes to have effect.

3. Are you, as Rich wrote, compliant with TC docs for your version?
(Don't mean to hammer things too much.)


Take it easy and enjoy TC and the workout using it can be. Makes you strong :-)

Hope you solve it!

Offline Joe_H

  • Newbie
  • *
  • Posts: 16
Re: Busybox-httpd - how is a non-default port set?
« Reply #3 on: April 03, 2020, 06:37:33 PM »
Thanks guys. The version installed is 1.24.2 which I downloaded through the normal repository. The info file for it is different. I tried the start method in the one you pointed to but it doesn't work. I opened the archive and the only file it contains is /usr/local/sbin/busybox-httpd.

It doesn't accept any options as I tried -p -f -v etc. I also tried the ip:port format. I notice in ps whatever I add as an option that it is part of the name of the process running (whatever it is even if it is nonsense).

At this stage I think I will compile my own httpd from busybox  to see if that fixes it.  I haven't been using the start-stop-daemon function and will give that a last try also.

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Busybox-httpd - how is a non-default port set?
« Reply #4 on: April 03, 2020, 06:40:26 PM »
hi Joe_H,

piCorePlayer has been using httpd for many years without a problem. We have found it works as designed.

We have stop using busybox-httpd.tcz but it used to work fine.
« Last Edit: April 03, 2020, 06:43:37 PM by Greg Erskine »

Offline Joe_H

  • Newbie
  • *
  • Posts: 16
Re: Busybox-httpd - how is a non-default port set?
« Reply #5 on: April 03, 2020, 06:47:22 PM »
Yes it is working but on port 80 only (at least for me). The only issue I'm having is with the command line options which are not being accepted and I cannot figure out why.

I haven't been using start-stop-daemon to start it though (sources I referenced didn't specifically state it) but was using it to stop the service when I was retrying it with other options. The conf file is being read but I cannot see where the port can be set in it.

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Busybox-httpd - how is a non-default port set?
« Reply #6 on: April 03, 2020, 07:41:02 PM »
I have always put the -p on the command line with all other settings in the config file.

Have you see this?

https://git.busybox.net/busybox/tree/networking/httpd.c

We do use start-stop-daemon but I don't think that is a factor.

We don't use exactly your setup as we compile httpd into busybox, again that shouldn't matter. We originally used standard piCore for many years and httpd always worked the same. YMMV.

Offline Joe_H

  • Newbie
  • *
  • Posts: 16
Re: Busybox-httpd - how is a non-default port set?
« Reply #7 on: April 05, 2020, 09:29:07 AM »
Thanks guys for the assistance. I compiled my own httpd from busybox and made an extension for it, loaded it up and it works absolutely fine with the port and other command line settings working. I don't know why the repository version (1.24.2) won't do so. Should it be flagged as a problem?