Archive

Archive for September, 2012

Add logrotate to unbound nameserver – Debian Squeeze

September 26, 2012 Comments off

You can add logrotate to your unbound nameserver. Just create a file named unbound and place it in /etc/logrotate.d.

File contents below:

/var/log/unbound.log {
rotate 12
weekly
compress
missingok
notifempty
postrotate
/etc/init.d/unbound restart
endscript
}

Categories: sysadmin

Install apache2 mpm worker and php5-fpm on Debian/Ubuntu

September 4, 2012 Comments off

To install apache2-mpm-worker with php5-fpm support just apt-get install apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapache2-mom-fastcgi php5-fpm.

Create a php5-fpm.conf (or whatever .conf) and add it to /etc/apache2/conf.d. My file contains this (includes cgi support). After installing the above do a2enmod fastcgi and add the below php5-fpm.conf file to /etc/apache2/conf.d

##php5-fpm.conf ###

<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
</IfModule>
<IfModule mod_alias.c>
ScriptAlias /cgi-bin/ /var/www/cgi-bin/

<Directory /var/www/cgi-bin/>
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule mod_actions.c>
Action application/x-httpd-php /cgi-bin/php5
</IfModule>

Also add this to /etc/php5/fpm/pool.d/www.conf

listen = /var/run/php5-fpm.sock

You should be able to restart apache2 and start php5-fpm and have php support. The same setup also works for nginx.

Categories: sysadmin