Showing posts with label Tech. Show all posts
Showing posts with label Tech. Show all posts

Sunday, August 9, 2015

Authenticating tenants and users in a web app deployed in WSO2 Application Server

WSO2 Application Server can be used to deploy and host standard web applications. WSO2 Application server runs on top of Carbon platform which provides the user and tenant management features as well. If you want the web application you deploy (in super tenant mode), to include user authentication (user login), you can leverage the API s provided by the Carbon platform. Relevant services are available as OSGi services, and you can do an OSGi lookup to obtain the required services.

Refer the code segment (jsp) below.

In the UI I have two text boxes to provide username and password.

If domain name is not specified in the username, it assumes a login of a super tenant or a super tenant user (hence domain is set to carbon.super). For tenant admins and users, relevant domain needs to be specified, and relevant tenant's UserRealm is loaded using the method AnonymousSessionUtil.getRealmByTenantDomain

For more about PrivilegedCarbonContext, refer here
     

<%@ page import="org.wso2.carbon.context.CarbonContext" %>
<%@ page import="org.wso2.carbon.context.PrivilegedCarbonContext" %>
<%@ page import="org.wso2.carbon.user.api.UserRealm" %>
<%@ page import="org.wso2.carbon.user.core.service.RealmService" %>
<%@ page import="org.wso2.carbon.user.api.UserRealmService" %>
<%@ page import="org.wso2.carbon.user.api.UserStoreException" %>
<%@ page import="org.wso2.carbon.user.api.UserStoreManager" %>
<%@ page import="org.wso2.carbon.core.util.AnonymousSessionUtil" %>
<%@ page import="org.wso2.carbon.registry.core.service.RegistryService" %>

<%! String removeTenantDomain(String userName) {
  if(userName.contains("@")) {
      String[] arr = userName.split("@");
      return arr[0];
     }
  return userName;
}
%>

