搭建wordpress&Dokuwiki based on LAMP platform(CentOS 6.4)

1. Setup LAMP platform
   1. Install required packages
   #yum -y install httpd ; service httpd start  //install apache server and start apache
   #yum -y install mysql-server    //install MySQL
   #yum -y install php php-mysql ; service mysqld start  //install PHP and MySQL module and start MySQL
   2. Set a password for MySQL
   #/usr/bin/mysql_secure_installation    //type in your password and set yes for the all options
   3. Set Apache, MySQL start onboot
   #chkconfig httpd on
   #chkconfig mysqld on
   4.Pick out the IP address and Test the AMP
   #ifconfig    //pick out the ipaddress
   Open your browser and fill in the navigation toolbar with IP address picked out the previous step.

   If a page display in your browser like following, Great, you are lucky dog!!

2. Install Dokuwiki
1. Download and decompress Dokuwiki package
#wget http://download.dokuwiki.org/out/dokuwiki-7db05240ae771b06f73ccb1a74961947.tgz
# tar -zxvf package_name
2. Move decompressed package to root directory of apache and change owner
#mv package_name_decompressed /var/www/html
#chown -R apache:apache /var/www/html/package_name_decompressed/*
3.Open your browser and type in navigation toolbar with "Your_IP/dokuwiki"
       Just do it as follow prompts, then you will see a page like the

below:

3. Install Wordpress
   1. Download and decompress Wordpress package
   #wget http://wordpress.org/latest.tar.gz
   #tar -zxvf latest.tar.gz
   2. Move decompressed package to root directory of apache and change owner \            #mv package_decompressed /var/www/html/
   #chown -R apache:apache /var/www/html/package_decompressed/*
   3. create a database for wordpress in MySQL
   #mysql -u root -p    //type in password
   mysql>create database database_name;    //the databass_name will be used in installing process.
   mysql>grant all privileges on database_name.* to user_name @localhost identified by 'password';    //give all right to user by password-zq123
   mysql>exit
   4. Open your browser and type in navigation toolbar with "Your_IP/wordpress"
       Do it as the follow prompts, then you will see a page like the  below:
4. Backup and Restore Dokuwiki, Wordpress
   1. edit a bash script life below, named backup.sh
#!/bin/bash
#Purpose = Backup of Important Data
#Created on 2013/06/07
#Author = Biao Liu
#Backup Innerwebsite Mysql database
mysqldump -u root -pyour_password website > /databank/Backup/website.sql    //Back up database website by user root identified xgfwq4GBK
#Back Files
TIME=`date +"%b-%d-%y"`             # Add date in Backup File Name.
FILENAME="WikiBak-$TIME.tar.gz"      #Define Backup file name format.
FILENAME2="InnerwebsiteBak-$TIME.tar.gz"
SRCDIR="/databank/wiki"                  #Source of backup
SRCDIR2="/databank/website"
DESDIR="/databank/Backup"            # Destination of backup file.
tar -cpzf $DESDIR/$FILENAME $SRCDIR
tar -cpzf $DESDIR/$FILENAME2 $SRCDIR2
   2. Configure crontab job
       #crontab -e
       add follow line
       0 23 * * 1,3,5 bash /your_path/backup.sh    //The detail see the notes
   3. Restore Dokuwiki and Wordpress
       Decompress the backup file of dokuwiki to original location then the dokuwiki will be restore.
       Decompress the backup file of Wordpress to the original location and retore database by database backup file, then the wordpress will be restored.
       Sometime, there is a need to modify domain name, so you should run the following commands in mysql UI with using wordpress database
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
Notes:
* * * * * command to be executed
- - - - -
| | | | |
| | | | ----- Day of week (0 - 7) (Sunday=0 or 7)
| | | ------- Month (1 - 12)
| | --------- Day of month (1 - 31)
| ----------- Hour (0 - 23)
------------- Minute (0 - 59)
Add the follow line to file(/etc/sysconfig/iptables),if iptable is on

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

你可能感兴趣的:(wordpress,lamp,dokuwiki)