WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Busybox-httpd.tcz for the piCore  (Read 7136 times)

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Busybox-httpd.tcz for the piCore
« on: April 28, 2014, 07:48:00 PM »
Hi,

Does anyone have the extension Busybox-httpd.tcz for piCore?

I have read through other threads concerning light weight http servers used for configuration purposes.

I have been experimenting with OliWeb but I am concerned because it is not popular it will soon stop development.

I couldn't compile Web Monkey or HTTPD myself as I now realise I don't have anywhere enough experience to fix compiling problems as they occur.

Mongoose doesn't include CGI in the free version.

The fact that HTTPD is a simple, small HTTP server that a standard module of Busybox makes it ideal, I think.

If there are detailed instructions for compiling just the HTTPD module from Busybox that would be even better. ;D

regards
Greg

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11330
Re: Busybox-httpd.tcz for the piCore
« Reply #1 on: April 28, 2014, 08:40:13 PM »

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Busybox-httpd.tcz for the piCore
« Reply #2 on: April 28, 2014, 09:44:09 PM »
Hi Rich,

I believe I have read through all the threads relating to this topic. I did a forum search and a web search. I have spent a few days working on this before asking.

The only Busybox-httpd.tcz I can find is for core not piCore.

Mongoose charges $5 a year for their CGI version. I need basic CGI and I like open solutions.

I am currently using OliWeb but I prefer a generic solution.

I have tried compiling a few for myself but hit a lack-of-knowledge brickwall.

regards

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11330
Re: Busybox-httpd.tcz for the piCore
« Reply #3 on: April 28, 2014, 11:31:05 PM »
Hi Greg Erskine
From the link I posted:
Mongoose supports CGI too
And it's already in the repository.

Offline imaad

  • Jr. Member
  • **
  • Posts: 70
  • stii ... nu intodeauna stii
Re: Busybox-httpd.tcz for the piCore
« Reply #4 on: April 29, 2014, 04:24:47 AM »
You can use apache2 to use CGI. You need to modify the httpd.conf where to find the cgi-bin folder.
You need also to add /usr/local/etc/httpd/httpd.conf to .filetool to save the configuration after reboot.
You must create an extension with your CGI files or to use backup to save CGI file. Personally I create an extension with CGI files.
Best regards,
imaad

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Busybox-httpd.tcz for the piCore
« Reply #5 on: April 29, 2014, 05:32:22 AM »

Mongoose charges $5 a year for their CGI version. I need basic CGI and I like open solutions.


Mongoose is GPL v2 licensed, see https://code.google.com/p/mongoose/ Source code is available. Never seen any charge or fee related to Mongoose. Where did you read it?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Busybox-httpd.tcz for the piCore
« Reply #6 on: April 29, 2014, 05:35:20 AM »
To compile BusyBox httpd is easy. Just edit .config and type make, make install and pack it. Of cource you need the GCC dev environment.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Busybox-httpd.tcz for the piCore
« Reply #7 on: April 29, 2014, 05:10:28 PM »
busybox-httpd.tcz added to repo
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Busybox-httpd.tcz for the piCore
« Reply #8 on: April 29, 2014, 06:02:40 PM »
Hi Greg Erskine
From the link I posted:
Mongoose supports CGI too
And it's already in the repository.

Thanks Rich

You can use apache2 to use CGI. You need to modify the httpd.conf where to find the cgi-bin folder.
You need also to add /usr/local/etc/httpd/httpd.conf to .filetool to save the configuration after reboot.
You must create an extension with your CGI files or to use backup to save CGI file. Personally I create an extension with CGI files.

Thanks imaad

Mongoose charges $5 a year for their CGI version. I need basic CGI and I like open solutions.
Mongoose is GPL v2 licensed, see https://code.google.com/p/mongoose/ Source code is available. Never seen any charge or fee related to Mongoose. Where did you read it?

Hi bmarkus,
http://cesanta.com/mongoose.shtml
I went to this download page before I found the source code. On a closer look the license scheme for  the binaries is different from the source code.

To compile BusyBox httpd is easy. Just edit .config and type make, make install and pack it. Of cource you need the GCC dev environment.

I just sat down to try this when I refreshed the page and saw your next post.  ;D

busybox-httpd.tcz added to repo

Thanks bmarkus.  :D I will try it today and report back.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Busybox-httpd.tcz for the piCore
« Reply #9 on: April 29, 2014, 06:42:15 PM »
Mongoose charges $5 a year for their CGI version. I need basic CGI and I like open solutions.
Mongoose is GPL v2 licensed, see https://code.google.com/p/mongoose/ Source code is available. Never seen any charge or fee related to Mongoose. Where did you read it?

Hi bmarkus,
http://cesanta.com/mongoose.shtml
I went to this download page before I found the source code. On a closer look the license scheme for  the binaries is different from the source code.


More precisely:

Quote
Mongoose is licensed under the terms of GNU GPL v.2 license.
Businesses have an option to get a non-restrictive, royalty-free license and professional support from Cesanta Software.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Busybox-httpd.tcz for the piCore
« Reply #10 on: May 02, 2014, 08:46:12 PM »
Thanks again bmarkus,

I have been testing busybox-httpd over the last few days and it seems to be working fine. I have changed most of piCorePlayer webUI from OliWeb to httpd. There is a major difference in the way they handle the $QUERY_STRING.

I did notice that the executable has changed its' name from "busybox-httpd" to just "httpd" at some time. Thanks for that. I prefer just httpd as it lines up with the "Into the Core" manual and other distributions. I would have asked you to do that but didn't want to push the friendship being a newbie.

One quirk I did notice with httpd, is it strips off the html code before the <head> tag (might be a CGI issue). This is not a problem for the purpose I am using it for but it does mean that the html code will not successfully validate using W3C Markup Validation Service.

I can see piCore becoming a significant Linux distribution for the Raspberry Pi.

regards
« Last Edit: May 02, 2014, 08:49:14 PM by Greg Erskine »

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Busybox-httpd.tcz for the piCore
« Reply #11 on: May 11, 2014, 05:24:20 AM »
Progress report...

Busybox httpd working great for my purposes.

Here's a simple startup script.

Note: Avoid using PID files.

Code: (bash) [Select]
#!/bin/sh
NAME="httpd"
DESC="Web server"
DAEMON=/usr/local/sbin/httpd
OPTIONS="-h /home/tc/www"

case "$1" in
    start)
        echo "Starting $DESC: $NAME..."
        start-stop-daemon --start --quiet -b --exec $DAEMON -- $OPTIONS
        ;;
    stop)
        echo "Stopping $DESC: $NAME..."
        start-stop-daemon --stop --quiet --exec $DAEMON
        ;;
    restart)
        echo "Restarting $DESC..."
        start-stop-daemon --stop --quiet --exec $DAEMON
        sleep 3
        start-stop-daemon --start --quiet -b --exec $DAEMON -- $OPTIONS
        ;;
    force)
        echo "Trying to force a restart of $NAME..."
        ps -ef | grep httpd | grep -v grep | awk '{ print $1 }' | xargs kill -9
        sleep 5
        start-stop-daemon --start --quiet -b --exec $DAEMON -- $OPTIONS
        ;;
    status)
        ps -ef | grep $DAEMON | grep -v grep | awk '{ print $0 }'
        ;;
    *)
        echo ""
        echo -e "Usage: /usr/local/etc/init.d/`basename $0` [start|stop|restart|force|status]"
        echo ""
        exit 1
        ;;
esac

exit 0


« Last Edit: May 11, 2014, 05:27:14 AM by Greg Erskine »