<%
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    String tenantDomain = "carbon.super";
    boolean status = false;
    if (username != null && username.trim().length() > 0) {
        try {
            
            PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
            RealmService realmService = (RealmService) carbonContext.getOSGiService(RealmService.class);
            RegistryService registryService = (RegistryService) carbonContext.getOSGiService(RegistryService.class);
                     
            // If domain is specified
            if(username.contains("@")) {
             String[] arr = username.split("@");
             tenantDomain = arr[1];
             
            }
            UserRealm realm = AnonymousSessionUtil.getRealmByTenantDomain(registryService,realmService,tenantDomain);
            status = realm.getUserStoreManager().authenticate(removeTenantDomain(username), password);
            
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    if (status) {
        session.setAttribute("logged-in", "true");
        session.setAttribute("username", username);
        response.sendRedirect("login.jsp");
    } else {
        session.invalidate();
        response.sendRedirect("login.jsp?failed=true");
    }
%>

How to do a URL encode in WSO2 ESB

I have recently came across a requirement to send an XML paylod in URL encoded format to the backend. I was able to get it done with WSO2 ESB script mediator

Request to ESB is as follows:
<request><user>Sajith</user></request>


Backend expects the request as follows
http://localhost:8001/myservice?RequestXML=%3CRequest%3E%3CUser%3ESajith%3C%2FUser%3E%3C%2FRequest%3E


This was achieved by the following code. (Using javascript method encodeURL)
     <script language="js" description="">
         mc.setProperty("uri.var.encodedBody", encodeURI(mc.getPayloadXML()));
     </script>

     <send>
         <endpoint>
             <http method="post" uri-template="http://localhost:8001/myservice?RequestXML={uri.var.encodedBody}"/>
         </endpoint>
     </send>

Wednesday, May 13, 2015

Setting up a VM cluster in VirtualBox

You may come across a requirement to setup a cluster of virtual machines which need to be able to communicate among themselves as well as to access internet within each virtual machine instance. With the default network settings in VirtualBox you won't be able to achieve inter-VM communication. For that you need to setup a Host-only adapter.

Go to VirtualBox UI, File --> Preferences --> Network --> Host-only networks

Click "Add", and fill out IPV4 address as 192.168.56.1 and Network Mask 255.255.255.0. In the DHCP Server tab, untick enable DHCP server to disable it.



Now we have configured the host-only adapter. We can use this adapter when creating new virtual machines.

My requirement is to setup 2 virtual machines with the IP s 192.168.56.20 and 192.168.56.21.
I will show you how to setup one virtual machine.

Select the virtual machine you need to configure your network settings, and click on "Settings" icon --> Then click on "Network", you will get a UI as follows.


There, you tick on "Enable Network Adapter", Select Host-only Adapter in Attached to dropdown, and select the hostonly adapter that we configured earlier (vboxnet0) Click on the next tab to configure NAT, as follows.


Now you have configured both host-only and NAT Start your virtual machine.
 But still, if you do an "ifconfig" from your virtual machine you will not see any 192.168.xx ip has assigned. You need to do one more setting as follows.

Go to /etc/network/interfaces file and add following.

 #---------------------------------------
 auto lo
 iface lo inet loopback

 # Host-only interface
 auto eth0
 iface eth0 inet static
     address 192.168.56.20
     netmask 255.255.255.0
     network 192.168.56.0
     broadcast 192.168.56.255

 #-----------------------------------------

Restart your virtual machine and now you will see your 192.168.56.20 interface is up. Same way, you can configure your 192.168.56.21 virtual machine and so on....

You can ping from 192.168.56.21 machine to 192.168.56.20 and vise-versa

Wednesday, March 25, 2015

Convert request parameter to an HTTP header in WSO2 ESB



Say, you have a requirement to pass a request parameter (named key) which comes to an ESB proxy service, and that need to be passed to the backend service as an HTTP header (named APIKEY).

Request to ESB proxy service would be as follows.
      curl -X GET "http://localhost:8280/services/MyPTProxy?key=67876gGXjjsskIISL

In that case you can make use of xpath expression $url:[param_name]

In your in-sequence you can add a header mediator as follows to set the HTTP header with key request parameter



Thursday, December 18, 2014

Puppet configs

Puppet master
    server name in /etc/puppet/puppet.conf is not needed
    set autosign=true in /etc/puppet/puppet.conf

Obtain the puppet master hostname by executing  "hostname -f"

Puppet agent
    Set the proper puppet hostname in /etc/puppet/puppet.conf which is obtained in the previous command, if that is resolvable. Otherwise need to add that hostname into /etc/hosts file
    agent's hostname can be any value. No need to have master's hostnames init. puppet agents hostname need to be resolvable. for eg, to 127.0.0.1


   

Wednesday, October 8, 2014

Code Analysis with SonarQube Eclipse Plugin


SonarQube is a cool platform which helps to maintain code quality of a project, through integration of several code analysis tools like PMD, FindBugs, Checkstyle etc. Code quality of Apache Stratos
project is also measured and maintained through SonarQube.

Committers and contributors of Apache Stratos project are advised to have their code analysed through SonarQube before committing any new code or sending a PR.

There is an Eclipse plugin which makes developers' life easier, to run an analysis and find out code if there's any code quality issues, and fix without moving away from Eclipse.

I have recently written a wiki entry on how to configure and use SonarQube Eclipse plugin to analyse your code for Apache Stratos, you can find it here

Friday, February 28, 2014

MySQL ERROR 1045 (28000): Access denied for user 'username'@'localhost' (using password: YES)

Answer is,  :)

You probably have an anonymous user ''@'localhost' or ''@'127.0.0.1'.

refer : http://stackoverflow.com/questions/10299148/mysql-error-1045-28000-access-denied-for-user-billlocalhost-using-passw

Then delete those anonymous users,

mysql> DELETE FROM mysql.user WHERE User='';
mysql> flush privileges;

Done..!

Saturday, August 31, 2013

WSO2 ESB - Adding complex SOAP headers to a message

WSO2 ESB comprises of about 40+ mediators, using which you can perform several actions on the the SOAP messages being passed through. One such requirement would be to manipulate SOAP headers of a message.


What if you need to add a complex header structure to the message as follows,



A real use case of this kind of a requirement will be, you have a secured proxy service in ESB with UsernameToken Policy applied, but the backend service is not secured according to WSSE standards, but having its own way of authenticating, hence it requires messages coming to that endpoint having the structure of the headers as above, and username and password header values need to set with the username and password contains in the WSSE usernameToken of the original request.

That can be achieved using a class / custom mediator which involves writing some Java code, but if you need to avoid deploying / maintain a separate package for that you can chose either Header mediator, XSLT mediator or Script mediator.

Here I'm going to show how the script mediator can be used for the above use case.

Since you have enabled WS security in the proxy service, a valid SOAP request needs to contain the WSSE security headers, as follows.


As highlighted in the above request message, you have to extract the username and password values coming in the request and set those in the header structure which is expected by the backend service.

In order to do that your Script Mediator configuration will be as follows,

That's it..! If you do a full log in insequence you will see the message with added complex headers.. In a future post I Will show you how to use Header mediator and XSLT mediator to achieve the same task.

References
[1] http://docs.wso2.org/display/ESB470/Script+Mediator
[2] http://wso2.com/project/mashup/0.2/docs/e4xquickstart.html

Thursday, December 27, 2012

WSO2 Stratos 2.0 Alpha - Released !

Its was a great moment, before the year end 2012 we were able to release an Alpha version of long awaited WSO2 Stratos 2.0, and It was a great experience to be in part of the Stratos 2.0 team.

Stratos 2.0 is the next version of Stratos 1.x, and provides features including,

  •   Git / Git-hub integration support
  •   Pluggable cartridges ( PHP, MySQL and WSO2 carbon cartridges)
  •   Autoscaling into EC2 or Openstack  
  •   Custom Domain Mapping support


I will explain further on Stratos 2.0 architecture and functionality in future posts.

For more details you can refer to [1]

[1] http://www.mail-archive.com/dev@wso2.org/msg12504.html

Thursday, November 8, 2012

SSH: Agent admitted failure to sign using the key.

When you are trying to ssh to a remote server using passwordless login, you might get an exception
   "Agent admitted failure to sign using the key."

Issue may be the private key is not properly added (default location : ~/.ssh/id_rsa )

To fix the issue, (preferably in a separate terminal) issue the following command
    $ ssh-add

This will add the private key giving the output "Identity added: /home/wso2/.ssh/id_rsa (/home/sajith/.ssh/id_rsa)"

Now you can ssh to the remote server as expected...
     $ ssh user@remoteserver


Sunday, October 21, 2012

Vim editor - Paste toggle

You may have experienced an additional spaces or unexpected indentation when you paste some text into Vim from another application. To avoid that you need to set paste toggle option in Vim

Follow the steps below

$ vim ~/.vimrc

Put the following in your vimrc (change to whatever key you want):
set pastetoggle=

save and exit.

To paste from another application:
   * Start insert mode.
   * Press F2 (toggles the 'paste' option on)
   * Use your terminal to paste text from the clipboard.
   * Press F2 (toggles the 'paste' option off).


Friday, June 15, 2012

HowTo.. ?

A collection of some important "HowTo"s that I have come across..

Hope to periodically update the list as I get to know of a new "HowTo" ..



Mount a remote samba server shared directory in Linux (Ubuntu)

      $  mount -t cifs //10.2.5.5/shared -o username=un,password=pw /test


Extract a "tar.gz" file in Linux
    
     $ tar -xzf tar-file-name.tar.gz
  • tar - the tar command.
  • x - extract the archive.
  • z - uncompress the archive using gzip.
  • f - use archive file.
  • tar-file-name.tar.gz - the name of the tar.gz to create.
The tar command will extract all the files/folders in the archive to the current directory. 

Create a "tar.gz" file in Linux
    
     $ tar -czf new-tar-file-name.tar.gz file1 file2 folder1 folder2
  • tar - the tar command.
  • c - create new archive.
  • z - compress the archive using gzip.
  • f - use archive file.
  • new-tar-file-name.tar.gz - the name of the tar.gz to create.
  • file-or-folder-to-archive - the name of the folder we want to archive.

Mounting and un-mounting Qemu image


nbddevice="/dev/nbd2"
nbdmount="/dev/nbd2p1"


modprobe nbd max_part=8
qemu-nbd -c /dev/nbd2 image_path
mount /dev/nbd2p1 $work_dir/$image_template


umount $work_dir/$image_template
qemu-nbd -d /dev/nbd2



wget java
-------------
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com"  http://download.oracle.com/otn-pub/java/jdk/6u39-b04/jdk-6u39-linux-x64.bin

Wednesday, May 23, 2012

JavaScript Services in Action in WSO2 Mashup Server



WSO2 Mashup Server can be used to create and host JavaScript based mashups, acting as a hub for integrating your enterprise with rich information available on the web. Each mashup hosted in here is exposed as a new web service, and can be consumed by other mashups or web service clients.



In this post I'm going to show you how to get started with a JavaScript service, and consume that service inside another JavaScript (A client) embedded in an HTML page.

The scenario I'm going to cover is, developing a JavaScript based service for getting stock updates, which retrieve the stock information by invoking another external web service , and writing a JavaScript client inside an HTML, which invokes the JavaScript service. 


Writing the service

1. Download WSO2 Mashup Server binaries and extract into a convenient location (Hereafter referred to as MS_HOME ) 

2.  The JavaScript service should be written as a standard JavaScript file, as  mentioned below


3. This JavaScript file (stockQuote.js) needs to be placed in the following location
    <MS_HOME>/repository/deployment/server/jsservices/admin

4. Start the server ($ sh /bin/wso2server.sh )

5. If the StockQuote service is deployed successfully it should be logged as "Deploying Web service: stockQuote.js" and verify through Management Console (https://localhost:9443/carbon/service-mgt/index.jsp?region=region1&item=services_list_menu, or http://localhost:9763/services/admin/stockQuote?wsdl)

6. After successfully starting up the server, note that a folder is created in     <MS_HOME>/repository/deployment/server/jsservices/admin with the name stockQuote.resources.
Create a new folder with the name "www" if such a folder is not there already. Service client related code should be place in that folder.


Writing Client code and Installing a custom UI

JavaScript clients can invoke services via generated stubs. The generated stub is again a JavaScript file. It can viewed as follows,
http://localhost:9763/services/admin/stockQuote?stub

1. The sample code of StockQuote service client is listed below, note that it is embedded in an HTML file (which is the UI of your service) and in the top you can see a reference to the generated stub is included. Save this as index.html file into the "www" folder created above.
<MS_HOME>/repository/deployment/server/jsservices/admin/stockQuote.resources/www



2. Access the UI of the as follows to test the functionality
        http://localhost:9763/services/admin/stockQuote/
     In the text box, input a Stock symbol (eg: GOOG, IBM, VRTU .. etc) and check the results



Troubleshooting

In some situations, the generated JavaScript stubs are having some issues (which are already identified and will be fixed in the next release)

In such a scenario, as a hack you can do the following.

1. Access the stub (http://localhost:9763/services/admin/stockQuote?stub) and save the stub file in <MS_HOME>/repository/deployment/server/jsservices/admin/stockQuote.resources/www location as "stockQuoteStub.js"

2. The "bf2xml" function of the stub is the culprit here, so as a fix replace the relevant code related to bf2xml function with the code below


3. In index.html file modify the line which has the reference to the stub, so remove the line
  

and add the following line instead
 


Note that, now it is referenced the modified version of the stub, which is in the www directory

4. Now the issue should be fixed.

Friday, August 26, 2011

A Spontaneous Ad-hoc network to Share WWW Access (Raquel Lacuesta et al.)

This is a summary of the research paper A Spontaneous Ad-hoc network to Share WWW Access, done by Raquel Lacuesta et al. I chose this paper to present in my MSc course module, Mobile Computing.

In this paper, authors have proposed a secure spontaneous ad-hoc network, based on direct p2p interaction, in order to achieve a easy, quick and secure WWW access to the users. According to them, they are the first group of researches to come up with a design and a simulation of spontaneous ad-hoc networks.

Their paper is structured as follows
  1. An introduction to spontaneous ad-hoc networks and relevant literature
  2. The model they have proposed.
  3. Auto configuration procedures used in their model.
  4. A mathematical analysis.
  5. Security related things.
  6. The protocol procedure and messages
  7. Comparison of the proposal with some caching techniques
  8. Validation of the model through simulation
  9. Summary of the work and conclusion

Introduction

A mobile ad-hoc network can be briefly defined as a group of wireless nodes collaboratively form a network, which operates without the support of a fixed infrastructure. Several applications of such networks are; data collection in sensor arrays, communication in hostile or disaster stricken environments. Main challenges present in ad-hoc networking are that those should operate independent of an access point infrastructure, where nodes are unreliable and unpredictable. Also, the network should be able to provide administrative services need to support applications despite the fact that it operate independent of a pre-configured or centralized network management infrastructure. This is different from an infrastuctured networks, where those services like address allocation, name assignment are handled by a central authority of global scale. Name resolutions, file system management, mail and web services are centrally administered. Many general applications are server-based and hence preconfigured by human administrators and network tools. But in ad-hoc networks those services cannot be centralized and preconfigured because the network population and topology is not known in advance and also unpredictability of the network causes configuration needed to be changed rapidly.

A spontaneous ad hoc network is a type of ad-hoc network which is formed in a certain time during a period of time, with no dependence on a central server and without the intervention of expert users in order to carry out a specific task. The network is built by several independent nodes and the nodes are free to enter the network as well as leave the network whenever required. An example for a spontaneous network is when a group of people get together and use wireless computing devices for some computer based collaborative task. In spontaneous networks, users do not need to identify all the participating human and devices or don't need to configure their devices in advance.

Main features of ad-hoc networks can be described as follows.
  1. Network boundaries are poorly defined
  2. The network is not planned
  3. Hosts are not preconfigured
  4. No any central servers
  5. Users are not experts
Another important thing about spontaneous networks are that the participating nodes are limited in resources and power. Caching techniques have used in this model in order to avoid the nodes being overloaded.


Spontaneous Network Proposal Description

When a device joins a network following steps must be followed
  • Device should be integrated into the network
  • Service and Resource discovery
  • Accessing the services discovered
  • Collaborative tasks
A quick creation and configuration is very important for the performance of spontaneous networks, in the model described here authors have followed a way which requires minimum human intervention when setting up the network.


Saturday, March 5, 2011

My Research Areas

Workflow Engines - BPEL / Apache ODE / Web services orchestration


Friday, September 24, 2010

Quick fix for Eclipse Galileo GDK issue in Ubuntu Karmic Koala

Due to an incompatibility issue with GDK windows kit in Eclipse Galileo version in Ubuntu Karmic Kola environment, some buttons of Eclipse IDE are disabled, which blocks users from creating a simple Java project in Eclipse.

There is a quick fix for this issue.

Write a wrapper script (eclipse.sh) including following lines
export GDK_NATIVE_WINDOWS=1 # This line contains the fix.
/home/sajith/Dev/IDE/eclipse/eclipse # This line is for executing eclipse.

Setting Your Development Environment in Ubuntu (10.04)

Setting JAVA_HOME variable

If .bash_profile file is not in the ~ directory, use .bashrc file instead.

export JAVA_HOME variables and add those to PATH as follows.

export JAVA_HOME=/home/sajith/Software/jdk1.6.0_19
export PATH=$PATH:$JAVA_HOME/bin



Creating a symbolic link for Java

When you are trying to start up eclipse and then If you getting an error like this

"A Java Runtime Environment (JRE) or Jave Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations"

you have to create a symbolic link to java should be created in /usr/bin

For that excecute the following command
$ ln -s /home/sajith/Software/jdk1.6.0_19/bin/java /usr/bin/java


Tuesday, April 13, 2010

Solving screen resolution nightmare in Ubuntu 9.10

Have u ever spending days nights to figure out setting the best resolution for your screen in Ubuntu? Since i have had that nightmare, searching forums all over the internet, trying various methods, but were able to solve that only after wasting 2 days. :) My VGA supports resolutions like 1600x1200, but in Ubuntu, by default it comes with only 800x600 and 640x480 options.


So, thought of sharing how to configure those with you all.


The problem is that Ubuntu ( Im using 9.10 ) doesnt detect your monitor by default, compared to some other OSs like CentOS, where you can select the monitor easily, which is not the case in Ubuntu. ( Actually im quite new to Ubuntu, so may be there s a way for Guru s to select the monitor, but i couldnt find a way)


And my Graphic Adapter is Intel 82865G. You can check the type of your VGA by this command

$ lspci


Here s what i did. ( Many thanks to the folks who have documented various methods.. bt this i found most useful for mehttp://www.arunviswanathan.com/node/53 )


( In many forums they were talking about the xorg.conf in /etc/X11 . But in my machine i couldnt find that file under /etc/X11 )

Following command will display current display settings
$ xrandr

Output ( My default settings - only displays
800x600 and
640x480 )
---------
Screen 0: minimum 320 x 200, current 800 x 600, maximum 2048 x 2048
VGA1 connected 800x600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
800x600 60.3*
640x480 59.9


Then u should add the resulotion you need as a new mode, but before that you need to get other parameters required for this, unless the new mode will not be added properly. Therefore, execute the following ( The resolution you need to achieve, here for me its 1600x1200 with the refresh rate 59.9)

$ gtf 1600 1200 59.9

It generates the following output :
# 1600x1200 @ 59.90 Hz (GTF) hsync: 74.40 kHz; pclk: 160.69 MHz
Modeline "1600x1200_59.90" 160.69 1600 1704 1880 2160 1200 1201 1204 1242 -HSync +Vsync


Now add the new mode with above generated parameters as follows

$ xrandr --newmode"1600x1200_59.90" 160.69 1600 1704 1880 2160 1200 1201 1204 1242 -HSync +Vsync

Then add the above mode to your desired output ( In my case its VGA1 , as given by executing xrandr command. For you it may be different, so first execute xrandr and verify your output and use that output to execute the following command)

$ xrandr --addmode VGA1 1600x1200_59.90

Thereafter chose that as your resolution
$ xrandr --output VGA1 --mode 1600x1200_59.90

If everything went successfully, above resolution must be selected automatically now. :)

Even if you are successful, you need to go thru one final step to persist the changes so that its available at system startup ( otherwise vanishes after you logoff)

$ sudo gedit /etc/gdm/Init/Default

Look for the following lines
PATH=/usr/bin:$PATH
OLD_IFS=$IFS

Add the following lines below them (The mode you created above)
xrandr --newmode "1600x1200_59.90" 160.69 1600 1704 1880 2160 1200 1201 1204 1242 -HSync +Vsync
xrandr --addmode VGA1 "1600x1200_59.90"
xrandr --output VGA1 --mode "1600x1200_59.90"


Save and Exit. Logoff and Log in .. now you must be able to use your new resolution :)

Sunday, April 11, 2010

ADSL Connection setup in Ubuntu (9.10)

Have you ever came across with any issue in setting up ADSL connection in Ubuntu?
if so here s the solution.

PPPoE package should be installed before. To verify that the package is intalled, type
$ dpkg -s pppoeconf

If it is installed you should see the output on the package where two lines show this:

Package: pppoeconf
Status: install ok installed

If the package is not installed, insert your Ubuntu CD and in a terminal type:

sudo apt-get install pppoeconf

If the package cannot be found, you may have to add your Ubuntu CD to the list of software repositories. To add your CD, make sure it is inserted in your CD drive and in a terminal type:

sudo apt-cdrom add
After successfully installing PPPoE package,

$ sudo pppoeconf

And a text based interactive menu is prompted. Provide the relevant information, and your connection is
set up now.

To start your ADSL connection on demand, in a terminal type:

$ pon dsl-provider

To stop your ADSL connection, in a terminal type:

poff dsl-provider

Saturday, January 16, 2010

Make your java app "On-line" with Google App Engine


Even if you have developed a killer application, there is no point, if it cant be accessed by users all over the world without any hassle. Deploying you app with a reliable and a secured, cost efficient hosting provider is another challage u might have faced ... Google App Engine to the rescue ;)

Google officially released App Engine, way back in April 2008, as a Beta version, only with Python support, but now it got Java support as well. What s the specialty in App Engine? It is a platform for developing and hosting java (and python) applications, in Google's infrastructure, which supports a greater scalability, and thats of no cost :) absolutely free.. so, you as an application developer do not have to worry about how to manage thousands of concurrent requests to your application, how to manage your web server, all those will be look after by Google, providing best services you need.. The concept behind App Engine is "Cloud Computing", where Google provide their infrastructure as a service.

So, if you need to make your application available online at the same day you started development, Google App Engine is the best way :) It comes with a plugin to Eclipse, from which you can make your app available in WWW in few button cliks..

For more info :

Happy coding !!
Sajith K