Musings of a *IX guy

All things Unixy and not Unixy
  • rss
  • About
  • Tuqix front page
  • Blog

Wordpress backups

Dave | February 11, 2009

My Wordpress is only a few days old but logging in on the admin dashboard showed a new version of Wordpress is out. I was going to sort out backups a little later but now seems a very good time to do it and then I can do the upgrade.

The Worpress site has a section on backing up Worpress , basically you backup the database and backup the flat files in your Wordpress HTML directory.

First create a directory to store the backups :-

mkdir -p /backups

chmod 700 /backups

To backup the Wordpress database I created a little script in /usr/local/bin :-

#!/bin/bash

TODAY=`date  ‘+%Y%m%d’`

DBNAME=wordpress

DBPASS=wpdbpasswd

DBUSER=wpdbuser

mysqldump –opt -u ${DBUSER} ${DBNAME} | gzip > /backups/wordpress.dump.${TODAY}.gz

————————————————————————————————————-

The values for DBNAME , DBPASS and DBUSER  are those setup in the wp-config.php file for your install.

To backup the flat files I just did a tar :-

cd /var/www/html ; tar cvf /backups/my-wordpress.20090211.tar  wordpress

Of course no one cares about backups – only restores count, so you should test your restore on another server. You should also backup the Mysql database which holds the usernames and passwords

mysqldump mysql -p > /backups/mysql.db.dump.20090211

You will be prompted for the root user password for the Mysql database which you would have set when you first started up mysqld at install time.

Don’t forget to copy the dumps and tars to another server in case of a total server loss !

I will automate all the above with cron and rsync in the future


Comments
No Comments »
Categories
VPS server, Wordpress
Comments rss Comments rss
Trackback Trackback

Installing Wordpress on a Linux VPS

Dave | February 10, 2009

Wordpress blogging software

Having setup my Linux VPS server ( see previous blog ) it’s time to install some web applications.

I wanted to install a blog so I could recount my experiances with a Linux VPS server. Wordpress was chosen as it is open source and had very good reviews.

Wordpress needs PHP and mysql – both of which were installed already.

First setup Apache so it will use PHP files

vi /etc/httpd/conf/httpd.conf and search for DirectoryIndex

Add index.php index.php3 index.pl index.htm index.cgi

( they are not all needed for Wordpress but as I’m going to add other software I put them in )

Restart apache :-

service httpd restart

Create the database

As this is the first application I’m installing that uses mysql there a few steps needed to get msql up and running.

chkconfig –levels 235 mysqld on

/etc/init.d/mysqld start

mysqladmin -u root password ‘apassword’

‘apassword’ is the password you want to set for the mysql root user

mysqladmin -u root -p -h localhost password ‘apassword’

Now create a database and a user for teh database

mysql  -u root -p

create database wordpress ;

grant all privileges on wordpress.* to “wordpressadmin”@”localhost” identified by “passwd” ;

flush privileges ;

exit

“passwd” is the password you want the wordpressadmin user to have. You don’t have to call the database wordpress or the user wordpressadmin.

Get the latest Wordpress version :-

cd /root

wget http://wordpress.org/latest.tar.gz

cd /var/www/html

tar xvfz /root/latest.tar.gz

Now for the setup and install

cd wordpress

cp wp-config-sample.php wp-config.php

vi wp-config.php

change DB_NAME , DB_USER, DB_PASSWORD    to the values you used above in mysql.

Point your browser to https://yourhostname/wordpress/wp-config.php

Fill in the blog name  and an email address ( you can change these later ) then click install.

If successful you will get a password for the admin user displayed – make a note of this and login as user admin with that password.

Click on the Settings link at the left hand side and fill in the Blog Title , Tag Line , Worpress Address URL ( http://yourdomain/wordpress ) , Blog Address ( http://yourdomain/wordpress ).

Check and change any of the other settings such as date format as you want then save the changes.

Next setup your profile – click Users and Edit the admin user, fill in your first and last names ( these are not made public ) , a nick name  , select from the drop-down box the name you want to appear as and  an email address.

Finally change your password , then click on Update Profile

Now you are ready to blog. Click on Posts at the left hand side – you will see the is already one post which you can either edit or delete. Once you have created your post hit the Publish or Update Post button at the right hand side.

There are loads of different themes and plugins available for Wordpress – give them a go.

Comments
No Comments »
Categories
Applications to install on a personal web site, Centos, VPS server, Wordpress
Comments rss Comments rss
Trackback Trackback

Navigation

  • AIX
  • Applications to install on a personal web site
  • Centos
  • Email
  • Hi-Fi
  • Linux
  • Linux desktop
  • TSM
  • Uncategorized
  • VPS server
  • Websphere
  • Wordpress

Search

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox