I finally restarted my blog with an actual domain and a switch from Drupal to the Pelican static blog generator. The server uses Fedora 20 and is hosted by DigitalOcean. It's a good hosting company with excellent pricing.
This post is mostly just a list of the steps required to setup this site. Just in case I might need to reinstall it at some point.
General settings and Apache
Set the system's timezone with the following commands.
sudo mv /etc/localtime /etc/localtime_bak sudo ln -s /usr/share/zoneinfo/Europe/Helsinki /etc/localtime
Install the Apache web server and set it to start on boot.
sudo yum install httpd sudo systemctl enable httpd.service
Edit /etc/httpd/conf/httpd.conf and change the override setting for the web directory (/var/www/html) so that .htaccess files work. Also create a new virtual host for the site's folder.
AllowOverride All <VirtualHost *:80> ServerAdmin firstname.lastname@example.org ServerName yoursite.com DocumentRoot /var/www/html/blog/output/ ErrorLog "logs/yoursite_error_log" CustomLog "logs/yoursite_access_log" combined Options FollowSymLinks </VirtualHost>
Disable the Apache welcome page by commenting out every line from the file /etc/httpd/conf.d/welcome.conf. Then restart the Apache service.
sudo systemctl restart httpd.service
Set yourself as the owner of web directory.
sudo chown -R janne:janne /var/www/html
If port 80 (http) is not open then use this IPtables guide for Fedora. Also install the iptables-services package so you can restart the iptables service. And save the rules like this so they survive a reboot.
sudo yum install iptables-services sudo service iptables save
If you need to use your own scripts during boot then you can add them to the file /etc/rc.d/rc.local.
Install the Python stuff and Pelican
I'm not interested in using legacy versions so I switched from Python 2.7 to 3.4. Build it from source (building also requires the gcc package)
Get the Python PIP package manager which allows you to easily install new Python packages.
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py sudo python get-pip.py
Install Virtuanenv for creating isolated Python environments.
sudo pip install virtualenv
Create a virtual environment for Pelican. Make sure it uses Python 3.
cd ~ mkdir virtualenvs virtualenv -p /opt/python3/bin/python3 virtualenvs/pelican source virtualenvs/pelican/bin/activate
When you want to deactive the current virtualenv.
Install Pelican. I prefer to use the Markdown syntax so I also installed the plugin for it.
sudo pip install pelican sudo pip install Markdown
Go to the public web directory and create your blog with the following wizard.
cd /var/www/html pelican-quickstart
Now you can start writing some blog posts with the Markdown syntax. Save them into you site's content folder with an .md file extension. Use the following command in your site's root directory to generate the HTML files to the output directory.
This creates the initial development version of the site and uses the settings defined in pelicanconf.py. Once you want to "publish" your site to the public you issue this command.
pelican content -s publishconf.py
Of course your site was visible to the public even before this but this integrates some production features that are defined in publishconf.py. Such as feeds and for example Google Analytics. The settings in publishconf.py override the ones in pelicanconf.py.