Laravel and Docker

Laravel is a PHP framework that makes building a web application faster (once you climb the mountain to learn it!)

Docker is the hosting environment that brings your ‘development’ and ‘production’ environments closer together.

Laradock is the glue holding them together.

Getting started with Laravel for Linux System Administrators

I recently had a go at learning Laravel.

I’m already very familiar with Linux servers as I ran a web hosting business. Yet all the Getting started documents seemed to assume I was unfamiliar and lead me down the path of using Vagrant on my Windows desktop

To use Laravel on a Linux web hosting account, all you actually need is composer. This is a PHP dependency manager, not unlike Yum or Apt-get you would use to manage packages on your server.

You can install composer with the standard package management. From there create a new Laravel project with

composer create-project –prefer-dist laravel/laravel blog

in the folder where you would like it created, where blog is the name of the new project.

This creates a project using the initial laravel files.

Once thats done you have a very basic laravel website ready to go. Place it behind an apache web server and you should see the logo of laravel.

Anouther important piece is the artisan file. This command line PHP script performs a few important functions such managing the associated database for the laravel site in an intelligent way.

Quick build a new Windows PC

Boxstarter offers a way to take a new PC with an internet connection and have it auto load software from a software respoistory. Here are some sample links I put together. You can view what they do by putting the loaded URL into a browser. The process works without any software loaded only in IE and Edge browsers.

Updated 11/3/2020: build and builddev to include Microsoft Edge and builddev to include Visual Studio Code


Hansen IT Solutions can provide a range of services.

Website development and ongoing maintenance

Search engine optimisation

Social media integration and management

SMB Desktop networking design, services and support

Internet connectivity

VoIP Telephony including PABX systems and integration

Custom programming services

Adding slave DNS servers for Plesk

There is a nice and simple extension for Plesk that allows you to setup slave DNS zones from Plesk domains automatically.

If your adding this to an existing server though its a little hit and miss if it will add existing domains. The instructions say you can do this via ‘Apply DNS template’ but this did not work for me. Adding new domains worked fine though.

I ended up writing this script and it worked great.
/usr/sbin/rndc -c /usr/local/psa/var/modules/slave-dns-manager/slave_*SLAVEIP*>.conf addzone $1 '{ type slave; file "db.'$1'"; masters { *MASTERIP*; }; };'

Replace *MASTERIP* and *SLAVEIP* with your own server IPs.

Usage from the command line is just needs a the DNS your setting up the slave with as the parameter

Taking it further there was a few hundred domains which didnt seem fun to type in one at a time so I used this script to loop over all the domains and add each one.


ADMIN_PASS=`cat /etc/psa/.psa.shadow`
MYSQL_BIN_D=`grep MYSQL_BIN_D /etc/psa/psa.conf | awk ‘{print $2}’`
mysql=”${MYSQL_BIN_D}/mysql -N -uadmin -p${ADMIN_PASS} psa”

query=”select name from domains;”
domains=`echo $query | $mysql `

for i in ${domains}; do
./ $i

from which was linked in the comments.

WHMCS and Plesk 12

If you are having problems, such as randomly not loading pages, running WHMCS on otherwise stock Plesk 12 server, try updating the install of ioncube. It seems the version installed with Plesk is a little older and doesnt quite work right with the current version of WHMCS.

Rsync backup CentOS server with email report

Running various business critical CentOS based Linux servers means good backups are a must. The ability to restore completely from backup to a DR site is a must.

To do this I keep a copy of the server backed up at root level on a locally hosted NAS.

A nightly rsync runs, with appropriate exlucsions that keeps a local copy of the system in sync. Data usage on the various Web/DNS/email servers I run works out to be around 50-200mb a night.

rm -f /var/log/sync/*

rsync -avzh –delete –stats  /store/backup/server1/ >/var/log/sync/server1 –exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs,usage/*}

tail /var/log/sync/* | mail -s “Server sync report”

add a rsync line for each server.

the rsync logs are kept in /var/log/sync. To know if it was a success I can monitor the email. As I’m really only interested in success/fail i use tail to only show me the last few lines of each log.

To restore, do a minimal install of the same CentOS version, install rsync, and rsync directly over root from the backup. Reboot to bring the new system back online as per the last backup.