Wordpress Guide
Login to Stratos2.0
Login to Stratos 2.0 using CLI.
Subscribe to the PHP Cartridge
stratos>subscribe php myweb --repoURL <git-repo-url> --username <username> --password <password>
Example:
Command Argument Description
Syntax Description php
PHP Cartridge myweb
Alias name for the PHP application. repoURL
URL of the GIT repository.
Example: https://github.com/lakwarus/wordpress.gitusername Username for provided GIT account. password
Password for provided GIT account.
The provided PHP Cartridge is configured to except the following folder structure in order to work.
simplesamlphp sql www
Where the www
folder contains wordpress php files. For samples please go to https://github.com/lakwarus/wordpress.git .
Uploading WordPress
Checkout the tenant repo into a folder of your choice.
$ git clone https://github.com/lakwarus/wordpress.git
- When prompted , enter the tenant username and password .
Change the current working directory to wordpress
$ cd wordpress
List the folder.
$ ls
Output
simplesamlphp sql www
Copy
wordpress/*
files into thewww
folder.
If you do not have the WordPress files initially go to http://wordpress.org/latest.tar.gz$ git add www/*
Commit to local repository.
$ git commit -a -m “initial commit”
Command Argument Description
Syntax Description -a The option to automatically stage all tracked, modified files before the commit.
-m The option to provide the commit message on the command line. Push the changes to the remote repository.
$ git push
Setting up a database
Subscribe to the MySQL database cartridge.
stratos>subscribe mysql mywebdb
Command Argument Description
Syntax Description mysql
MySQL Cartridge. mywebdb
Alias for MySQL database Cartridge Output
Request for MySQL database Cartridge information.
stratos> info mywebdb
Output
Add an entry in the
/etc/hosts
file for mywebdb.mysql.stratos.com to be able to access the URL shown in the output of the above command.<ELB IP> mywebdb.mysql.s2demo.wso2.com
- Go to https://mywebdb.mysql.s2demo.wso2.com:8243
- Login using the credentials given in the Cartridge Info output. The username is
root
.
Creating a Database
- On the phpmyadmin menu, click Databases .
- Enter the DB name in the Create new database text-box.
For example, mywebdb
Add an entry in the
/etc/hosts
file for myweb.php.stratos.com to be able to access the URL shown in the output of the command when requesting for database information.<ELB IP> myweb.php.s2demo.wso2.com
Go to https://myweb.php.s2demo.wso2.com:8243
This request is sent to the WSO2 elastic load balancer. The user can access their application running on the PHP Cartridge through the load balancer.
Running the Installer
- Go to https://myweb.php.s2demo.wso2.com:8243/ and access it.
The run install page will appear. - Click Run the install to continue installing WordPress.
Enter the details that you get when executing
info mywebdb
command.
Example:Host : 175.41.181.16 Database Username : root Password : vkgrrnox
Click Submit.
Now the https://myweb.php.s2demo.wso2.com:8243/ website is ready for use.