How to run httpd on android?
I would like to run a web server on Android.
Then, how can I run a开发者_如何转开发 httpd service on Android?
Thanks.
There's no need to compile httpd for Android. Just install BusyBox (httpd comes with it) and you'll be able to use it. Also install any terminal emulator + root access. Next step:
$ su
# httpd -h /path/to/the/www
(Type it in the terminal emulator)
The $ sign means you're typing this command as user, # - as root. Then, next:
# httpd start
That's all! If you've placed index.html (index.php) in the right directory, it'll show up right after entering ip_of_the_phone(:80). I haven't discovered yet how to change hostname in the LAN, so you can use IP instead.
You could try the kWS web server:
I just ported it but it is untested but it might work. I used a custom built GCC 4.6.1 toolchain to compile it. Had to change the classes and took out some crypto but it should just be a matter of uploading via ssh and running. Of course unmounting your SDcard will crash it.
Maybe someone can work off my code.
http://code.google.com/p/apache-android-httpd
精彩评论