Installing WordPress from the command line

Command Line Fu is awesome. Here is how we can download and install WordPress in just a few simple steps:

I am assuming you use OSX, linux, or any other *nix operating system, sorry windows users I don’t have one so look elsewhere. I also assume you have a webserver (nginx or APACHE), mySQL and PHP installed properly.

Open your servers shell prompt and CD to your web root, this may change based on your OS and configurations. If you use apache check your httpd.conf or vhosts.conf files to find your web root. If your using nginx, you probably know where it is already.

cd /var/www/domain.com/public_html/

Then we are going to download the latest version directly from WordPress, if you don’t have wget on your box, I would recommend you install it, or use curl instead (just replace wget with curl):

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

Now we are going to extract and uncompress the WordPress folder with tar:

tar -xzvf latest.tar.gz

Let’s set up our MySQL database, along with a user and password to access it. It should look something like this. You can also do this in phpmyadmin, cpanel, or webmin if you prefer or don’t have access to mysql command line.

mysql

CREATE DATABASE wordpress;

GRANT ALL PRIVILEGES ON wordpress.* TO "username"@"127.0.0.1" -> IDENTIFIED BY "password";

FLUSH PRIVILEGES;

EXIT

At this point you should be able to go to your browser and access the file /wp-admin/install.php which will let you enter your database configuration and finish the install.

One last thing, if you are using nginx your going to have to use a custom .conf file to handle the rewrite, I would check this wordpress-nginx project out on github for a good starting point.

That concludes this tutorial, if you have any questions please leave a comment. For more complete installation instructions and information WordPress installation instructions are available and I highly recommend you read them.

10 OS X Terminal Commands

Aside

I was trying to flush my DNS cache on my apple since my host rerouted the IP address and found this page in the process: ten-os-x-command-line-utilities-you-might-not-know.

My favorite ones on the list are definately TOP & screencapture, however I never knew about lipo or say.  Screencapture is definately useful for taking screenshots of my websites to email to clients.

Source:

Go to OSX Daily Website

Go to OSX Daily Website