• 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

This Article Has Been Shared 175 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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

  • Cloud Computing Categories : Cloud Computing in Layman’s Terms

    Cloud Computing Categories is purely based on the understanding of Cloud Computing in Layman’s Terms and does not follow the definitions and standards by NIST.

  • Cloud Computing vs Traditional Computing

    Cloud Computing vs Traditional Computing is the one of the topic most new users wants to know about. The basic reason to compare is to understand Cloud itself.

  • Cloud Computing XaaS : Approaches and Possibilities

    Cloud Computing XaaS is an approach towards everything to provide as a service to make available and consume like we use electricity.Read the important aspects.

  • Hybrid Cloud is the Future Not Public Cloud

    Hybrid Cloud is the Future Not Public Cloud, Because Control and Privacy of Data Becoming a Major Concern to the Corporate Sector and Medium Sized Companies.

  • Relationship of Geographic Location of Data Centers and Network Latency

    Relationship of geographic location of Data Centers and network latency is always one of the features which is taken into account while operating in different countries.

Additionally, 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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (21K Followers)
  • Twitter (5.3k 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

  • How Startups Can Convince the Investors April 14, 2021
  • What to Know About the Cloud Storage Services for Smartphones April 13, 2021
  • WonderFox HD Video Converter Factory Pro Review April 10, 2021
  • What is the Maximum Cable Length Between Arduino/ESP32 and a Sensor April 8, 2021
  • Is the Blockchain Hype Running Out of Breath? April 7, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "WP-CLI and Cloud Server," in The Customize Windows, July 7, 2014, April 16, 2021, https://thecustomizewindows.com/2014/07/wp-cli-cloud-server/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

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

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