Websites

Moving Servers

Update:

I was having trouble with permalinks in WordPress but it is all fixed now!

My .htaccess file was correct and had the right permissions. mod_rewrite was enabled on my Apache server. It turns out that I had to edit the /etc/apache2/apache2.conf file to allow overrides.

Here’s what I changed:

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

I reloaded the Apache server and everything went back to normal. 🙂


So my free DigitalOcean credit is running out and I decided to switch this blog over to Ramnode.

I’m encountering a few permalink problems so commenting won’t work at the moment.

This is perfect timing because I just started exporting all of my WordPress posts over to Hugo.

So please bear with me!

Programming · Websites

Tempted by Static Pages Again

I recently started learning how to use emacs, which is a text editor and a Lisp interpreter. During my quest for resources, I came across a number of developers and their blogs. Since I’m always intrigued by what sort of tools developers use to make their blogs, I did a little snooping. A shocking number of people who didn’t use WordPress as their blogging platform opted for flat files instead.

Now I had dabbled a little bit in static pages before with BoltWire but ultimately abandoned it to go back to WordPress. I think where I went wrong with BoltWire was that it simply did not have a big enough community (although they are an extremely dedicated community) to keep me reassured that I had made the right choice.

However, I know flat files in general is a real and upcoming thing. Since I’m planning to use emacs and Markdown files as my main way of documenting things, it would be easy to use it in my blogging as well.

So my main reasons for switching to a flat file system:

  • Better security
    WordPress was giving me so much trouble when it came to security. Yes, Jetpack did help in reducing spam and MySQL doesn’t randomly stop working anymore but you have to admit that using WordPress on a Digital Ocean server makes you a target.
  • Version control
    Yes, WordPress does have versioning for content however it would be much easier to have version control for settings, themes, etc. over the WordPress kind.
  • Less bloat
    I don’t need everything that WordPress offers and honestly sometimes I feel like it might be a bit overkill. Since the server I’m on has limited RAM and disk space, I need to be careful about the amount of resources I use. It helps that I don’t have many visitors to begin with but still!
  • Faster loading times
    While I’m unsure if this is too much of a concern for me but loading times do make me a bit worried. Fetching from a database can be quite slow.
  • I want a more future proof blogging system
    There are options to export your content into XML files in WordPress however it can’t beat readable Markdown, which many static file systems use. The fact that everything is file based is future proof in itself. Migrating from one server to the other wouldn’t be too much hard work.

My concerns:

  • What comment system to use
    I do not like Disqus. I dislike the fact that I have to register for yet another site and people can’t click on my name on a comment and go directly to my website. I also don’t like the fact that the comments don’t stay on my server. I want to be able to have my comments.
  • Learning curve
    This would be a little more technically involved at first to get everything installed, just due to the nature of it not being a one-click install.
  • So many choices!
    There is no shortage of flat file systems out there. Like I’ve said, I’ve dabbled in BoltWire before and wiki systems but it’s so hard to find one that will work for you when there’s a breadth of options.

One of the main frameworks I’ve been looking at is Hugo which is used by Baty.net, Modern Emacs, kieranHealy.org, but she’s a girl…, and more. I am very attracted to this option because it seems like it could work pretty well with an emacs workflow.

Thankfully, I finally recovered my previous website, erzadel.net and now have access to my old blog posts. I’ll be tinkering with that this weekend and try to have a clone of my old blog up and running on my local machine. We’ll see how it goes!

Websites

When Spam Isn’t Just Annoying

The past couple of weeks I noticed that the MySQL service on my server would routinely stop out of the blue. At first I suspected that it was because my 512MB RAM wasn’t enough but when I looked at the usage history, I never peaked more than 9%. I even tried reinstalling the MySQL server which worked at first but then it stopped running again.

However, I think the problem was due to bots trying to log into my WordPress dashboard. One thread I was reading suggested xmlrpc attacks were bringing WordPress down. When I looked at my logs, there was a dozen of attempted logins.

There are multiple solutions for this, mainly blocling xmlrpc but since I use third party apps that rely on xmlrpc, I didn’t want to block it entirely. Jetpack was another solution which is what I eventually opted for.

I’ve been wary of installing Jetpack, mostly due to the fact my server is not that great and I was worried about space and memory consumption. However, it does have a feature to block malicious xmlrpc login attempts that I desparately needed.

It’s only been two days now (as of writing this) and I already see that Jetpack has blocked over 25 login attempts. Now this doesn’t protect me from other attacks and on other sites on this server but at leaat I have that out of the way.

Websites

TIL: How to Set Up Virtual Hosts on Apache

Create a virtual host configuration file site-name.conf for the site:

sudo vim /etc/apache2/sites-available/site-name.conf

Inside the file:

<VirtualHost *:80>
    ServerAdmin email
    ServerName domain name
    ServerAlias domain name
    DocumentRoot path to folder no slash at the end
    ErrorLog path to error log
    CustomLog path to access log

    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
</VirtualHost>

Add the site to the host file:

sudo vim /etc/hosts

Inside the file:

127.0.0.1 localhost.localdomain localhost
127.0.0.1 stashofyarn.ca stashofyarn

Enable the site:

sudo a2ensite site-name.conf

Reload the Apache service in sudo mode:

sudo service apache2 reload
Websites

Phew… I Moved My Fanlistings

Fanlistings are basically the early 2000’s version of Facebook pages. I own a bunch of them, mostly of songs or video game characters. Honestly, the whole fanlisting thing has been going down in popularity as the years go by. It’s a bit sad. Fanlistings come and go a lot. There’s a high turnover rate. I try my best to maintain and keep mine up and running.

However, my old domain name expired and I had trouble getting in touch with my registrar to renew it. I really loved that domain name because it featured my frequently used user handle but I determined it to be a lost cause and ultimately let it go. Since GitHub introduced the student pack which included a .me domain for free for one year, I claimed it. Hence, edelgrace.me was born.

Right now I’m using $50 credit from Digital Ocean (yes, that is a referral link) for an Ubuntu droplet. However, it only runs on 512MB RAM so I opted to buy a cheap 1GB RAM server from RamNode (no, that is actually not a referral link). 512MB RAM would probably be enough for me since I don’t receive many visits to my websites but you never know what the future might bring.

So on the event of my domain expiring, I moved all of my fanlistings over to the RamNode server. I exported a SQL file through phpMyAdmin from my website to recreate the database and ran it on the server. Since I wanted better naming conventions, I had to change all the config files in order to connect to the database. There were some issues that I had to plow through in Enthusiast, one being that the absolute path to the fanlisting script needed to be changed. Since I’m no longer of thinking of sticking to hosting but rather maintaining my own servers, I don’t think I should have to worry about changing the path ever again.

Afterwards, I had to contact The Fanlisting Network (TFL) in order to change my URLs. The network is to ensure that duplicate fanlistings don’t exist. In theory, duplicate fanlistings can exist but the ones listed on TFL are more trusted.

In summary, that was my evening last night. It took up more time than I wanted but that’s okay. I still managed to get some studying for CCNA done so all went well.