Before follow this post you must setup the Stratos2 Demo in your machine. Please refer the following post
http://malalanayake.wordpress.com/2013/01/04/stratos2-demo-setup-alpha-with-open-stack/
"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"
[sourcecode language="bash"]
ssh wso2@172.14.0.1
password : g
[/sourcecode]
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
[sourcecode language="bash"]
export STRATOS_ADC_HOST=172.14.0.1
export STRATOS_ADC_PORT=9445
[/sourcecode]
3. Go to extracted CLI folder and run the stratos.sh with username and password
[sourcecode language="bash"]
./stratos.sh dinuka@stratos.com dinuka123
Then you will move to "stratos>"
[/sourcecode]
In Stratos2 demo environment we have cartridge call "php", now I'm going to subscribe to that cartridge from my tenant dinuka@stratos.com
4. Now go to above stratos> and follow the command to subscribe to php
[sourcecode language="bash"]stratos> gtsubscribe php sampleapp[/sourcecode]
Once we done this we can see the created and running php instance in the OpenStack from http://172.14.0.1/syspanel/instances/
At this moment separated php instance is available for my tenant dinuka@stratos.com 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 http://git.stratos.com/stratos.com/sampleapp
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
172.14.0.1 git.stratos.com
172.14.0.1 sampleapp.php.stratos.com
Now we can make the git clone form http://git.stratos.com/stratos.com/sampleapp
> git clone http://git.stratos.com/stratos.com/sampleapp
username as dinuka@stratos.com 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
[sourcecode language="bash"]
> git add *
> git commit -a -m "sampleapp commit"
> git push
[/sourcecode]
username dinuka@stratos.com password dinuka123
Go to http://sampleapp.php.stratos.com:8280/ and you can see the committed test.php file and you can access it from the http://sampleapp.php.stratos.com:8280/test.php/
No comments:
Post a Comment