HTTP Server Written in C for (embedded) Linux systems
httpd - (MAJOR_NUMBER).(YY).(MM)-(RELEASE_NUMBER_IN_MONTH)
Use the latest release zip files, they are stable. The main branch is not stable code.
This is a http server written in C/C++ Programming language, that support threads, session management using SQLITE3 db and dynamic pages using C/C++ plugins.
The main thread is used to assign tasks to the threadpool, throttle, send and receive static data while the threadpool is used to handle dynamic pages.
This application is meant to be used for embedded systems but there aren't any limitations on its usage as of now.
Supports HTTP HTTPS over IPv4 and IPv6.
It was written in 2007 by me. Currently cleaning up the code. Removing some features and adding new features.
0 threads = Only static file access = 30 MB
10 threads = 140MB
100 threads = 750MB
300 threads = 2.3GB
Memory grows as the session information increases
Anoop Kumar Narayanan
Bangalore
India
anoop.kumar.narayanan@gmail.com
GPLv2/GPLv3
- Supports HTTP 1.1, works with most modern browsers
- Supports Inbuilt Session Management for login pages
- Supports Multilevel administration pages ( super > root > admin )
- Supports Inbuilt sqlite3 database for use with plugins, with ability to disable plugins
- Supports Plugins based dynamic pages, write dynamic pages in c code
- Supports Multithreads for plugin execution, thread pool for dynamic page handling (configurable)
- Supports Chunked data transfer for dynamic pages.
- Supports GET and POST queries.
- Supports Large file upload through POST multipart (>= 5.0GB)
- Supports CppThreads (-DUSE_CPP11THREAD) and Pthreads ( -DUSE_PTHREAD)
- Supports thttpd like operation by setting threads to 0 during startup. Becomes a static http file server.
- Supports trivial DOS prevention.
- Supports both IPv4 and IPv6 sockets, http over IPv4 and IPv6 is now possible.
- Supports native SSL sockets.
make distclean
make
make install
cd /tmp/httpd/bin/
./httpdsrv.sh
log file httpd.log is generated in the same folder, and by default loglevel is set to 1 which is the lowest.
- Do not run from source folder, make install places code and webpages in /tmp/httpd/ and /tmp/var/ respectively.
- Pages/ folder is where the HTTP webpages are located.
- The sthtml pages are static html documents that can be served as common html documents to all users and do not require authentication.
- The html documents must have a suffix "username_", these documents requires auth and gets served only to appropriate users.
- Images like jpg, bmp and png are common files.
- Pages/router/ folder contains sample embedded router html documents without backend handlers.
- The pages login.html and public.html are the only two pages that do not require higher level authentication and can be accessed by the public.
- Plugins that comes with the product are only sample code and do not provide the security features needed by corporate and enterprise products.
- Scripts in the test folder are meant for stability testing and not performance testing.
- Downloads of static files are done on the main thread using poll (works like thttpd which i think uses select).
- Uploads using multipart form data are handled by the main thread using poll again and the content gets writing to a /tmp/post_%d.tmp, which remains open until deleted by the plugin developer.
when logged in as root
root.html -> root_root.html
image.jpg -> image.jpg
index.sthtml -> index.sthtml
login.xyz -> plugin liblogin.so dynamic page
p3.xyz -> plugin libp3.so dynamic page
When logged in as super
root.html -> super_root.html
image.jpg -> image.jpg
index.sthtml -> index.sthtml
login.xyz -> plugin liblogin.so dynamic page
p3.xyz -> plugin libp3.so dynamic page
admin / adminpassword
root / rootpassword
super / superpassword
Please change them on using this product.
Have a look at tests folder
Read TEST.txt
Read DEPENDENCY file.