Archiv der Kategorie: sysadmin

Installing apache, fastcgi & php-fpm on dragonflybsd

We’­re cur­r­ent­ly in the pro­cess of tran­si­tio­ning our web ser­vers from Net­BSD to Dra­gon­flyBSD; along with that, we’­re also swit­ching our PHP plat­form to php-fpm. The­re are a few les­sons we lear­ned in the process. 

First: At least on Dra­gon­flyBSD 2.10, apache2 does not at all per­form well as apa­che-mpm-worker. Swit­ching to apa­che-mpm-pre­fork chan­ged our CPU load from 98% of apa­che to about 3 – 5% of apache.

Also, php-fpm was deli­vering too high a rate of 500 errors; this was not accep­ta­ble to our cus­to­mers. Inves­ti­ga­ti­ons into that lead me to the blog arti­cle at http://​alex​ca​bal​.com/​i​n​s​t​a​l​l​i​n​g​-​a​p​a​c​h​e​-​m​o​d​_​f​a​s​t​c​g​i​-​p​h​p​-​f​p​m​-​o​n​-​u​b​u​n​t​u​-​s​e​r​v​e​r​-​m​a​v​e​r​i​c​k​/​#​c​o​m​m​e​nts, which then sent me link-cha­sing to – ulti­mate­ly – http://​arti​cle​.gma​ne​.org/​g​m​a​n​e​.​c​o​m​p​.​w​e​b​.​f​a​s​t​c​g​i​.​d​e​v​e​l​/​2​514. This means we now have a set of local patches to our pkgsrc tree that incor­po­ra­te the patch from this pos­ting. At first sight, this seems to have impro­ved the situation. 

Mailman problems

For one of lists, one of the sub­scri­bers had the stran­gest pro­blem. He kept get­ting boun­ces that the list ali­as does not even exist, whilst at the same time other sub­scri­bers could well wri­te to that list. It turns out that his mail ser­ver was rewri­ting the To:-address, resol­ving the CNAME of the host­na­me that is respon­si­ble for run­ning the lists. As we run a vir­tu­al-domain based mail ser­ver, this was not a smart choice: Whilst the email address does inde­ed exist on the CNAME‑d host (lists​.xiqit​.de), it does not exist on the ful­ly qua­li­fied name the ser­ver lis­tens to. So we added an MX record for the host­na­me that also points to the ‚pri­ma­ry‘ name of the ser­ver (the one which the RDNS also resol­ves to), and now all is well. HIs email does reach the list. 

PowerDNS under MacOS X 10.6.4

Thanks to an ent­ry on LSD::RELOAD I was final­ly able to get power­dns to run on my MacOS X 10.6.4 system. 

Out of per­so­nal pre­fe­rence I wan­ted it to run with post­gres­ql ins­tead of mys­ql, so the­re was a litt­le figu­ring out invol­ved in how to get things going without the mys­ql dri­ver — appar­ent­ly, the make files only take one data­ba­se backend and do not com­pi­le mul­ti­ple dri­vers at the same time.

Also, secon­da­ry soft­ware omes from MacPorts, so paths had to be appro­pria­te­ly matched. And then, the­re was some hand-twea­king of Make­files becau­se ‑Bsta­tic, ‑Bdy­na­mic and ‑lcrypt war­rant spe­cial handling. 

This leads to the fol­lowing com­mand line: 

CXXFLAGS="-I/opt/local/include -DDARWIN" \
./configure --with-pgsql-lib=/opt/local/lib/postgresql84 \
--with-pgsql-includes=/opt/local/include/postgresql84 \
--prefix=/usr/local --with-modules="gpgsql"