[APP] micro-httpd (GET / POST / CGI support) cross-compiled to Android

Search This thread

viulian

Inactive Recognized Developer
Apr 6, 2011
419
411
hex.ro
Hello,

A while ago I've managed to cross-compile a basic web server, resulting in a native ARM executable (you can find it here) that allows any other device to connect to port 80 (or whatever) and browse the contents of the phone.
Easy to exchange photos at a cafeteria which has wifi and both phones are connected - for example. No need for an FTP client, slow bluetooth, and so on...

However, I wanted more :) and since webserver was only handling GET (no POST / no CGI), I've started looking for an alternative that did the job.

Below, you will find a native ARM executable of micro-httpd, a light weight web server that supports CGI.

Download

Use it at your own risk!


mini_httpd_1.19.arm.tar.gz


It supports .htpasswd files to restrict access to folders - and it comes also with its own utility htpasswd which manipulates the password files.

micro-httpd website: http://www.acme.com/software/mini_httpd/
micro-httpd configuration options: http://manpages.ubuntu.com/manpages/maverick/man8/mini-httpd.8.html

You can use almost any CGI interpreter you want, minus PHP. The PHP 4 Android (a native implementation of PHP) has only CLI (command line support) and even if you could change the PHP code of the scripts to output the missing headers. BUT! It also outputs debug messages that you cannot control, in the output of the script!

Those messages are are considered errors in HTTP / CGI.
The creators of PHP interpreter say that is only meant for Scripting Languages for Android (SL4A) which works with what they have. You can read more here: http://groups.google.com/group/php-for-android/browse_thread/thread/79d0b5f856189675?pli=1. This topic also mentions an alternative (CGI this time) from GroomDroid but that is also unstable.

Enter PERL!

I had good success with Perl 4 Android :)

I can how host a blog on my phone - I've set up a big tutorial on how to configure everything here Running native CGI scripts (perl) with micro-httpd on Android.

Result

perl_running.png


Next step would be to try out a file manager and test file upload, then go even deeper to see if I can access various phone details and offer a sort of management interface for them on the web.

Source code

You will find the source code and the license (free) on the tutorial website above.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Hello,

    A while ago I've managed to cross-compile a basic web server, resulting in a native ARM executable (you can find it here) that allows any other device to connect to port 80 (or whatever) and browse the contents of the phone.
    Easy to exchange photos at a cafeteria which has wifi and both phones are connected - for example. No need for an FTP client, slow bluetooth, and so on...

    However, I wanted more :) and since webserver was only handling GET (no POST / no CGI), I've started looking for an alternative that did the job.

    Below, you will find a native ARM executable of micro-httpd, a light weight web server that supports CGI.

    Download

    Use it at your own risk!


    mini_httpd_1.19.arm.tar.gz


    It supports .htpasswd files to restrict access to folders - and it comes also with its own utility htpasswd which manipulates the password files.

    micro-httpd website: http://www.acme.com/software/mini_httpd/
    micro-httpd configuration options: http://manpages.ubuntu.com/manpages/maverick/man8/mini-httpd.8.html

    You can use almost any CGI interpreter you want, minus PHP. The PHP 4 Android (a native implementation of PHP) has only CLI (command line support) and even if you could change the PHP code of the scripts to output the missing headers. BUT! It also outputs debug messages that you cannot control, in the output of the script!

    Those messages are are considered errors in HTTP / CGI.
    The creators of PHP interpreter say that is only meant for Scripting Languages for Android (SL4A) which works with what they have. You can read more here: http://groups.google.com/group/php-for-android/browse_thread/thread/79d0b5f856189675?pli=1. This topic also mentions an alternative (CGI this time) from GroomDroid but that is also unstable.

    Enter PERL!

    I had good success with Perl 4 Android :)

    I can how host a blog on my phone - I've set up a big tutorial on how to configure everything here Running native CGI scripts (perl) with micro-httpd on Android.

    Result

    perl_running.png


    Next step would be to try out a file manager and test file upload, then go even deeper to see if I can access various phone details and offer a sort of management interface for them on the web.

    Source code

    You will find the source code and the license (free) on the tutorial website above.