in Uncategorized

Flawless blog setup

Ok, I wanted to try out writing. I think it will help me to remember things and to understand them more profoundly than before.

Yesterday I finally decided to set up a WordPress blog. I already had a server configured as a proxy because you know, I live in Russia. And recently we’ve got some serious issues with services availability after Telegram block out. Some essential things like Slack and AWS got partially blocked. So lot’s of people jumped on the proxy train.

I thought it would take me a couple of hours maximum to set up a WordPress website on the existing server. Not so fast, mister!

Domain registrar

First things first. I needed to choose a domain name registrar. I went to the default websites like godaddy.com (holy cow, it’s hard to exit a link in WordPress editor! You need to press the right arrow button to exit link mode, not so obvious) namecheap.com and the Russian one nic.ru. I knew about them because I worked with domain registrars before a long time ago, like five years before. All of those pages loads and I see the same crappy design. Urrgh. Prices also are not that attractive, at least in my understanding.

Here comes mighty Google to help me find a good deal. After some research, I’ve stumbled across namesilo.com. Lot’s of great feedback in every question about them. After seeing recommendations like this: Have you ever used NameSilo as your domain name registrar? I’ve gone there to check the prices and Google didn’t disappoint me. Rates are lower than on other services that I’ve reviewed. Also, you’re getting all this useful stuff for free: WHOIS privacy, no ICANN or transaction fees, two-factor authentication, and so on. The interface is old but very practical. You can get shit done in a couple of minutes here.

UFW

I’ve changed Name Servers for my freshly acquired domain and opened WordPress installation wizard using the server IP address. But got nothing on the screen. A website can’t be reached. I’ve double-checked all the Nginx configs, everything looks right, wtf?

It turns out that:

On Ubuntu, all ports are opened unless you have a firewall or application that is blocking it. Under normal circumstances, the application running on the port is for LISTENING, so that it can receive from the port. The Blocking or Closing of the port is using a reference to a firewall block.

A port is normally considered opened when there is a program running and LISTENING on the port. You can tell which ports have programs running with this command (among many other commands):

netstat -tulnp | grep "LISTEN"

You can identify which application is using the port with this command (in this case checking port 80):

sudo lsof -i tcp:80

Of course, port 8081 was closed in my case. They were blocked by Ubuntu firewall as a part of proxy server configuration. To unblock it I could use iptables. But it’s a too complicated tool for my beginner level knowledge of UNIX tools. Luckily, for people like me, there’s a tool called UFW — default firewall configuration tool for Ubuntu developed to ease interaction with iptables. Exactly what I need!

To ensure that UFW actually blocks my requests I’ve enabled logging:

sudo ufw status verbose
sudo ufw logging on
tail -f /var/log/ufw.log

May 31 12:20:39 server0187 kernel: [23.217712] [UFW BLOCK] IN=ens3 OUT= MAC=56:00:21:32:65:eb:fe:00:00:32:65:eb:08:99 SRC=113.69.80.129 DST=se.rv.er.ip LEN=40 TOS=0x00 PREC=0x00 TTL=48 ID=63510 PROTO=TCP SPT=7040 DPT=23 WINDOW=31379 RES=0x00 SYN URGP=0 

Finally, I’ve allowed incoming connection for the target port

# Allow access by IP
sudo ufw allow 8081

# Allow all incoming HTTP and HTTPS
sudo ufw allow proto tcp from any to any port 80,443

Yay, now WordPress wizard is accessible from the world wide web!

MySQL

The last challenge was to set up a new user in MySQL for WordPress database. I didn’t think about it as a challenge until I started doing it. Urrgh.

Here I wanted to write about how I did it, but I’ve postponed this article for a couple of weeks, and now I don’t remember the exact issue and solution. It was something related to the password  the field being named in the latest MySQL not password  but authentication_string. So it took me some time to tackle this one too, but finally, the blog is on.

Why? 

The goal is to write about technical challenges that I encounter on the day to day job and in writing OSS.  Write without much filtering and editing to get used to writing in English and remember ideas that I come up with.  

Write a Comment

Comment