• 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 » Deploy OctoPress on OpenStack Swift (HP Cloud)

By Abhishek Ghosh March 26, 2015 12:29 am Updated on March 26, 2015

Deploy OctoPress on OpenStack Swift (HP Cloud)

Advertisement

Here is How To Deploy OctoPress on OpenStack Swift, Example Given With HP Helion Cloud With Only Python Swift Client & a Custom Shebang Script. Previously, we have shown how to deploy OctoPress on OpenShift PaaS with our custom shebang script and how to upload Static Objects on on OpenStack Swift (HP Cloud). Most funny part is that – we need no middleware like Pyrax for the whole work.

 

Deploy OctoPress on OpenStack Swift (HP Cloud) : Basic is OctoPress Not OpenStack Swift

 

The most important part of this guide to deploy OctoPress on OpenStack Swift is the philosophy – we basically need not to work hard behind OpenStack Swift, rather working on OctoPress makes the thing easier to deploy. The previous approaches by Rackspace were by not much deeper work with OctoPress.

When we are installing WordPress on Heroku versus OpenShift versus Rackspace versus HP Helion Cloud – the way needs to get modified. Minor modification of the web software gives better mileage. It is near impossible to know everything about all the backend softwares.

Advertisement

---

The trick is, essentially within the OctoPress configuration file – _config.yml. Except knowing about basics on OpenStack – like about OpenStack RC file and configuring Python Swift Client, only knowing the fact that HP Cloud CDN can host Static HTML websites – we need not much to know about OpenStack.

 

Deploy OctoPress on OpenStack Swift (HP Cloud) : How The Things Can Be Done

 

We have created a shebang script for the whole work to get fully semi-automated. You can check our GitHub repo for the script to deploy OctoPress on HP Helion Cloud’s OpenStack Swift.

You can dry run the script. First download the script and run these commands :

Vim
1
2
chmod +x shiftoctopress.sh
sh shiftoctopress.sh

Do not use iTerm2 on OS X, use Terminal. You should place this script at your $HOME directory and execute it. You need to have Python Swift Client installed and configured on your local computer. Here is the whole script :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash -e
#
 
echo "This Script Will Deploy OctoPress on OpenStack Swift Object Storage."
read -p "Hit Y or N " -n 1 -r
echo "+++++"
echo "You Should Place This Script at Your $HOME Directory and Execute it."
echo "++++++"
echo " "
echo "Is everything is fine?"
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Run this script in a separate new Terminal Window with Sudo Privilege"
echo "You can get sudo privilege by running :"
echo "sudo su"
fi
 
read -p "Read the instruction? Y will proceed, N will Quit " -n 1 -r
 
RUBY_VERSION=1.9.3-p448
 
echo "We will cd to $HOME"
echo " "
cd ~
echo "Your OctoPress on local computer is at"
pwd
echo " "
echo "We will delete any existing directory with the name octopress."
rm -r -f octopress
echo " "
echo "Supply the container name below:"
read container
echo " "
echo "Now, visit :"
echo "https://horizon.hpcloud.com/project/containers/"
echo "and make the container named $container public & enable CDN."
echo " "
echo "You should create a custom _config.yml file. We will delete the default one "
echo "and ask you a custom _config.yml file's URL, you can use Github Gist's RAW URL."
echo "A basic example is like :"
echo "https://gist.githubusercontent.com/AbhishekGhosh/d8283097c50c2b5d64a1/raw/3b6b914d88b5c7f49dded82ff71d1c696fc7bcfb/_config.yml"
echo " "
echo "copy that url and paste when we will ask you."
git clone git://github.com/imathis/octopress.git octopress && cd octopress
sudo gem install bundler
rbenv rehash
bundle install
rake install
cd ..
mkdir _deployment && cd _deployment
cp ../octopress/config.ru .
cp ../octopress/Gemfile .
bundle install
mkdir public/
git init .
git add .
git commit -am 'initial deploy'
cd ..
mv _deployment octopress
cd octopress
rm -r _config.yml
echo "Supply the full URL of the _config.yml file:"
read yml
echo " "
wget $yml
echo " "
git add _deployment/
rake install
echo "Depending on your environment, use bundle exec"
echo "Edit and save the file in source/_posts/2015-02-09-Hello-World.markdown"
echo "Proceed? Y/N"
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
rake new_post['Hello World']
echo "sudo su"
fi
rake generate
rm -rf _deployment/public/*
cp -R public/* _deployment/public/
swift upload $container *
finish=`date "+%Y-%m-%d-%H-%M-%S"`
echo "Deployment at Swift container $container completed at ${finish}"
read -p "OK. This Script Will Quit. That is Desired. Hit Y or N " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
exit
fi

For readability purpose, we have made the above one shorter than the real script. When you will execute the script, it will look like this :

Deploy OctoPress on OpenStack Swift (HP Cloud)

Quite obviously, the Container needs to be Public and CDN enabled. The script is quite complex, it is not that easy to combine so many works together.

 

_config.yml Matters the Most

 

Here is custom sample gist of the _config.yml file. A running live example of OctoPress is here.

There are OctoPress specific issues which needs to be fixed (which we are not interested to fix). You’ll notice that, the hyperlinks are not working, like Blog Archives link will not work. This is nothing because the links should be like :

Main : /_deployment/public/index.html

Archive : /_deployment/public/blog/archives/index.html

Blog Post : /_deployment/public/blog/2015/03/26/hello-world/index.html

Feed : /_deployment/public/atom.xml

These are permalink related stuffs and expect the noobs, they are not quite difficult to fix. If you set those -Meta content headers, you can omit the index.html part.

 

Why the _deployment Directory?

 

If you follow Rackspace Pyrax way, it will give the way to directory browsing :

http://ha5b38a50fda888a7851b261ba7835f0a.cdn.hpcloudsvc.com

But browsing _deployment directory is not possible :

/_deployment/

try to access :

/_deployment/public/

you can only access :

/_deployment/public/index.html

and other static files.

So, if you only upload the _deployment directory and set container sync, versioning; it becomes a safer setup. Now, after a bit working and pointing a naked domain or subdomain towards it, it will be quite safer. At the same time, the localhost setup is git based. If you simply add remote, you can change from OpenStack Swift to normal server or PaaS. Wider easy compatibility. The work might be more with OctoPress, but this approach is the proper approach.

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 Deploy OctoPress on OpenStack Swift (HP Cloud)

  • OpenShift OctoPress Auto install Script

    OpenShift OctoPress Auto install Script is an Advanced Script to Run OctoPress on Free OpenShift PaaS Practically Without Any Knowing Ruby or Git.

  • Installing Octopress on Openshift PaaS

    Installing Octopress on Openshift PaaS can be done in two ways. We can work from CLI and or modify rake file to create OpenShift Cartridge.

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

  • Publishing an OctoPress Site on Shared Hosting

    Publishing an OctoPress Site on Shared Hosting is Not That Difficult Than it Sounds. As We Can Use Git Push on Shared Hosting, It is Easy.

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