• 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 » Upload WordPress Objects to OpenStack Swift (HP Cloud CDN)

By Abhishek Ghosh January 23, 2015 6:12 pm Updated on January 23, 2015

Upload WordPress Objects to OpenStack Swift (HP Cloud CDN)

Advertisement

Here is How to Upload WordPress Objects to OpenStack Swift, Working Example is With HP Cloud CDN and W3TC Plugin. Necessity is the Mother. What a Linux Server will have difference with a Mac? We have shown how to upload objects to HP Cloud CDN, that is a raw OpenStack Swift from OS X. OpenStack Swift – simple! Why fight with hundreds of crap PHP scripts when there is a perfect tool name Python Swift Client? Most funny, Python Swift Client is more easy to use on GNU/Linux. For our Example, it is an Ubuntu Server! This thing actually trying for the last 3 years. HP has, dedicated developers as employees.

We love OpenShift. It is PaaS, true. But they honor all the peoples who works for free for OpenShift. No freebie, no backlink, not even a Retweet, who will work for free?

 

Upload WordPress Objects to OpenStack Swift (HP Cloud CDN) : Initial Preparation

 

Read that guide to upload stuffs to HP Cloud CDN. You need that modified OpenStack RC file. Our modified way is (this is for West) :

Advertisement

---

Vim
1
2
3
4
5
6
export OS_AUTH_URL=https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
export OS_TENANT_ID=xxxxxxxxxxxxxx
export OS_TENANT_NAME="xxxxxxxxxxx-Project"
export OS_USERNAME="yourusername"
export OS_PASSWORD="yourpassword"
export OS_REGION_NAME="region-a.geo-1"

We hope, you have a colorful SSH with Nano’s Syntax Highlighting. If you have not, read it later, you can do something within this guide. You are root, right? If sudo su is throwing error, read this guide to resolve sudo: unable to resolve host error. You can do that later too. Your $HOME is ~. You can not see, but there is a .bashrc file. Open it :

Vim
1
cd ~ && nano .bashrc

uncomment the line unset color_prompt force_color_prompt, that will give you some color on SSH. Go to the end of the file and add your modified real stuffs copied from above block, which is actually part of OpenStack RC file. Load the environment :

Vim
1
source .bashrc

First part done.

 

Upload WordPress Objects to OpenStack Swift (HP Cloud CDN) : Step 2

 

Run this command :

Vim
1
apt-get install python-swiftclient

It will say many things, you need not to read, accept with Y. After installation, run this command to test :

Vim
1
swift stat

It will return a thing which means, you have done the right :

Vim
1
2
3
4
5
6
7
8
No handlers could be found for logger "keystoneclient.httpclient"
       Account: XXXXXXXXXXXXXXX
    Containers: XXXXXX
       Objects: XXXXXXXX
         Bytes: 116969
Accept-Ranges: bytes
   X-Timestamp: 1416220171.44924
    X-Trans-Id: tx1baabf46a5ee4baea80a7-005

You can list your containers :

Vim
1
swift list

That No handlers could be found for logger "keystoneclient.httpclient" is not a problematic error. It looks bad, but you’ll have no issue. Suppose you are using nginx and your WordPress is located at /usr/share/nginx/html, then cd to that place :

Vim
1
cd /usr/share/nginx/html

Or may be :

Vim
1
cd /usr/share/nginx/html/wp-content

Upload to HP Cloud CDN Using OpenStack Swift Client

See the screenshot here in full size.

wget this on your local computer and read :

Vim
1
wget http://docs.openstack.org/api/openstack-object-storage/1.0/os-objectstorage-devguide-1.0.pdf

Upload all the files you want. Actually, on nginx, you need a simple directive to auto replace the static files’ URLs. That is exactly done by W3TC. You can enable CDN with Rackspace Cloud Files option and use the HP Cloud or whatever OpenStack Swift domain name. W3TC will provoke you to use password, username etc. Do not use your real HP Cloud credentials. Rackspace guys will able to see your password! NSA can also see, that is different thing. But the needed change either will be done automatically by W3TC or it will prompt. Together, PHP and Nginx block does the thing. Simple.

Yeah, as there is no filter, all files will get uploaded. 35MB extra upload. You can create a small bash script to do avoid typing commands and set cron. Instead of PHP, you’ll use command line. WordPress plugin is for those who use Shared Hosting.

No password prompt, no fuss. Very fast upload. You are not disturbing weak PHP, so no chance of WordPress white page. Run this command (create a container named tcw-january-w3tc from Dashboard, set TTL, Publish it publicly as CDN beforehand) :

Vim
1
swift upload tcw-january-w3tc /usr/share/nginx/html

You’ll see, how nicely stuffs are getting uploaded. If you want only to upload the updated stuffs, then run :

Vim
1
swift upload -c tcw-january-w3tc /usr/share/nginx/html

Thats what you need to create a script with. Instead of you, cron will run it. Virtual directory will be created in this way :

Vim
1
2
https://horizon.hpcloud.com/project/containers/tcw-all-january/usr/share/nginx/html/
# fake url

You can not download from CDN :

Vim
1
/usr/share/nginx/html/wp-config.php

It is file ownership and permission preventing it to get uploaded! Thats the fun of *nix. It is basically, file level backup which Rackspace sells at higher cost. If you modify the method, you can use more powerfully. By the way, it is Apache2 server, .htacess works! .htacess does not work. You can block need to delete the sensitive PHP, HTML etc. files on web server.

Tagged With openstack swift , koken integrate swift api , swift upload , wordpress cdn openstack
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 Upload WordPress Objects to OpenStack Swift (HP Cloud CDN)

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

  • 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.

  • OpenStack Swift & HPCloud CDN PHP Bindings : Basics

    Here is the basics of OpenStack Swift & HPCloud CDN PHP Bindings for the WordPress Plugin developers and those who works with PHP based CMS.

  • Python Script to Upload Files to OpenStack Swift (HP Cloud CDN)

    Here is a Simple Python Script to Upload Files to OpenStack Swift, for Our Case HP Cloud CDN. Very easy to use from Mac or Linux Server.

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