Managing cron entries in syslog

Published on Author adventurerLeave a comment

In the latest Raspbian distributions the default syslog configuration writes cron messages, including success messages, in to /var/log/syslog. To eliminate this, edit /etc/rsyslog.conf % sudo vi /etc/rsyslog.conf uncomment the line for /var/log/cron.log, and add cron as an exclusion to /var/log/syslog as follows: cron,* /var/log/cron *.*, cron,auth,authpriv.none /var/log/syslog and then force a restart of syslog using… Continue reading Managing cron entries in syslog

Hosting WordPress sites on t2.nano instances

Published on Author adventurerLeave a comment

Since AWS have now introduced a t2.nano instance, it is even cheaper to run a single instance for very low volume services, which don’t need the CPU performance of a t2.micro. However one thing to watch out for is memory – t2.nano instances only come with 512Mb of RAM, and I found that the mysqld… Continue reading Hosting WordPress sites on t2.nano instances

RaspberryPi: Running a Python script on boot

Published on Author adventurerLeave a comment

To run a script called myproject/myscript.py on boot, first create the script and ensure it has execute permissions. Then create a config file for systemctl as follows: % sudo vi /lib/systemd/system/myscript.service containing the following [Unit] Description=My Script After=multi-user.target [Service] Type=idle ExecStart=/usr/bin/python /home/pi/myproject/myscript.py [Install] WantedBy=multi-user.target Set the correct permissions on the config file % sudo chmod… Continue reading RaspberryPi: Running a Python script on boot

Adding the vhost to the Apache access_log

Published on Author adventurerLeave a comment

If you are using Apache to host multiple sites with virtual hosting or vhosts, then by default the log output will not show which sites each log entry refers to. To change this edit the following in /etc/httpd/conf/httpd.conf: LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”” combined  to read: LogFormat “%h %l %u… Continue reading Adding the vhost to the Apache access_log

LAMP with php 5.4 and Apache 2.4

Published on Author adventurerLeave a comment

After having a few issues with my t1.micro instance running out of memory and causing the hosted sites to become unavailable, I looked in to the reasons why. According to this post and this post a key culprit is the use of the somewhat outdated PHP 5.3, and upgrading to PHP 5.4 significantly reduces memory usage. Unfortunately… Continue reading LAMP with php 5.4 and Apache 2.4