Linbpq: configure via web page before bbs and chat apps start

It’s not immediately obvious from the docs, but after installing and creating a bpq32.cfg file for pilinbpq BPQ32 on the Pi (or Linux in general probably), after you’ve started pilinbpq running, you need to hit the admin web pages to configure the last few params before the services are accessible.

For example, if you telnet into your node locally and then type bbs or chat, you’ll see the error: “bbs application is not running”.

Hit the admin web pages for both bbs and chat, and complete the blank fields in the config. For me these where the applicationID and Streams values. The Id matches the id value of the app in the bpq32.cfg file. Streams is I think number of concurrent clients. Save values, restart, and you should be good.

Apache httpd in a Docker container

I have a ‘getting started‘ post on Docker already, so I thought it would be useful to pull together some of the simplest possible examples of building and running Docker containers, as real examples.

On the Docker Hub there’s many prebuilt images already. As a quick example, let’s use the Apache Httpd image and build a container that runs httpd and serves an example webpage.

This is pretty much the instructions that are on the httpd image page, so no surprises here.

In a new folder, create a Dockerfile:

FROM httpd:2.4
COPY ./public-html/ /usr/local/apache2/htdocs/

Create an index.html file in public-html and put some hello world content in it.

Next, from a Docker Quickstart Terminal, cd into the folder when you created the Dockerfile and public-html, and build your image:

docker build -t imagename .

 
Now to start up a container based on your image called imagename (name it whatever you like), and expose port 80 on the container to port 80 to the outside world:

docker run -it -p 80:80 imagename

Now point a browser at the IP of your docker machine (displayed when Docker Quickstart starts up), and success, you should see your html being served from apache in your container!

If you’re on Windows, the equivalent to capture the tty output is:

winpty docker run -it -p 80:80 imagename

Installing an SSL certificate on OpenShift Online

SSL certificates are relative inexpensive, but there’s a number of organizations that are starting to offer certs for free – Let’s Encrypt is one. Their approach requires a script to renew your cert every 90 days. In some hosted environments however it might not be possible to run such a script.

For OpenShift hosted apps, you can both assign your own domain name to an application, and also import an SSL cert. See instructions here. Since it’s currently not possible to run a script like what Let’s Encrypt uses (see SO post here), certs from other organizations are more easily imported. StartCom is offering free SSL certs for 1 year, after which presumably you renew for another year.

Depending on what you are hosting, you may need to find and replace any hardcoded references to content loaded via http instead of https (to avoid ‘mixed content’ warnings in your browser). Once you’ve done this though, you get a shiny new green SSL padlock on your site!

Linux shell history

Useful tips:

  • history – list history of all recorded shell history
  • history n – list last n statements
  • !n – execute nth statement from history
  • !! execute last statement