HTTP Server for Embedded Systems with Busybox

Busybox has a built-in httpd server. Just turn it on, enable CGI and authorization etc, enable remote-port in env. Start the httpd. It works!

The tricky part comes with how to configure it. A quick fix is here:

Create the user account apach in /etc/passwd:
and in /etc/group
and in /etc/shadow:
Change the ownership of /www and /etc/httpd.conf to apach:
chown apach:apach /etc/httpd.conf
chown -R apach:apach /www

By default, it will look for /etc/httpd.conf for setup information Here is a sample httpd.conf

A:172.30. #Allow address from
D:* # Deny from any other IP connections
/cgi-bin:wli:123456 #require user wli, password on url starting with /cgi-bin

The following is a sample CGI script. Make sure the script has executable permission.

echo "Content-type: text/plain"
echo "\r\n"
echo ""
echo "Sample CGI Output"
echo ""
echo ""
echo ""
echo ""

It’s that simple!

Or, take a look at more details on this openwrt page.


About minghuasweblog

a long time coder
This entry was posted in All, C/C++, LAMP and Drupal and tagged , , , , . Bookmark the permalink.

One Response to HTTP Server for Embedded Systems with Busybox

  1. Pingback: Web Application Backend by Busybox HTTP Server | minghuasweblog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s