Project

General

Profile

[Solved] Lighttpd 1.4.45 for Windows

Added by Ariel_MX almost 7 years ago

Hello,

I compiled the version 1.4.45 with a cygwin eviroment, made some changes based on the latest patch made by dtech(.hu) Software Solutions for the 1.4.39 package they distributed.

I used as a base the same directory structure of the 1.4.39 package and included the "service" folder with its original programs to install LightTPD as a service.

Included also a rrdtool binary and libraries and a "data" folder GeoIP (configuration included for those two modules in the lighttpd.conf (disabled)).

The details of the package are in the "PACKINFO.txt" file.

I'm not an expert nor a programmer, but I wanted to share what I did, just in case someone wants to try it.

The changes of the source code are in the file LightTPD-1.4.45-1-IPv6-Win32-Stage1-base.patch

And there is also a LightTPD-1.4.45-win32-IPv6.md5 checksum file for the LightTPD-1.4.45-win32-IPv6.zip.

Link to download:

https://lighttpd.et.com.mx/


Replies (4)

RE: LightTPD 1.4.45 for Windows. - Added by gstrauss almost 7 years ago

Thanks for the contribution. (Note: I have not tried it. Buyer beware and all that good stuff.)

Regarding your patch, please note that all of the "camelcase" changes in the patch are incorrect, have always been incorrect, and are noise that should be removed. "lighttpd" is spelled "lighttpd", not "LightTPD" (incorrect). lighttpd is a "light" "http" daemon => "lighttpd". "TPD" has no meaning that I know of.

FYI: lighttpd git master compiles under cygwin and runs fine for me, while including nothing from the dtech patch. (lighttpd git master includes -lcom_err for compiling mod_authn_gssapi) What parts of your patch are really truly needed? Can you provide some examples of how to reproduce the error trace that the patch purportedly fixes?

RE: LightTPD 1.4.45 for Windows. - Added by Ariel_MX almost 7 years ago

Hi, thanks for your comment.

I'll correct (I'll not change on the original sources) the changes related to uppercasing, in fact I didn't really understand why the patch from dtech changes lighttpd for LightTPD, or things like memcached for Memcached, etc. I thought it was correct.

The inclusion of the library com_err in the configure file was made by me, because when I was trying to compile with kerberos5 (--with-krb5), I received the error:

.libs/mod_authn_gssapi.o: In function `mod_authn_gssapi_log_krb5_error':
/home/Ariel/lighttpd-1.4.45-mod/src/mod_authn_gssapi.c:210: undefined reference to `error_message'
collect2: error: ld returned 1 exit status

I used the source code downloaded from www.lighttpd.net (not cloned with git).

I think the interesting things about the patch, are the parts that modify the way in which lighttpd looks for a default configuration file without the need to specify one, the path and drive letter fixes, and where it looks for modules (modules directory).

The good thing of having a package for Windows, is the ability to just unzip it and run it from a Windows command prompt or as a system service, without the need to have a cygwin enviroment.

RE: LightTPD 1.4.45 for Windows. - Added by gstrauss almost 7 years ago

I think the interesting things about the patch, are the parts that modify the way in which lighttpd looks for a default configuration file without the need to specify one, the path and drive letter fixes, and where it looks for modules (modules directory).

You do not need to patch the source to specify the modules directory. Just ./configure --libdir=modules ...

Regarding looking for a configuration file without needing to specify one, as well as specifying library dir, both can easily be done in a short batch file or shell script using the -f and -m flags to lighttpd. Such a one-line script could even be included in your binary package.

Regarding the path and drive letter fixes in the patch, do you have any examples why this is needed? Use unix-style paths in lighttpd.conf, instead of Windows drive letter and backslash paths.

The good thing of having a package for Windows, is the ability to just unzip it and run it from a Windows command prompt or as a system service, without the need to have a cygwin enviroment.

While convenient, it is also not very secure. You are providing a binary executable that someone will supposedly download and might run with administrative or other elevated privileges. Your intentions are probably good -- and I applaud that you provided the source code patch with instructions in PACKINFO.txt -- but as I said before: buyer beware for anyone that simply downloads and executes random binaries from the internet, especially if executing such untrusted binaries with elevated privileges.

RE: LightTPD 1.4.45 for Windows. - Added by gstrauss almost 7 years ago

If you are building lighttpd git master, (or the upcoming lighttpd 1.4.46 or later), here is a lighttpd.sh which you can execute with bash.exe, which ships with Windows 10. Should be easy to convert to .bat if needed, and modern cmd shells will pass along /paths/with/slashes (instead of backslashes) just fine. The script entirely obviates the need to patch the source code to build under cygwin and run lighttpd.exe outside cygwin as long as you use unix-style paths on the command line and in the configuration file. Just modify to 'cd' or specify paths to lighttpd.exe, conf/lighttpd.conf and modules dirs. The only thing this script does not do which your patch does is to provide -? as a optional command line argument in addition to -h for help.

#!bash.exe
export CYGWIN=nodosfilewarning
#cd /path/to/lighttpd/bin
exec ./lighttpd.exe -D -f conf/lighttpd.conf -m modules

    (1-4/4)