As promised here is the part 2 of the post.
Setting up Web Server
The next task is to setup your web server. There are several servers you can choose. My favorite is Apache. It comes bundled with most Linux distributions. You probably want to setup the apache server as a virtual host. To setup the virtual server, fire up your favorite editor to configure apache configuration and add something like the following:
<VirtualHost *:80> DocumentRoot /srv/www/htdocs ServerName example.com ServerAdmin root@localhost <Directory /srv/www/htdocs> AllowOverride None Order allow,den Allow from all </Directory> CustomLog /var/log/apache2/example.log </VirtualHost>
Restart apache by doing something like /etc/init.d/apache restart. If you took my earlier warning about security seriously, you would have firewall on your server blocking all accesses to your web server. Use your favorite firewall management tool for the server to open hole through server firewall. Suse’s yast makes this process relatively straightforward. I am sure other distributions have something similar.
Edit /etc/hosts on the web server machine and add a host entry for the web server’s IP address as your machine’s NATed IP address. This step is not absolutely essential but it makes life a lot simpler. Fire up firefox on the Linux machine and make sure you can access http://<your-machine’s name>/. If you try to access the same web page from another machine in your network, this is probably very slow. That is because the DNS is resolving your machine’s the hostname as external IP address of your NAT box and the packets are not directly going to your Linux machine. If you have this problem open /etc/hosts on Linux and c:\windows\system32\drivers\etc\hosts on Windows machine and add an entry with webhosts name and its NATed IP address. The entry will look something like:
192.168.32.8 example.com
At this time you should be able to go to the newly configured host and access the web site. You are now ready to configure blog software.
Setting up Blog Software
Now it is time to setup you blog software. After evaluating several blog software, I decided to use WordPress. I will strongly recommend WordPress to nearly everyone trying to host their blog site. It is easy to administer. There is a very strong community out there. You can easily find plugin for almost anything you want to do. WordPress is based on PHP so make sure you have PHP installed before you start. WordPress also has dependency on MySql make sure you have MySql installed. The next step is to create MySql user.
To create the MySql user do the following:
>mysql -u root -p Password: <enter mysql password> mysql>create <db-name> mysql>use <db-name> mysql>GRANT ALL PRIVILEGES ON *.* TO '<user>'@'localhost' IDENTIFIED BY '<db-pass>' WITH GRANT OPTION;
Note down the db-user and db-pass entered in this process.
You are now ready to configure and install the WordPress. Download WordPress and unzip it at a place where your webserver can serve. In the wordpress home directory, there is a file wp-config-sample.php. Copy it to wp-config.php. Edit this file to provide DB name, DB username and DB password.
Fire your Web Browser and point it to the blog’s home directory. Follow on screen direction to complete the WordPress install. You are all set. Drop me a word if you have problem installing.
Happy blogging.
Next time essential WordPress plugins.