June 28, 2010

Wordpress 3.0 installation from a command line

Many of use have been in that slow situation where you must download the zip of Wordpress, unzip it, and then FTP it to your web host. Today I bring gifts to those who have shell access, installation from the command line. I will give you all of the neat commands, and even a script to reduce the keyboard work.

Start by creating a database for Wordpress to run on.

Log in via shell you your web hosting account and execute the following commands with your own parameters for database name, user name, and password:
mysql
create database db_name_of_choice
GRANT USAGE ON db_name_of_choice.* to db_user_of_choice@localhost IDENTIFIED BY 'db_passwd_of_choice';
GRANT ALL ON db_name_of_choice.* to db_user_of_choice@localhost;

Write a Wordpress install file.

From the folder you would like to install Wordpress into, execute the following command:
vi installWP.sh

Copy+Pasting with VIM can be accomplished using the following key commands:
Press "a" to allow for text entry in VIM.
Press CTRL+V to paste the following lines of code into VIM.

Now copy+paste the following commands in:
wget http://www.wordpress.org/latest.zip
unzip latest.zip
cd wordpress
mv * ../
cd ..
rm -R wordpress/
echo "### Removing latest.zip install files ###"
rm -R latest.zip
mv wp-config-sample.php wp-config.php
echo DONE!

Now save the file
ESC
Press SHIFT+":"
type: wq!
Press RETURN/ENTER

Run the install file.

Change the permissions on installWP.sh so it can run as a shell script.
chmod 755 installWP.sh

Now run installWP.sh
./installWP.sh

Setting the database settings in wp-config.php.

With Wordpress now downloaded, and extracted from the zip file we need to configure our database name, user name, and password in the wp-config.php file.
vi wp-config.php

Find the following lines, and add your database settings from before:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'db_name_of_choice');
/** MySQL database username */
define('DB_USER', 'db_user');
/** MySQL database password */
define('DB_PASSWORD', 'db_passwd');

Key VI Commands
Press "a" to allow for text entry in VIM.
ESC to exit text entry.
Press SHIFT+":" to run save or exit commands
type: wq! to write the file, and quite.
Press RETURN/ENTER

Installation complete!

The Wordpress application is now setup, and is ready for in-browser configuration. Browse to the location where you installed Wordpress and you should see the following screen.

Wordpress 3 Install

Answer a few configuration questions and you will be up and running.

~Nathan Hein

June 21, 2010

Google’s Command Line Tool

Now I do not want to set a precedent here that I only post when Google releases a new tool, but unfortunately this is the most exciting thing since the Google Font API. GoogleCL, Google’s new Command Line tool, comes with access to Blogger, Calendar, Contacts, Docs, Picasa, and Youtube. I dislike Google as much as the next guy, despite using Gmail, gDocs, gCalendar, and having and Android phone, but you have to admit this really covers the gamut of what we use the web for most. The only thing missing is some kind of Facebook and/or Twitter utility via Google.

Google Project Page: http://code.google.com/p/googlecl/

Google’s Blog post announcing CL

Five Really Handy Google Command Line Tricks

~Nathan Hein