Host WordPress using Apache 4.2

Want to host your own WordPress installation with a recent version of the apache webserver (e.g. apache 4.3). Here you find everything you need. If you have been upgrading from an older apache version there might be a little obstacle you have to get around but with the directory permissions which is already perfectly fixed in the code sample below. Setting up WordPress is really easy. Here all the steps needed:

1. Download WordPress from WordPress.org

2. Unpack the Zip Archive you just have downloaded and put it into the document root of your webserver

3. Create a virtual host for your new apache installation.

To create the virtual host you simply have to put the following code snippet into your httpd.conf. In the following example the blog has been unpacked in the directory /var/www/myblog

<VirtualHost *:80>
 
      DocumentRoot /var/www/mydailyhacks
 
      ServerName www.mydailyhacks.org
      ServerAlias mydailyhacks.org *.mydailyhacks.org
 
      <Directory "/var/www/mydailyhacks/">
            Require all granted
            Options FollowSymLinks
            AllowOverride Limit Options FileInfo
            DirectoryIndex index.php
      </Directory>
 
</VirtualHost>

Make sure that you use all the directory setting exactly as they show up here, otherwise you will run in trouble.

4. The last step before you can activate your blog is setting up a MySql data base which can be used by wordpress. This is a lot easier than it sounds. Assuming you are running linux you have to make sure that the mysql-server is installed. In Fedora, Centos etc. you can achieve this by typing

yum install mysql-server
/sbin/service mysqld start

5. Now you only have to set up a new user and (in the example for simplicity the root user is used) and create the database for your WordPress install.

mysqladmin -u root password 'mypassword'
mysql -u root -pmypassword
CREATE DATABASE wordpress;

5. Just contact your virtual server now under the address you defined in step 3. The automatic setup interface for your new blog will show up. Enter wordpress at database name and also enter the username and password which have been defined before.

Thats it! Enjoy your new self-hosted blog!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: