This guide covers the build instructions for stand-alone web server.
See Embedding.md for information on extending an application.
https://github.com/sunsetbrew/civetweb
Open the VS2012/civetweb.sln in Visual Studio.
make help
Get help
make build
compile the code
make install
Install on the system, Linux only.
make clean
Clean up the mess
Make options can be set on the command line with the make command like so.
make build WITH_LUA=1
Make Options | Description |
---|---|
WITH_LUA=1 | build with LUA support |
WITH_DEBUG=1 | build with GDB debug support |
WITH_IPV6=1 | with IPV6 support |
WITH_WEBSOCKET=1 | build with web socket support |
CONFIG_FILE=file | use 'file' as the config file |
CONFIG_FILE2=file | use 'file' as the backup config file |
SSL_LIB=libssl.so.0 | use versioned SSL library |
CRYPTO_LIB=libcrypto.so.0 | system versioned CRYPTO library |
PREFIX=/usr/local | sets the install directory |
COPT='-DNO_SSL' | method to insert compile flags |
Compile flags can be set using the COPT make option like so.
make build COPT="-DNDEBUG -DNO_CGI"
Compile Flags | Description |
---|---|
NDEBUG | strip off all debug code |
DEBUG | build debug version (very noisy) |
NO_CGI | disable CGI support |
NO_SSL | disable SSL functionality |
NO_SSL_DL | link against system libssl library |
Take total control with CC, COPTS and TARGET_OS as make options. TARGET_OS is used to determine some compile details as will as code function. TARGET_OS values should be be one found in build/Makefile.in-os.
make CC=arm-none-linux-gnueabi-gcc COPT="-march=armv7-a -mfpu=vfp -mfloat-abi=softfp" TARGET_OS=FROG
Use the alternate Makefile.osx to do the build. The entire build has to be done using Makefile.osx because additional compile and link options are required. This Makefile has all the same options as the other one plus one additional package rule.
make -f Makefile.osx package
This is a small guide to help you run civetweb on Android. Currently it is tested on the HTC Wildfire. If you have managed to run it on other devices as well, please comment or drop an email in the mailing list. Note : You dont need root access to run civetweb on Android.
/path-to-ndk/ndk-build -C /path-to-civetweb/build
That should generate civetweb/lib/armeabi/civetweb/data/local
folder on device./data/local
and execute ./civetweb
.http://127.0.0.1:8080
You should see the Index of /
page.Notes:
jni
stands for Java Native Interface. Read up on Android NDK if you want
to know how to interact with the native C functions of civetweb in Android
Java applications.