Project

General

Profile

DevelGit » History » Revision 19

Revision 18 (gstrauss, 2021-07-14 06:56) → Revision 19/20 (gstrauss, 2021-07-14 18:45)

 
 [[InstallFromSource|lighttpd h3. git source browser 

 View source code in the "lighttpd 1.4 git repository"://git.lighttpd.net/lighttpd/lighttpd1.4.git 


 h3. git source checkout 

 read-only: @$ git clone https://git.lighttpd.net/lighttpd/lighttpd1.4.git@ 
 developer: @$ git clone git+ssh://git@lighttpd.net/lighttpd/lighttpd1.4.git@ 


 h3. build prerequisites 

 lighttpd supports multiple build frameworks: automake, cmake, meson, and scons. 

 Ensure you have installed the latest development tools and packages available, e.g. for automake: 
 * autoconf 
 * automake 
 * libtool 
 * m4 

 A minimal lighttpd build instructions]] typically leverages PCRE and pkg-config  
 * pcre-devel / libpcre3-dev 
 * pkg-config 

 Optional lighttpd modules may require one or more additional libraries, e.g. choices among TLS modules 
 * openssl 
 * gnutls 
 * mbedtls 
 * nss 
 * wolfssl 

 Further details can be found in "lighttpd INSTALL"://git.lighttpd.net/lighttpd/lighttpd1.4/src/branch/master/INSTALL    *(Please read)* 


 h3. build commands (examples) 

 automake 
 <pre> 
 git clone https://git.lighttpd.net/lighttpd/lighttpd1.4.git 
 cd lighttpd1.4 
 ./autogen.sh 
 ./configure -C --prefix=/usr/local 
 make -j 4 
 make check 
 #sudo make install 
 </pre> 
 cmake 
 <pre> 
 git clone https://git.lighttpd.net/lighttpd/lighttpd1.4.git 
 cd lighttpd1.4 
 cmake -DCMAKE_INSTALL_PREFIX=/usr/local -Wno-dev . 
 make -j 4 
 make test 
 #sudo make install 
 </pre> 
 meson 
 <pre> 
 git clone https://git.lighttpd.net/lighttpd/lighttpd1.4.git 
 cd lighttpd1.4 
 meson setup --prefix /usr/local build 
 cd build 
 meson compile 
 meson test 
 #sudo meson install 
 </pre> 
 scons 
 <pre> 
 git clone https://git.lighttpd.net/lighttpd/lighttpd1.4.git 
 cd lighttpd1.4 
 scons -j 4 build_static=1 build_dynamic=0 prefix=/usr/local 
 #sudo scons -j 4 build_static=1 build_dynamic=0 prefix=/usr/local install 
 </pre> 
 Examples commands for more fully-featured builds might reference "lighttpd scripts/ci-build.sh"://git.lighttpd.net/lighttpd/lighttpd1.4/src/branch/master/scripts/ci-build.sh 
 Also, there are more options for [[RunningUnitTests|running unit tests]] 

 h3. distro packaging (external examples) 

 Debian: "debian/control":https://salsa.debian.org/debian/lighttpd/-/blob/master/debian/control 
 Fedora: "lighttpd.spec":https://src.fedoraproject.org/rpms/lighttpd/blob/rawhide/f/lighttpd.spec 
 OpenWRT: "net/lighttpd/Makefile":https://github.com/openwrt/packages/blob/master/net/lighttpd/Makefile 

 h3. running lighttpd from build tree 

 lighttpd can be run from the build tree, without needing to install it.    This is useful for testing.    In the shell in which you built lighttpd, chdir to the top of the source tree (if not already there). 
 Create a basic lighttpd.conf to listen on localhost port 8080 and serve files from @/tmp@ (not recommended for production use!): 
 <pre> 
 server.document-root = "/tmp" 
 server.bind = "127.0.0.1" 
 server.port = 8080 
 mimetype.assign = (".txt" => "text/plain", ".html" => "text/html" ) 
 </pre> 
 Create a simple file to serve: @echo "Hello World!" > /tmp/hello.txt@ 
 Run lighttpd in the foreground: @src/lighttpd -D -f lighttpd.conf -m $PWD/src/.libs@ 
 In a different shell: @curl http://127.0.0.1:8080/hello.txt@ 
 In the shell running lighttpd, press press @Ctrl-C@ to cause lighttpd to exit.