How to use CLI tool to subscribe to the available cartridges in Stratos2 Demo

04 Jan

Before follow this post you must setup the Stratos2 Demo in your machine. Please refer the following post

subscribe” function is one of major features included in the CLI tool. This is use for subscribe to available cartridges in the system.

1. Login to the VM by using username “wso2” password “g

ssh wso2@
password : g

Then go to the folder “/demo_setup/software” and extract “CLI.tar.gz

2. Type “sudo bash” to move as a “root” and export following parameters

export STRATOS_ADC_PORT=9445


3. Go to extracted CLI folder and run the with username and password

 ./ dinuka123
Then you will move to "stratos>"


In Stratos2 demo environment we have cartridge call “php“, now I’m going to subscribe to that cartridge from  my tenant

4. Now go to above stratos> and follow the command to subscribe to php

stratos> gtsubscribe php sampleapp


Once we done this we can see the created and running php instance in the OpenStack from


At this moment separated php instance is available for my tenant as a sampleapp

5. Lets look how to deploy the sample php file call test.php in to the allocated php server.

once we subscribe to the php cartridge it will create a specific GIT repository.
In above subscription you can see the git repo link as
So what we have to do is we need to take the “git clone” from this location

Before that we have to put the following entries to the /etc/hosts file this should be done in your machine not in the VM
go to your console and follow this command sudo vim /etc/hosts
and put the following entries into the hosts file

Now we can make the git clone form
> git clone
username as dinuka123

Now go to clone repo folder and you can see there are three folders as follows
simplesamlphp sql www

Now you can place the test.php file in to www directory and do the following commands to commit

> git add *
> git commit -a -m "sampleapp commit"
> git push

username password dinuka123

Go to and you can see the committed test.php file and you can access it from the



Leave a comment

Posted by on January 4, 2013 in Stratos, wso2


Tags: , ,

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: