Create a static web site on IBM Bluemix

I have answered on developerWorks forum about how to create static web site server on IBM Bluemix. But I thought it should be mentioned on this blog too.

Firstly, for users of Bluemix, there seems to have misconception that it is only for web applications, such as Liberty, Node.js. If we really understand the IBM Bluemix architecture, it is composed of Linux (container) and router in a simple view.

20140723 - bluemix in a simple view
(IBM Bluemix in a very simple view).

The “Router” dispatches access to application URL to each Linux box which is running your application.

In theory, when the communication can be done via HTTP protocol, most of the applications will run on Bluemix. It naturally includes Apache or Nginx web server. We can try it in a simple way.

1. Create a simple index.html file just like below.


<html><body>
<H1>Hello Nginx </H1>
</body></html>

2. Push the contents to Bluemix with Nginx buildpack.

>cf push -b https://github.com/cloudfoundry-community/nginx-buildpack <appname>

Now, you will be able to see the static web site.

20140723 - sample web site

In this case, “amnthelloweb.mybluemix.net” is an application URL. The router dispatches the access to this URL to actual Linux container which is running Nginx web server on it.  The application server returns static contents “index.html”, and then the traffic goes back to the “Router”.

To appreciate that Bluemix is running a Linux container, we can try Cloud Foundry community buildpack called container-info-buildpack (https://github.com/cloudfoundry-community/container-info-buildpack). Here is my sample screenshot. I have run a simple Linux command such as “ls -l”.

20140723 - container info

After I deployed this application, I have deleted it completely, since it reveals container itself. I also recommend to delete the application after you have tried something.

Now, you might have understood about the Bluemix in a simple view.

Advertisements
This entry was posted in Bluemix. Bookmark the permalink.

3 Responses to Create a static web site on IBM Bluemix

  1. Pingback: Let’s welcome the new Bluemix Application Gallery! | Bluemix Analytics

  2. testurl says:

    Excellent web site you’ve got here.. It’s hard to find good quality writing like yours nowadays.

    I honestly appreciate individuals like you! Take care!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s