So I finally got around to setting up a blog…

I’m going to be honest, I used to really make fun of wordpress, but its really easy to setup. Hopefully this is easier than my horribly janky system that used Blæst as a markdown parser that was terrible and barely worked. Particularly it was awkward that the æ in Blæst would cause the ENTIRE program to break, so it had to manually go back and edit it in. Hopefully wordpress is easier. Also too my friend Brandon already set up his blog on wordpress and it looks pretty nice so…


Here are some things I really like about wordpress so far

  • The themes are a nice hit of nostalgia. I remember the web before sites like WIX and Squarespace took over, and especially before frameworks like React took over. What’s nice about wordpress was that it just seemed to slot in perfectly with my already existing (and rather bare bones) web server. That’s pretty cool in my opinion.
  • WordPress seems to organize everything really nicely. Being able to write posts and categorize them from a nice panel is pretty convenient, especially since before I had to do it all manually using markdown.

Now the obligatory “How I setup wordpress” section

Setting up wordpress was honestly almost too easy. To start, I use Debian stable with the apache web server. I do NOT like to add external repositories, so I do everything manually (this is assuming someone has packaged wordpress for Debian already). I also do not have the ability to run Docker or other container programs because I lack disk space. So I basically am used to having to compile and backport my own programs, and sometimes go through hell doing it. But wordpress was different, it just seemed to work directly out of the box on Debian stable, so here’s how I did it.

Assuming you use apache2, the installation should look something like this.

First install the needed packages.

 $ apt install php7.4 php7.4-mysql libapache2-mod-php7.4

Next, we need to create the folder in your web directory for wordpress to live. For this example I will use https://website.com/blog, which would be located at /var/www/html/blog

$ mkdir /var/www/html/blog
$ cd /var/www/html/blog

Now we need to add the wordpress database and user to our database server… Oh… and install a database server

For the database server I decided to use mariadb, seems like everyone uses it.

$ apt install mariadb-server

Now once you have mariadb installed, lets add the wordpress user

$ mysql -u root

From here you are in the mariadb interactive shell, so we need to type SQL commands.

Let’s create the wordpress database:

CREATE DATABASE wordpress;

And the wordpress user:

CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'securePasswordHere';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;

Make sure to update the username and password shown above if you feel like it. Also make sure to remember all of this for when we setup wordpress itself.

Now leave mariadb by just typing:

QUIT;

Okay… Now we are prepared to get wordpress setup.

First restart apache2 so our modules update, to do this just run

service apache2 restart

To download wordpress, enter your directory where you wish to install it (we are using /var/www/html/blog) and type:

wget http://wordpress.org/latest.tar.gz
tar xf latest.tar.gz

This will extract to a folder named wordpress/, if you don’t want that, simply run

mv wordpress/* .

Now make sure to allow wordpress to write to the folder, for some reason, if you don’t do this, wordpress will ask for FTP credentials to log into your server (why…?).

chown -R www-data:www-data /var/www/html/blog

Now navigate to the site and directory you installed to, and just follow the few instructions, and boom! Now you have wordpress!

This entry was posted in Server and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *