If you are a regular follower of my blog you know that I recently changed the theme of the Wordpress blog. Although changing the theme itself is rather straightforward within the Wordpress admin system, I wanted to customize a free theme and didn’t want to risk taking down my production theme while I was doing it. By installing a copy of Wordpress on a local server I was able to make changes and test them in a non production environment before putting everything into production.
Since I setup LAMP and Webmin on my system when creating the Ushare server most of the infrastructure was already in place including the Apache Web Server, MySQL database, and PHP with the module for PHP.
If you have not installed LAMP either upon setup of Ubuntu Server or at another time you will need to install the infrastructure. I also recommend installing Webmin since it makes it easier to maintain things with a GUI.
The instructions below were done in Ubuntu 9.10 Karmic, check the links at the end for additional instructions for Mac, Windows, and some other Linux Distros.
First you need to connect to the server with a command prompt, I use Putty from my Windows machine. Start by installing apache2 with the following command:
sudo apt-get install apache2
Follow the instructions for setting up apache2 and then we need to install MySQL with the following command:
sudo apt-get install mysql-server-5.0
Follow the instructions for setting up MySQL server and make sure to remember the password that you created. Next you need to install the PHP version 5 with the following command”
sudo apt-get install php5
Now you need to install the MySQL module for php with the following command:
sudo apt-get install php5-mysql
I also installed Wembmin which provides a GUI for maintaining certain things on the server.
sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.441_all.deb
sudo dpkg –i webmin_1.441_all.deb
Next I Login to Webmin, you should be able to use any computer on the network and enter
https://serveripaddress:10000
You can use the serveripaddress if you used your router to determine it for Putty. I was also able to use my server name (vaio) followed by the :10000. You may get errors about the security, I clicked OK in order to get to the site since I knew I was connecting on my internal network.
The next thing you will want to do is set your server to a static IP address.
You can do that in Webmin by choosing:
Networking –> Networking Configuration –> Network Interfaces –> eth0
Make sure you change the setting in the “activated at boot” tab, I made the mistake of entering it in the active tab before I realized there was another tab there. You will most likely want to leave the first group of numbers and change the last group, it can be between 2-254.
Next you need to setup the MySQL database for Wordpress, in Webmin go to Servers –> MySQL Database Server. Click on the Create a new database link and enter the database name, I called my database Wordpress to identify it.
Now you can download Wordpress at http://wordpress.org/download/. Once you have the zip file you will need to unpack it into the var/www folder of the server. Since I downloaded the files in Windows I dragged the zip folder into the var/www folder and then went to the command and entered:
sudo tar –zxvf wordpress*
Now Wordpress should be installed, you can check by going to your browser and entering the static address you created followed by /wordpress, in my case it is http://192.168.0.190/wordpress/.
The first time you go there you will need to enter your database information for the Wordpress MySQL database that you created. You will then be greeted by the normal Wordpress installation option to complete the setup of your local blog including the blog name, etc.
Now you can view your blog at http://192.168.0.190/wordpress/ or go to the admin page at http://192.168.0.190/wordpress/wp-admin.
The best part about having a local blog is that you can go directly to the theme folders and edit the files and view changes immediately by refreshing the browser. If you don’t like the changes you can undo them in the file or replace the file with the original as long as you saved a backup copy. All of these changes and test files can be used without impacting the live blog in production.






January 11th, 2010 at 7:39 am
[...] and test them in a non production environment before putting everything into production. More here Since I setup LAMP and Webmin on my system when creating the Ushare server most of the [...]