• hallow

    (@hallow)


    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.

    Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)
  • davidchait

    (@davidchait)

    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.

    -d

    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

    (@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).

    Top:

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

    vmstat

    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-- /ld-2.3.2.so
    40015000 4K rw--- /ld-2.3.2.so
    4001c000 4K rw--- [ anon ]
    4001d000 20K r-x-- /libcrypt-2.3.2.so
    40022000 4K rw--- /libcrypt-2.3.2.so
    40023000 156K rw--- [ anon ]
    4004a000 56K r-x-- /libexslt.so.0.8.5
    40058000 4K rw--- /libexslt.so.0.8.5
    40059000 64K r-x-- /libz.so.1.2.1.1
    40069000 4K rw--- /libz.so.1.2.1.1
    4006a000 128K r-x-- /libm-2.3.2.so
    4008a000 4K rw--- /libm-2.3.2.so
    4008b000 108K r-x-- /libexpat.so.1.0.0
    400a6000 12K rw--- /libexpat.so.1.0.0
    400a9000 4K r-x-- /libpspell.so.15.0.3
    400aa000 4K rw--- /libpspell.so.15.0.3
    400ab000 4K rw--- [ anon ]
    400ac000 544K r-x-- /libaspell.so.15.0.3
    40134000 56K rw--- /libaspell.so.15.0.3
    40142000 4K rw--- [ anon ]
    40143000 116K r-x-- /libmhash.so.2.0.0
    40160000 4K rw--- /libmhash.so.2.0.0
    40161000 164K r-x-- /libmcrypt.so.4.4.7
    4018a000 12K rw--- /libmcrypt.so.4.4.7
    4018d000 24K rw--- [ anon ]
    40193000 24K r-x-- /libltdl.so.3.1.0
    40199000 4K rw--- /libltdl.so.3.1.0
    4019a000 88K r-x-- /libgd.so.2.0.23
    401b0000 124K rw--- /libgd.so.2.0.23
    401cf000 16K rw--- [ anon ]
    401d3000 136K r-x-- /libpng12.so.0.1.2.5
    401f5000 4K rw--- /libpng12.so.0.1.2.5
    401f6000 4K rw--- [ anon ]
    401f7000 392K r-x-- /libfreetype.so.6.3.5
    40259000 28K rw--- /libfreetype.so.6.3.5
    40260000 760K r-x-- /libX11.so.6.2
    4031e000 12K rw--- /libX11.so.6.2
    40321000 56K r-x-- /libXpm.so.4.11
    4032f000 4K rw--- /libXpm.so.4.11
    40330000 112K r-x-- /libjpeg.so.62.0.0
    4034c000 4K rw--- /libjpeg.so.62.0.0
    4034d000 56K r-x-- /libresolv-2.3.2.so
    4035b000 4K rw--- /libresolv-2.3.2.so
    4035c000 8K rw--- [ anon ]
    4035e000 8K r-x-- /libdl-2.3.2.so
    40360000 4K rw--- /libdl-2.3.2.so
    40361000 4K rw--- [ anon ]
    40362000 68K r-x-- /libnsl-2.3.2.so
    40373000 4K rw--- /libnsl-2.3.2.so
    40374000 8K rw--- [ anon ]
    40376000 32K r-x-- /libnss_files-2.3.2.so
    4037e000 4K rw--- /libnss_files-2.3.2.so
    4037f000 12K r-x-- /libnss_dns-2.3.2.so
    40382000 4K rw--- /libnss_dns-2.3.2.so
    40383000 192K r-x-- /libxslt.so.1.1.7
    403b3000 4K rw--- /libxslt.so.1.1.7
    403b4000 896K r-x-- /libxml2.so.2.6.11
    40494000 32K rw--- /libxml2.so.2.6.11
    4049c000 36K rw--- [ anon ]
    404a5000 52K r-x-- /libpthread-0.10.so
    404b2000 8K rw--- /libpthread-0.10.so
    404b4000 268K rw--- [ anon ]
    404f7000 1152K r-x-- /libc-2.3.2.so
    40617000 32K rw--- /libc-2.3.2.so
    4061f000 8K rw--- [ anon ]
    40621000 636K r-x-- /libstdc++.so.5.0.7
    406c0000 88K rw--- /libstdc++.so.5.0.7
    406d6000 20K rw--- [ anon ]
    406db000 32K r-x-- /libgcc_s.so.1
    406e3000 4K rw--- /libgcc_s.so.1
    406e4000 4K rw--- [ anon ]
    406e5000 152K r-x-- /eaccelerator.so
    4070b000 8K rw--- /eaccelerator.so
    4070d000 1024K rw-s- [ shmid=0x228001 ]
    4085d000 2088588K rwx-- [ stack ]
    total 2108084K

    /proc/io_status
    (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

    (@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

    (@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 *****/
    else
    @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.

    https://www.xyooj.com

    or to test the rewrite:

    https://www.xyooj.com/blog/plink/8/lighttpd-rewrite-wordpress-permalinks/

    I run Lighttpd and WordPress 1.5 on https://laitsas.com with permalink structure:
    /%category%/%post_id%/%postname%/
    You may read my lighttp rewrite rules on:
    https://laitsas.com/wordpress/3/rewrite-rules/

    You can also check https://lightpress.org/ 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:
    /%year%/%monthnum%/%day%/%postname%/
    working with lighttpd.

    /etc/lighttpd.conf:
    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.