Support » Fixing WordPress » lighttpd support?

  • Does anyone have any experience setting up wordpress under lighttpd (it’s a fast lightweight open source web server, currently picking up some steam).?

    I’ve got things working with the exception of permalinks – I seem to be unable to get them to work.


Viewing 14 replies - 1 through 14 (of 14 total)
  • No, but I’d be interested to hear about this. Been looking at thttpd, and lighttpd looks to be more functional (maybe somewhat slower in certain cases), still faster than apache overall.

    I want something other than apache that can run on a VPS with more restrictive memory, and ALSO better handle a slashdot attack of lots of hits per second.


    Try this in the lighttpd config:

    server.error-handler-404 = "/index.php?error=404"

    That should handle permalinks without the need for rewrite rules.

    Thread on hackers list.

    Thread Starter hallow


    The error page is nice and everything, but I have a gallery2 installation running alongside wordpress. So it the error handler would work for wordpress, but not g2.

    I have a linode 96 (96MB of ram), and have lighttpd, php, and mysql running with about 8MB of ram left over. lighttpd uses about 2MB of ram total.

    PHP… well… lets just say, that’s where most of the ram is going.

    But it does seem to run a lot faster than my comparable apache2 installation. Any tips on reducing PHP’s memory consumption would be appreciated (like any modules I can leave out and still have it fully functioning for wordpress and g2).


    Mem: 91416k total, 82752k used, 8664k free, 2256k buffers
    Swap: 525304k total, 836k used, 524468k free, 32500k cached


    procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
    r b swpd free buff cache si so bi bo in cs us sy id wa
    0 0 836 8320 2276 32580 0 0 2 3 30 7 0 0 100 0

    pmap on php process

    28845: /usr/local/lighttpd/php/bin/php
    08048000 2064K r-x-- /php
    0824c000 884K rw--- /php
    08329000 8328K rwx-- [ anon ]
    40000000 84K r-x-- /
    40015000 4K rw--- /
    4001c000 4K rw--- [ anon ]
    4001d000 20K r-x-- /
    40022000 4K rw--- /
    40023000 156K rw--- [ anon ]
    4004a000 56K r-x-- /
    40058000 4K rw--- /
    40059000 64K r-x-- /
    40069000 4K rw--- /
    4006a000 128K r-x-- /
    4008a000 4K rw--- /
    4008b000 108K r-x-- /
    400a6000 12K rw--- /
    400a9000 4K r-x-- /
    400aa000 4K rw--- /
    400ab000 4K rw--- [ anon ]
    400ac000 544K r-x-- /
    40134000 56K rw--- /
    40142000 4K rw--- [ anon ]
    40143000 116K r-x-- /
    40160000 4K rw--- /
    40161000 164K r-x-- /
    4018a000 12K rw--- /
    4018d000 24K rw--- [ anon ]
    40193000 24K r-x-- /
    40199000 4K rw--- /
    4019a000 88K r-x-- /
    401b0000 124K rw--- /
    401cf000 16K rw--- [ anon ]
    401d3000 136K r-x-- /
    401f5000 4K rw--- /
    401f6000 4K rw--- [ anon ]
    401f7000 392K r-x-- /
    40259000 28K rw--- /
    40260000 760K r-x-- /
    4031e000 12K rw--- /
    40321000 56K r-x-- /
    4032f000 4K rw--- /
    40330000 112K r-x-- /
    4034c000 4K rw--- /
    4034d000 56K r-x-- /
    4035b000 4K rw--- /
    4035c000 8K rw--- [ anon ]
    4035e000 8K r-x-- /
    40360000 4K rw--- /
    40361000 4K rw--- [ anon ]
    40362000 68K r-x-- /
    40373000 4K rw--- /
    40374000 8K rw--- [ anon ]
    40376000 32K r-x-- /
    4037e000 4K rw--- /
    4037f000 12K r-x-- /
    40382000 4K rw--- /
    40383000 192K r-x-- /
    403b3000 4K rw--- /
    403b4000 896K r-x-- /
    40494000 32K rw--- /
    4049c000 36K rw--- [ anon ]
    404a5000 52K r-x-- /
    404b2000 8K rw--- /
    404b4000 268K rw--- [ anon ]
    404f7000 1152K r-x-- /
    40617000 32K rw--- /
    4061f000 8K rw--- [ anon ]
    40621000 636K r-x-- /
    406c0000 88K rw--- /
    406d6000 20K rw--- [ anon ]
    406db000 32K r-x-- /
    406e3000 4K rw--- /
    406e4000 4K rw--- [ anon ]
    406e5000 152K r-x-- /
    4070b000 8K rw--- /
    4070d000 1024K rw-s- [ shmid=0x228001 ]
    4085d000 2088588K rwx-- [ stack ]
    total 2108084K

    (a linode specific thing, keeps a virtual server from throttling the disk)

    io_count=1606454 io_rate=0 io_tokens=400000 token_refill=512 token_max=400000

    — since io_tokens==token_max, i’m using very little io, so this means I’m not hitting swap very often at all.

    Thread Starter hallow


    Ahh, the hackers thread is exactly what I needed. I was able to extrapolate that for search, comments, and page as well. I might have to do some more work to get feed links going again. Thanks!

    Thread Starter hallow


    Nope, feed links were just as easy.

    The problem using the server.error-handler-404 method in lighttpd is that the server returns the Server Response Code: 404.

    To get this to work right I had to change wp-blog-header.php near line 190…

    I added somthing like this:

    /**** MY HACK *****/
    @header(‘Status: 200 OK’);

    I was able to get lighttpd to rewrite my permalinks the way I want.
    I have not tested feeds, but everything else seems to work.

    or to test the rewrite:

    I run Lighttpd and WordPress 1.5 on with permalink structure:
    You may read my lighttp rewrite rules on:

    You can also check for some information – it seems to be a WordPress port specifically intended for LightTPD use.

    I checked out the site and unless I’m missing something, the “light” in lightpress means “optimized.” It’s supposed to be faster, leaner than wordpress.

    There’s an attempt to make it work on lighttpd, but that’s still in development stages.

    I’d be concerned about plugin compatibility.

    Having said that, I would be very interested in a lightpress mu.

    I added

    server.error-handler-404 = "/index.php"

    to my lighttpd config

    this worked fine without the hack to wp-blog-header.php mentioned above

    (i.e. was getting 200 OK status codes for good pages)



    simple rewrite rule for getting permalinks of the form:
    working with lighttpd.

    url.rewrite = ( “^(/[0-9]{4}/.*)” => “/index.php/$1” )

    it picks up on the /2006/… and makes it /index.php/2006/….
    it should probably look for the month and day to be extra-sure, but this works well enough.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘lighttpd support?’ is closed to new replies.