Category Archives: Code

How to track video plays in Ghost with Plausible

Plausible comes with the perfect number of metrics out of the box, but if you need a little more, you can track custom goals, such as outbound clicks or file downloads, by adjusting the script embed and including those goals within your site settings.

Now, for additional custom event goals, you can use the global plausible function to push an event, such as Video: Play, with a couple properties, such as page and video, which is what we’re going to do.

Continue reading

How to install Ghost alongside CyberPanel on Ubuntu 20.04 without Docker

If you have a Ubuntu server with CyberPanel installed, and want to install a Ghost blog on that same server, here are step by step directions on how to do that.

The latest version of Ghost (5.x) encourages (and soon requires) MySQL 8. If your CyberPanel server has MariaDB installed, you have a three options:

  1. Use remote database server with MySQL 8.
    • Pro: Meets requirements. Con: Need to set up remote database.
  2. Configure SQLite if you don’t want to bother with MySQL 8.
    • Pro: No need for remote database. Con: Data stored on file system. Not scalable.
  3. Install MySQL 8 on your CyberPanel in parallel to MariaDB.
    • Pro: Meets requirements. Con: New database system just for Ghost.

I’ll be using a remote MySQL 8 database, simply because I already have a separate server with that set up, but I’ll include a note on how to set up SQLite if you just want to take Ghost for a spin.

Continue reading

Enable auto index on website hosted on Ubuntu with CyberPanel and OpenLiteSpeed

I have a server at DigitalOcean with Ubuntu, CyberPanel, and OpenLiteSpeed, and wanted one of my websites to display an auto index of all the files uploaded to it.

There is a default.php script in /usr/local/lsws/share/autoindex that simulates Apache’s auto index, which suffices for my needs, but if you don’t want to use the default, you could copy and edit default.php to create your own template.

Now, to enable and use this auto index, you have to adjust the index directive in your website’s virtual host configuration file:

index  {
  useServer   1
  indexFiles  index.php, index.html
  autoIndex   1
}
Continue reading

Can’t connect to MySQL server on ‘127.0.0.1’ (61)

I downloaded the MySQL server and installed it on my Mac, but every time I tried to connect to it, I got the following error:

Can’t connect to MySQL server on ‘127.0.0.1’ (61)

There can be many reasons for this error, most of which are generously covered online, but in my case it was because MySQL was running on port 3307. I think the port was updated in a recent MySQL server update, because I’ve never had this issue with a previous MySQL server version. Here’s how to check if you have the same problem, and how to change it to port 3306 (unless you want to keep it running on port 3307).

Continue reading

Use Apache instead of built-in Nginx in GitLab CE

I installed GitLab CE using the Omnibus package on a new CentOS 6 server. Since I had nothing else on the server at that┬átime, everything GitLab setup and configured was sufficient. Later, however, I wanted to setup additional sites on the┬áserver using Apache, but now port 80 was already bound to by GitLab’s built-in Nginx web server.

What I really wanted to do is disable the built-in Nginx server and just use my self-managed Apache installation. Here’s how to do just that.

Continue reading