• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » WP-CLI and Cloud Server

By Abhishek Ghosh July 7, 2014 5:55 pm Updated on July 7, 2014

WP-CLI and Cloud Server

Advertisement

With Cloud Automation, we can integrate WP-CLI, a command line tool for WordPress for better, easy and faster management on Cloud Server. As we have discussed before, there is huge change in Automation in the Cloud in recent time. Software defined, Bare Metal hosting with the flexibilities of a typical cloud IaaS are emerging now. Chef Software is rocking on OpenStack Cloud Software for IaaS and OpenShift PaaS. Providers like Rackspace has blueprints which uses WP-CLI for their Rackspace Deployments product. We talked about WordPress Command Line Tool before, the tool is same but we are elaborating something more.

 

WP-CLI and Cloud Server

 

For using WP-CLI on Cloud Server (we are assuming that you are using latest LTS version of Ubuntu on OpenStack Cloud, i.e. Ubuntu 14.04 at the time of publication of this article), you need to have a minimum knowledge on bash profile. You can read articles like Can Not Find .Profile File OS X, Change $PATH Variable on OS X for minimum idea on profiles on UNIX or UNIX Like Operating Systems / Linux. There will be not much difference in commands between OS X and Ubuntu except some Philosophical matters like Wheel Group, file permissions, source code etc. The reason to point to these articles is that; we will create a .bash_profile file for our root user and add the path to the wp-cli executable. The source code of WP-CLI is available here :

Vim
1
https://github.com/wp-cli/wp-cli

We can cURL the bash script from raw github :

Advertisement

---

Vim
1
https://raw.githubusercontent.com/wp-cli/wp-cli.github.com/master/installer.sh

Also, chef cookbook is available for wp-cli :

Vim
1
https://github.com/francescolaffi/chef-wp-cli

In this article WP-CLI and Cloud Server, we will discuss about the traditional WP-CLI, not the chef cookbook wp-cli.
WP-CLI and Cloud Server

 

WP-CLI and Cloud Server : Getting Started Guide

 

This is a bit complicated setup and demands minimum working experience with UNIX systems, if you are a new user; you should follow the plain one server WordPress Setup guide on Ubuntu. We will not need to do the steps like :

Vim
1
2
3
4
~  cd /var/www/html && rm index.html
# download wordpress
~  wget http://wordpress.org/latest.tar.gz
[...]

So, let us get started with WP-CLI installation. First, we will cURL the bash script to install wp-cli :

We should install git first, just a customary update and installing git after you SSH to the server instance as root :

Vim
1
apt-get update && apt-get install git

We will install wp-cli with two commands :

Vim
1
2
3
4
5
6
curl https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh && installer.sh bash
# one can avoid && and use fully two separate commands
curl https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh
installer.sh bash
# technically it should work with one command
curl https://raw.githubusercontent.com/wp-cli/wp-cli.github.com/master/installer.sh | bash

As we said, we need to work with bash profile :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
nano ~/.bash_profile
# add these lines
export PATH=/root/.wp-cli/bin:$PATH
source $HOME/.wp-cli/vendor/wp-cli/wp-cli/utils/wp-completion.bash
alias wp="wp --allow-root"
# do not add these lines. Try
# ' instead of "
# alias wp='wp --allow-root'
# Typography and keyboard mapping can change
# what we typed / wanted to show depending on OS
# save the file
# ^ + O writes, ^ + X exits

The third line; alias wp="wp --allow-root" is optional and to avoid specifying " --allow-root" while using wp as command by root user. You can read Create Aliases on OS X and Linux for Faster Work on Command Line for explanation. You can read more on alias part :

Vim
1
http://ss64.com/bash/alias.html

We should load the environment :

Vim
1
source ~/.bash_profile

You should work here :

Vim
1
cd /home/wordpress/public_html

You can install wordpress with this command :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
wp core install --url="edit_domain_name"  --title="Edit Blog Title" --admin_user="edit_admin" --admin_password="put_password" --admin_email="edit_email"
# output
# Success: WordPress installed successfully.
# kind on manual
wp help
# get list of posts
wp post list
# output
+----+--------------+-------------+---------------------+-------------+
| ID | post_title   | post_name   | post_date           | post_status |
+----+--------------+-------------+---------------------+-------------+
| 1  | Hello world! | hello-world | 2014-06-07 21:02:09 | publish     |
+----+--------------+-------------+---------------------+-------------+

Yes, we can run database related commands too :

Vim
1
2
3
4
5
6
7
wp db query "SELECT user_login,ID FROM wp_users;"
# output
+------------+----+
| user_login | ID |
+------------+----+
| admin      |  1 |
+------------+----+

It is not our work to copy paste the example usages :

Vim
1
2
http://wp-cli.org/commands/
https://github.com/wp-cli/wp-cli/wiki/Community-Packages

That is all about WP-CLI we wanted to tell you. For Rackspace Deployment, the wp-cli is programmatically deleted. They probably use Checkmate and OpenStack Heat, more complex, easy for the end user :

Vim
1
https://github.com/rackspace-orchestration-templates/wordpress-single

Tagged With ZDPP , RWZQ , PMPG , K9PV , GS1O , FAI7 , DGAN , 7C38 , 5TKD , 4VKL
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to WP-CLI and Cloud Server

  • Command Prompt Commands : Alphabetical list of all commands in Windows 7

    Command Prompt Commands in Windows 7 provides the user access to 180+ command line commands. Here is a list of 200 Command Prompt Commands in Windows 7.

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WP-CLI Tips and Tricks

    If you’re a WordPress user, chances are you’ve heard of WP-CLI. For those who don’t know, WP-CLI is a set of command-line tools for managing WordPress sites. It can be used for everything from installing and updating plugins to creating and managing users. In this post, we’re going to explore some tips and tricks for […]

  • Run Bash Scripts on Windows 10 Via Git Bash To Launch Linux GUI App

    Run Bash Scripts on Windows 10 Via Git Bash. Git Bash Offers Integrity Options With Windows 10 Bash Making it Easy to Work on Both Windows & unix System.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy