This documentation is for WSO2 Stratos 2.0.0. View the latest Apache Stratos documentation.
Page Comparison - Wordpress Guide (v.27 vs v.28) - Stratos 2.0.0 - WSO2 Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Table of Contents

 

Login to Stratos2.0

  1. Login to Stratos 2.0 using CLI.


  2. Subscribe to the PHP Cartridge

    Code Block
    stratos>subscribe php myweb --repoURL <git-repo-url> --username <username> --password <password>

    Example:

     

    Command Argument Description

    SyntaxDescription
    php
    PHP Cartridge
    myweb
    Alias name for the PHP application.
    repoURL
    URL of the GIT repository.
    Example:  https://github.com/lakwarus/wordpress.git
    usernameUsername for provided GIT account.
    password
    Password for provided GIT account.

     

Info

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

  1. Checkout the tenant repo into a folder of your choice.

    Code Block
    $ git clone https://github.com/lakwarus/wordpress.git


  2. When prompted , enter the tenant username and password .
  3. Change the current working directory to wordpress 

    Code Block
    $ cd wordpress
  4. List the folder.  

    Code Block
    $ ls

    Output

    Code Block
    simplesamlphp  sql  www
  5. Copy wordpress/* files into the www folder. 
    If you do not have the WordPress files initially go to  http://wordpress.org/latest.tar.gz  

    Code Block
    $ git add www/*

     

  6. Commit to local repository.  

    Code Block
    $ git commit -a -m “initial commit”

     Command Argument Description

    SyntaxDescription
    -a

    The option to automatically stage all tracked, modified files before the commit.

    -mThe option to provide the commit message on the command line.

     

  7. Push the changes to the remote repository.  

    Code Block
    $ git push

 

Setting up a database

  1. Subscribe to the MySQL database cartridge.  

    Code Block
    stratos>subscribe mysql mywebdb

     Command Argument Description

    SyntaxDescription
    mysql MySQL Cartridge.
    mywebdb Alias for MySQL database Cartridge

    Output


  2. Request for MySQL database Cartridge information.  

    Code Block
    stratos> info mywebdb

    Output


  3. 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.

    Code Block
    <ELB IP>    mywebdb.mysql.s2demo.wso2.com


  4. Go to https://mywebdb.mysql.s2demo.wso2.com:8243
  5. Login using the credentials given in the Cartridge Info output. The username is root.
     

Creating a Database

  1. On the phpmyadmin menu, click Databases .
  2. Enter the DB name in the Create new database text-box.
    For example, mywebdb
  3. 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.

    Code Block
    <ELB IP>    myweb.php.s2demo.wso2.com


  4. 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

  1. Go to https://myweb.php.s2demo.wso2.com:8243/ and access it.
    The run install page will appear. 

  2. Click Run the install to continue installing WordPress.
  3. Enter the details that you get when executing info mywebdb command.
    Example:  

    Code Block
    Host                : 175.41.181.16
    Database Username   : root
    Password            : vkgrrnox

  4. Click Submit.
    Now the https://myweb.php.s2demo.wso2.com:8243/ website is ready for use.