Setting up WordPress on Apache and MySql on a Linux VPS host

I’ve run this blog for the past couple of years on OpenShift Online. I’ve been excited that the new Online v3 is moving to a container based service, but the cost per month is now much more than I wanted to pay. I was about to setup WordPress on AWS in an EC2 instance (if for nothing more than to get some experience playing with EC2), but after posting on Twitter for suggestions, there was a suggestion to check out cheap Virtual Private Server (VPS) offerings. The lowendbox.com site covers many offers from hosting companies offering VPS based services, so I took a look and picked up a 2 CPU core, 512MB, 200GB disk VPS for $2.50 a month. That’s a manageable cost and looks like a comparably price for a low end VPS server.

To get started after provisioning my VPS , I created a new user with sudo access instead of using the default root user created on initial setup:

  • adduser newuser
  • usermod -aG sudo newuser

On my Ubuntu 14.04 minimal server install, apparently even sudo is not yet installed, so per steps here, su’d to root, and then installed sudo:

  • su -
  • apt-get update
  • apt-get install sudo

Installed mysql-server. There’s many guides for installing MySQL, but here’s one as a reference.

  • sudo apt-get update
  • sudo apt-get install mysql-server

During installation I got this error, and the server failed to start during installation:

/var/lib/dpkg/info/mysql-server-5.5.postinst: line 150: logger: command not found
ATTENTION: An error has occured. More info is in the syslog!

From this post here, the fix is to:

  • apt-get --reinstall install bsdutils

As this ran, the mysql install started showing additional input and the server started up.

Next, setup:

  • sudo mysql_secure_installation

Followed the prompts and remove anonymous user access, test database etc.

Created a new MySQL database with user/password that WordPress will use to access the database, following steps here.

Installed apache:

sudo apt-get install apache2

Installed php modules for apache:

sudo apt-get install php5 libapache2-mod-php5

Hitting the WordPress setup url, got this error:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

This is fixed by installing the php mysql package (discussed here):

apt-get install php5-mysql

Installing WordPress from scratch is covered in detail here. The only additional step I needed to do was to tell Apache to server index.php so you’d see the WordPress site when hitting the site root url.

This can be done by editing /etc/apache2/apache2.conf and adding a DirectoryIndex:

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        DirectoryIndex index.php
        Require all granted
</Directory>

Restart apache and you should be up and running:

sudo service apache2 restart

As  start this is pretty good. It looks like the default apache and mysql settings are maxing out my 512MB so I’ve got some tuning to do, and then I need to migrate my WordPress database across, but so far so good!

Running Consul for service discovery in Docker containers

I’ve been looking at Spring Boot services in Docker and options for Service Discovery. I started looking at Eureka a while back, but just took a look at Consul.

Here’s my docker-compose.yml that I’ve got working so far. I realize this is just Consul running in 3 containers (1 server, and 2 containers with Consul agents), but I was interested in taking a look at how the containers register with the main server and how it’s configured.

One of the agent containers is running the UI on port 8500, this looks interesting to get an overview of what’s registered with the Consul server.

More to come later.

River City Amateur Radio Communications Society weekly SSTV net (06/21/17)

The River City Amateur Radio Communications Society in Sacramento runs a weekly SSTV net Wednesdays at 9pm local time (following the 2m net on the 2m N6NA repeater, and the 10m net) – I’ve tried to receive the pictures before but on 2m simplex between most of the stations in Sacramento area and out to my QTH in Davis, it’s a bit far to get a good copy, and some of the stations I can’t copy at all.

This week we tried something different and ran the net on the club’s 440MHz repeater. This worked great for me as we’ve got great coverage from this repeater over Sacramento area and surrounding area.

This was my first time to actively check-in on the net so I had a few things to learn on the fly! First, Multiscan 3B, what seems like one of the most common SSTV apps for the Mac, doesn’t seem to run reliably on current OS X 10.12.x versions. Last time I tried to use it I didn’t have any issue, but with the most recent MacOS version it would only start up the first time after it was installed, and every other time it crashed.

 

The first couple of pictures I received I realized I was receiving through the built in mic, and wasn’t even receiving via my Rigblaster interface. Understandably these first few pics were pretty terrible:

Part way through the net I switched to installing MMSSTV on Windows 10 running under Parallels on my Mac. My connection to my radio is through a Rigblaster, so I had to attach the Rigblaster input and output USB device to my Windows 10 guest. Once I configured it to receive and send through my Rigblaster interface, now I was receiving great images from the other ops on the net, and managed to send and get good reports on a couple of pictures myself:

 

 

 

 

 

 

 

Now I’ve got my config setup, I’m looking forward to our next SSTV net!

Never assume you know how something works by only observing its external behavior

As a developer, you should never assume you understand how something works solely by observing what it does. This is especially true if you are trying to fix something and your only understanding of the issue is only the behavior that you can observe.

While you don’t have to understand how something works in order to use it, if you’re trying to fix something, especially software, it helps to understand how something works. The reason is what you observe externally as a problem is usually only a symptom of the problem; it’s rarely the actual problem itself.

Let me give you an extremely simplified example. Let’s say you have an electric car, but you’ve no idea how the electric motor drivetrain works, you just know you press the accelerator pedal and it goes. One morning you get in the car and press the pedal and nothing happens. In diagnosing the issue, the only thing you consider is the external symptoms that you can see: you press the pedal and it doesn’t go. An extremely naive conclusion you could make is that the accelerator pedal is broken (!). So you replace the pedal, but then you’re surprised to find that it still doesn’t work (ok, so this is a contrived example to make the point – if you know enough to be able to replace the accelerator pedal, you probably know enough about how the car works to not assume the pedal is broken!)

As a software developer or architect, as you diagnose issues you should always look under the covers and find out more about what’s actually going on. The problem you’re looking for is rarely the symptom that you can actually see (or what the user sees).