• 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 » OpenStack Swift (HP Cloud CDN) with WordPress W3TC

By Abhishek Ghosh January 27, 2015 5:52 pm Updated on January 27, 2015

OpenStack Swift (HP Cloud CDN) with WordPress W3TC

Advertisement

We Can Use Python Swift Client to Selective Upload the Static Objects to OpenStack Swift, like in HP Cloud CDN. Here is How to Configure W3TC. W3TC means – W3 Total Cache Plugin. There are few steps involved. First and foremost important thing is that – creating a PHP based Plugin or helper Plugin for WordPress W3TC is not that easy for Key Stone Based Authentication System. Rackspace Cloud uses API, it makes it easy to upload stuffs. However, we have ways for you, primitive, but you can use nicely.

 

OpenStack Swift (HP Cloud CDN) with WordPress W3TC : Initial Upload

 

Previously, we have described how to upload all the things to OpenStack Swift (HP Cloud CDN). You must read it. That is the basic thing for the uploading part. But, uploading in that way, has risk of uploading the core PHP files, even uploading backups in .sql format.

So, you will arrange exactly the same settings but at the point of running commands, you’ll stop. We need to add filter for the file types. We can exclude the .php, .htaccess, .html files in several ways. If your WordPress is installed at /usr/share/nginx/html, then, you can copy to a directory named cdn (or whatever you want to name it) :

Advertisement

---

Vim
1
rsync -av --exclude='*.PHP' --exclude='*.ZIP' --exclude='*.SQL' /usr/share/nginx/html /usr/share/nginx/html/cdn

Now, if cd to that cdn directory and upload all the stuffs, it becomes easier. You can, even exclude the directories to extract files. This is the syntax :

Vim
1
rsync -av --progress /source /destination --exclude exclude-directory-name

Second way to add filter for the file types is using tar :

Vim
1
tar -c --exclude .php --exclude .sql | tar -x -C ~/dest

Yes, cp can do it :

Vim
1
cp !(file1|file1) dest

or

Vim
1
find ./source-directory -not ( -name .php -a -prune ) -print0 | xargs -0 -IFILES cp FILES ./destinationdirectory

But works better as bash script :

Vim
1
2
3
4
5
# add your shell head here
# delete this line, keep second line clean
# sets extended pattern matching
shopt -s extglob  # sets extended pattern matching
cp $(ls -laR !(sub-dir1/file1|file2|sub-dir2/file3)) destination

OpenStack Swift (HP Cloud CDN) with WordPress W3TC

rsyc is the best way. Now cd to that directory and upload to an already published Container created via web GUI control panel. Run swift upload command, as we have shown in the previous guide.

If your instance get hanged or Nginx throws error, during the first time upload, simply reboot the instance from SSH. It happens because some files might be in use!

 

OpenStack Swift (HP Cloud CDN) with WordPress W3TC : W3TC Configuration

 

Set W3TC for Rackspace Cloud Files. We are showing you the options needs to be adjusted :

+ ————————————————————————
+ ————————————————————————
+ General
+ =======
+
+ Host attachments : Checked or Not, depends on your wish
+ Host wp-includes/ files : Checked
+ Host theme files : Checked
+ Host minified CSS and JS files : Checked
+ Host custom files : Checked
+ Force over-writing of existing files : Checked (does not matter)
+ Import external media library attachments : Unchecked
+
+ Configuration
+ =============
+ Username: Use a Fake Name
+ API key: Use a Fake Password
+ Location: [keep it default]
+ Container: Give real container name to remember yourself!
+ SSL support: [Yes for us]
+ Replace site’s hostname with: Paste the whole path like this,
+ this is SSL one, do not append HTTP or HTTPS
+ a248.e.akamai.net/cdn.hpcloudsvc.com/h3c328c03/whoever//wp-content
+
+ Advanced
+ ========
+
+ No need to change anything.
+ ————————————————————————-

Save the settings. It is likely, that you are using Nginx. W3TC will prompt to write this block on Default file (do you know, that W3TC has the option to set path to config file on the General settings page? Change the default value, you’ll get prompt) :

Vim
1
2
3
4
5
# BEGIN W3TC CDN
location ~ \.(ttf|ttc|otf|eot|woff|font.css)$ {
   add_header Access-Control-Allow-Origin "*";
}
# END W3TC CDN

Reload Nginx. Your static contents will be served via HP Cloud CDN / OpenStack Swift Storage.

Tagged With openstack php video cdn
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 OpenStack Swift (HP Cloud CDN) with WordPress W3TC

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

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

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

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