Phew! What a pain, man… I still cannot believe I have spent so much time at trying to configure this blog. I started around 11pm on last Friday, and was officially defeated around 4am today.
Then, I woke up around 9:30, had some coffee and came back to the computer, because I HAD TO have this done, for god sake!
After all, being almost 40 working as a developer for the past 20ish years, it’s a matter of honor, pride and getting-old-and-becoming-obsolete denial, so I had to have the job done!
Since the initial idea here is to talk about technology (mostly), I think it’s fair enough to start by describing my technical “challenges” at setting up this little blog, which will either make you want to stop reading immediately and think “what the hell man? this dude struggled with a simple blog set up?” or you can just continue for some sort of bizarre dark twisted sense of humor, you sadistic human being!
Still here? Good, let me give some introduction in my little quest…
So there I was, with my wife in a Friday night talking about 300 different subjects, and one of them was about blogging. She does it already, and she is very good in her writing.
Then, I remembered that I have tried to write blogs two or three times, but I either failed to keep some interesting content, or I just gave up because something important came up, and I never went back to writing. So, why not go for the fourth attempt, which will probably fail miserably like the previous attempts?
What harm could this cause? In the simplest case, it would be just a matter of installing WordPress, a web server with PHP support and MySQL, and boom! jump into writing like Jerry Lewis in the movie “Who’s Minding the Store?”.
Well, I already have my VPS on Amazon, which already has Nginx and MySQL running on it, so it’s nearly half way done already. Besides, it’s Friday night, and as a good lazy sedentary life style dude who worked all day, I wanted to be in bed not later than 1am.
So, after considering to create my own blog application from scratch in 4 or 5 different possible ways – “hmm, nodejs with markdown.. nono, Python Django, because I really want to learn Python… nonono, I will just use Gist… Nah… you know what, I will just keep with the WordPress idea and.. damn! it’s 1:30 am already???” – I decided to move on and go to the WordPress website and read the instructions.
No surprise there: download the file, extract it, configure the database, copy the files in the desired folder and run to the browser to start the installation.
Because it’s been so long I don’t touch my VPS, I decided to do some cleaning before anything else…
sudo apt-get update
sude apt-get upgrade
Yup, I did that… yawning like a baby panda watching all those letters and percentages in the screen. It shouldn’t take long, would it?
Anyway, at some point in time, the update was done and I needed to configure a new database for the “Wonderful Willian’s Blog, the Fourth”. But there was a problem: I didn’t remember what was the admin password.
It didn’t take long until I found out some very nasty-wrong-unsafe-go-horsie ways to fix that.. and that was the one I chose, of course! The easiest, fastest and unsafest way, which at some point involved a freaking very simple insert into the database.
My sight was starting to get blurry, but there I was, getting an error trying to connect to the database with the new password. 30 minutes later and almost giving up, I noticed that I missed the PASSWORD function when adding the password to the mysql table…Seriously, it was one of those moments that you stop and think about your entire career and it’s like: “how did I get to where I am? I am worthless. I should have stopped when I started learning Visual Basic. Why I didn’t become a doctor as my mom wanted me to?”.
Moving on, after wiping the tears from my eyes, I had to make sure that PHP was running, but I knew I hadn’t configured yet, because I simply didn’t need it. And again, what could go possibly bad? I mean, I have no experience with Nginx, and the last time I touched it was when I decided to move from Apache to Nginx, which was working fine, even though I knew the configuration files were a total mess.
So, I added the php5-fpm thing, added all necessary configuration on Nginx, restarted both and… it didn’t work. I kept getting PHP files being downloaded by the browser. Time for some more googling.
Basically, many people had the same issue, so I knew it was a matter of minutes to have my problem solved. Or so I thought… The problem didn’t go away. I tried literally 10 or 15 different ways, following all tips from Nginx documentation, Stackoverflow, everything… and no solution.
It was around 4:30 AM that I accepted my defeat, and went to bed feeling dumb, frustrated, tired. I swear I wanted to continue, but I was really really tired…
This morning, I was determined to fix this damn problem. After some 4 or 5 attempts, I started to look at my VPS, and started cleaning old stuff while I planned my next steps. Many directories deleted, so many old files, some presentations from talks I gave years ago, all gone. And no reasonable plan yet. Then, I thought: “you know what? this VPS is to messy. I will just run the same setup in my local machine, and if it works, I will compare things”.
It took me FIVE FREAKING MINUTES to get Nginx and PHP running… maybe less… Then I started cleaning my VPS Nginx, started applying some best practices in the config files, and suddenly, in the middle of one of the thousand “sudo service nginx reload”‘s, I saw my page loading a very very old page, and I couldn’t understand where that was coming from. It turned out that THE FREAKING APACHE WAS STILL UP AND RUNNING, which was messing badly with Nginx and PHP, of course… because they do the same freaking thing, and “wait… why the hell is Apache still here? Fuck it, I will remove this shit immediately, and I will just move one”.
Man, THAT WAS IT. Of course, I still spent some more minutes to finish cleaning my Nginx config, then I finally finished installing the blog, and here I was, looking into the WordPress login screen, feeling like a hero. And old, obsolete, ashamed hero. You know, like Sylvester Stallone in the latest Rambo movie: old, still trying to keep around the younger dudes, fighting, trying to show my value, but deep inside, knowing that the time is coming.
And here I am, just after enjoying my victory for a few minutes, I got myself into writing this very first, possibly last, and long post.
Oh yes, WordPress has these cool blog setups, and I probably should have configured that before writing a post, but seriously, I don’t know if I care about this. Not now, at least. Not after all I have been through for the past hours.
Anyway, like Sean Connery would say: “It’s too late, the damage is done”
Thanks for reading this, and see you next time… maybe.