Ubuntu Server – Apache 2.4 Upgrade Changes

As many of you may have noticed, upgrading to Apache 2.4 can either cause the “apache2” service to fail to start altogether or may render your websites more or less inoperable. Luckily, there are only a few minor changes to look for that will hopefully get you back up and running with a minimal period of downtime.

  1. During the upgrade, if you decided to keep your original versions of your config files like I did (always a good idea), you will then end up with some extra files with “.dpkg-dist” on the end of the filename. These are the latest version of the config files. As a best practice with any major config file changes, I would suggest to create a backup directory and get in the habit of copying any files with the date in the filename before you make changes. There have been many instances where this has come back to bite me in the past and I have learned my lesson over the years so save yourself some time, stress, and headaches.
    cd /etc/apache2
    mkdir backups
    mv apache2.conf backups/apache2.conf.09_25_2014
     Continue reading "Ubuntu Server – Apache 2.4 Upgrade Changes"

Linux – Policy-Based Routing Enables the Use of Multiple IP Default Gateways

Props to this site for the helpful info.

1. Configure your first static IP Address and Gateway information as normal inside of /etc/network/interfaces. If you have multiple static IP’s in the same subnet using the same gateway you should be fine to add them as sub-interfaces with no problems.

auto eth0
iface eth0 inet static
        address 1.1.1.1
        netmask 255.255.255.0
        network 1.1.1.0
        broadcast 1.1.1.255
        dns-nameservers 2.2.2.2 3.3.3.3
        dns-search yourdomain.com
 Continue reading "Linux – Policy-Based Routing Enables the Use of Multiple IP Default Gateways"

Install MySQL Activity Report from Source

MySQL Activity Report is a handy database reporting tool that uses RRD (Round Robin Database) to display hourly, daily, weekly, and monthly graphs and gives helpful performance tuning recommendations for your MySQL installation. Here are the steps to install it from source on Ubuntu Server 12.04.3 while logged in as root. This assumes that you have the build-essentials, header files, etc necessary to build software already installed.

1. Change into your local source directory

cd /usr/local/src

2. Download the source files for rrdtool and mysqlard

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.8.tar.gz
wget http://gert.sos.be/downloads/mysqlar/mysqlard-1.0.0.tar.gz

3. Unzip the files

tar -zxvf rrdtool-1.4.8.tar.gz
tar -zxvf mysqlard-1.0.0.tar.gz

4. Change into the rrd directory

cd rrdtool-1.4.8

5. Install dependencies

apt-get install libpango1.0-dev libxml2-dev

6. Build rrdtool (will install to the /opt/rrdtool-1.4.8 directory)
Continue reading “Install MySQL Activity Report from Source”

Bash Script – Move Asterisk Call Files into Spool Directory

After running into permission issues trying to get PHP’s shell_exec command to chown call files as the asterisk user(which only root can do), I decided to make this script.

As a side note, you should be able to get the shell_exec command to work using sudo by adding the www-data user to the sudoer’s file without a password but that wouldn’t work in my particular environment. The server I was working on was extremely outdated and didn’t even have sudo installed.

Add this to /etc/sudoers
www-data ALL=NOPASSWD: /path/to/script

The following code runs the script as a daemon. You will need to update rc to start this script at default run levels and also make sure to chmod +x this file to make it executable.

filename: /etc/init.d/mvcallfile

#!/bin/bash
# Move asterisk call file daemon startup script
# Author: Nathan Thomas

PROG=mvcallfile
 Continue reading "Bash Script – Move Asterisk Call Files into Spool Directory"

Startup Script for OpenMeetings Open-Source Video Conferencing Server

/etc/init.d/openmeetings startup script for Ubuntu Server 12.04.2
OpenMeetings Version 2.0-INCUBATING

A few notes:
– Make sure to change path for RED5_HOME variable
– Make sure to chmod +x the init script
– This assumes openmeetings is running under a user/group with the same name
– This assumes you are using libreoffice (not openoffice) for the whiteboard file import service

#!/bin/bash
#
# Author: Nathan Thomas
#
### BEGIN INIT INFO
# Provides:          red5
# Required-Start:    $local_fs $remote_fs $network $syslog $named $time
# Required-Stop:     $local_fs $remote_fs $network $syslog $named $time
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: Start/stop OpenMeetings java based conferencing webapp
### END INIT INFO
PROG=red5
DESC="Red5 flash streaming server"
RED5_HOME=/usr/local/openmeetings
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid
# Plugin Variables
#OO_HOME=/usr/lib/openoffice/program
OO_HOME=/usr/lib/libreoffice/program
 Continue reading "Startup Script for OpenMeetings Open-Source Video Conferencing Server"

Fixing 500 OOPS: vsftpd: refusing to run with writable root inside chroot ()

The latest upgrade on Ubuntu 12.04 updates vsftpd to version 2.3.5 and they have made a change that requires the chroot directory to no longer be writable which produces this error when trying to connect. They have made an option called allow_writeable_chroot=YES in the latest build that had to be backported to use this functionality.
Continue reading “Fixing 500 OOPS: vsftpd: refusing to run with writable root inside chroot ()”