Installing WordPress on Linux

Quick set-up guide for installing WordPress on a virtual host

By Robin Rowe

HOLLYWOOD, CA (LinuxMovies) 6/26/2011 – WordPress is open source PHP and MySQL-based content publishing software. We’ll configure MySQL with wpdb as the user name and a password that isn’t actually ‘password’. We’ll name the database the same name as our website. Then we’ll download, unzip and install the latest WordPress.

  1. mysql -u root -p
    CREATE USER ‘wpdb’@’localhost’ IDENTIFIED BY ‘password’;
    CREATE DATABASE linuxmovies;
    GRANT ALL PRIVILEGES ON goshtv.* TO “wpdb”@”localhost”;
  2. cd ~
    mkdir install
    cd install
    tar xvfz latest.tar.gz
    md /var/www/html/
    cp -rv ~/install/wordpress/* /var/www/html/
    mv /var/www/html/ /var/www/html/
    chown -R apache /var/www/html/*
    chgrp -R apache /var/www/html/*
  3. Edit wp-config.php
    Enter db, user, and pwd
    Enter secret keys:
    define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true);
  4. Edit httpd.conf to add virtual host
  5. Check DNS is set

Virtual Host Apache Settings

<VirtualHost *:80 *:8080>
DocumentRoot /var/www/html/
ScriptAlias /cgi-bin/ “/var/www/html/”
Redirect permanent /webmail
<VirtualHost *:80 *:8080>
Redirect permanent /

Install These Plug-ins

  • Akismet: Scrape off comment spam.
  • Fix Rss Feeds
  • Google News Sitemap: Install before posting your first story.
  • WP-Stats-Dashboard
  • Jetpack: Necessary for WP-Stats-Dashboard. Don’t use abandoned Stats plug-in
  • WP YouTube Lyte; Embed YouTube videos easily.

Useful MySQL Commands

show databases;
use linuxmovies;
show tables;
select user from user;
source batch-file;
select option_name from wp_options;
select option_name from wp_options where option_name like  ‘akismet%’;
select option_name, option_value from wp_options where option_name like  ‘%key%’;
UPDATE wp_option SET option_value = ‘HP’ WHERE option_value = ‘IBM’;
delete from wp_options where option_name = ‘wpsd_un’;
delete from wp_options where option_name = ‘wpsd_pw’;

Making and Restoring WordPress Backups

mysqldump -v -u root -p wordpress > goshtv.sql
mysqldump -u root -p wordpress_spl > screenplaylab.sql
mysql -u root -p goshtv < goshtv.sql
mysql -u root -p screenplaylab < screenplaylab.sql
mysql -u root -p hollywoodtoday < hollywoodtoday.sql

zip -rv /var/www/html/



Leave a Reply

Your email address will not be published. Required fields are marked *