Blog Configuration

I figured my first post on here would be about how I setup this blog. So here it goes… runs as a virtual machine using kvm. Instead of setting up and installing the vm directly using the kvm commands, I decided to try out libvirt since I had not played with it before. Libvirt is a virtualization API that supports KVM, XEN, LXC, OpenVZ, and several other hypervisors.

Since I only have one public IP address outside of the firewall and didn’t want to run this website on that, a reverse proxy was needed. For this I chose Nginx and was surprised how fully featured it was and how easy it was to use. Below shows what I needed to add to the configuration in order to make it work.

server {
    listen 80;
    access_log /var/log/nginx/blog.aaronorosen.access.log;
    error_log /var/log/nginx/blog.aaronorosen.error.log;

    location / {
        proxy_set_header Host $host;

What this does is when request comes to, nginx looks at the HTTP header and forwards it to the proxy_pass location. The only gotcha I ran into is that I used a vhost entry for the domain on the vm and unless proxy_set_header is specified the host headers from the request are not forward.  This cause vhost entry to obviously not work.

As far as the VM goes it runs gentoo linux and installing wordpress on it was very easy following this guide.  The only issue I ran into with wordpress is that wordpress uses the URL that you use to configure it as it’s / location. I initially configured it using so all of the linkage on the site was set to that address which was definitely not what I wanted. To correct this the following commands were needed to be run against the database.

UPDATE wp_options set `option_value` = '' where `option_name` = 'siteurl';
UPDATE wp_options set `option_value` = 'http://blog.aaronorosen.coml' where `option_name` = 'home';

After that that everything was up and running!

This entry was posted in Uncategorized. Bookmark the permalink.

One Response to Blog Configuration

  1. bob says:

    good writeup for the first one. Will be interesting to see you keeping a blog. I need to do this too.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>