Cherokee on Windows: improving the building environment

As it was anounced some time ago, Cherokee 0.8 will once again have a native Windows binary. We’ve been having a lot of requests because our Windows users haven’t had the chance to taste Cherokee-Admin since it was born.

Beware that the Windows build has to be taken with a grain of salt under Windows. A lot of work is still needed since some major changes -like a totally rewritten I/O cache, a lot more efficient and stable- will be coming by the time 0.8 is released.

Cherokee Webserver

These are the necessary steps to setup a suitable building environment.

Like Alvaro said in his blog, installing the whole bundle of needed tools is not trivial. In fact, there was a strange problem with the provided autotools (automake 1.8.2 and autoconf 2.59) of the previous environment that made us have to manually tweak things in order to successfuly finish the compilation of Cherokee. This has been tested on a Windows XP virtual machine.

This is what you need to install.

MinGW: minimalist GNU for Windows (GCC & binutils)

  • Download MinGW release 5.1.4 at the time of this writing.
  • Run it and select ‘Candidate’. Check base tools & g++
  • Install in a directory with no spaces (the default directory C:\MinGW is fine).

MSYS: Minimal SYStem

  • Download MSYS, tests were made with release 1.0.10
  • Install it in the same directory as MinGW (remove “1.0″ from the install path).
  • Answer y, y, c:/MinGW
  • You should add something like this to your ~/.profile to process your preferences:
if [ -f ${HOME}/.bashrc ] then
  . ${HOME}/.bashrc
fi

MSYS DTK: Dev Toolkit

  • Get DTK
  • Install it in the same path as above

Update Autoconf & Automake

  • Something strange happened as I said above, so I had to manually upgrade both to recent versions. I simply matched the ones I have in my Linux box and got it working. Afterwards I found packages with just that, so just install these autoconf and automake and you’re good to go.

Pthreads Win32: POSIX Threads

  • Cherokee will need these. Just download ftp://sourceware.org/pub/pthreads-win32/dll-latest/ and copy the appropriate files to /lib and /include

Python

  • You will need this, since both the build process and Cherokee-Admin use Python. Just download a Python Windows installer, remember to include the directory in your path environment variable, and you’re done
  • rxvt seems to be broken, which is most noticeable when you try to run Python interactively, so I just comment out its line in msys.bat.

Nice to have:

If you want to do something more than just building the binaries, you should also consider installing the usual tools: SVN, Emacs, gdb… Remember including them in your path.

Configuring and building:

After setting your environment you’ll have to change slighlty the configure command because there is still a problem with readdir_r. Hopefully it will be solved shortly.

./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
--enable-trace --enable-static-module=all --enable-static         \
--enable-shared=no --enable-beta --disable-readdir_r

And that should be it.

If you still have some kind of problem you could always try out this working bundle that I’ve just uploaded to cherokee-project.com and extract it in C:\, but I’m unsure if it would work before at least using the installers for MinGW and MSYS. I haven’t tried, but it wouldn’t surprise me if some DLLs were needed in specific places. After that, using my package should probably be OK. As I’ve said some times now, I don’t do Windows so I’m afraid I won’t be of much help here.

Have fun, and good luck. We’ll keep you informed.

UPDATE: If you’re still having trouble with this, Alvaro wrote an update to this that will hopefully be the last one we need.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

7 Comments »

 
  • [...] Cherokee Win32: Taher Shihadeh has been working really hard on the Windows port of Cherokee. Yesterday he explained how to set up a good enough software environment to compile the project, which it is not as easy as I may sound. Check it out at his post "Cherokee on Windows: improving the building environment". [...]

  • meikel says:

    I followed the tutorial and after a bit of trial and error cherokee compiled on my Win2003 SE Server (SP2) box, and even installed in the from me chosen directories :-)
    I get the welcome page, but I don’t get the admin page (503 Service Unavailable; Cherokee web server 0.8.0b (Win32), Port 9090)

    Any ideas?
    TIA for your help
    kind regards
    meikel

  • I’m afraid no ideas for the moment. Cherokee has just barely regained the ability to be built on Windows. Some major improvements came along since 0.5.4, and adapting things to run on Windows with native performance (i.e. Cygwin-free) isn’t as trivial as it might seem.

    I can only promise we’re working hard on this and it will be ready soon. In fact the only stoppers to release 0.8 right now are IO cache (huge leap in performance comming right away!) and the Windows build, which includes some Cherokee-Admin modifications.

  • found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later ..

  • Leaman says:

    Nice Post . . . I’m thinking about writing a reply actually or at least it got me thinking about some things I might want to write about . . .

  • smalltalkman says:

    when making , i got this error…

    In file included from ./unix4win32.h:37:0,
    from ./common-internal.h:32,
    from pcre/pcre_internal.h:49,
    from pcre/pcre_try_flipped.c:47:
    c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/ws2tcpip.h:272:13: 错
    误:声明指定了两个以上的数据类型
    In file included from ./common-internal.h:38:0,
    from pcre/pcre_internal.h:49,
    from pcre/pcre_try_flipped.c:47:
    ./error_log.h:55:0: 警告:“LOG_WARNING”重定义 [默认启用]
    ./unix4win32.h:82:0: 附注:这是先前定义的位置
    In file included from pcre/pcre_internal.h:49:0,
    from pcre/pcre_try_flipped.c:47:
    ./common-internal.h:93:21: 致命错误:sys/ipc.h:No such file or directory

    make[3]: *** [pcre_try_flipped.lo] Error 1
    make[3]: Leaving directory `/home/gym/cherokee-1.2.99b/cherokee’
    make[2]: *** [all] Error 2
    make[2]: Leaving directory `/home/gym/cherokee-1.2.99b/cherokee’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/gym/cherokee-1.2.99b’
    make: *** [all] Error 2

  • forexbroker says:

    dreadful panic. He could not doubt that some hostile Indians had be compared with the glory to come that shall be revealed in us. where the king and his grand vizier were at that time.

 

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>