Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
Last active September 9, 2020 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedi4ever/6378173 to your computer and use it in GitHub Desktop.
Save jedi4ever/6378173 to your computer and use it in GitHub Desktop.
Example of creating a Wordpress challenge in Markdown & Mustache

Wordpress Setup

This challenge will see if you can setup and configure a wordpress correctly.

Wordpress is great!

Hardware

Ubuntu

The hardware used will be an Ubuntu machine.

  • os: ubuntu
  • arch: x84
  • user: ubuntu
  • distribution: 12.10

Scenario

Install Apache

The first step of installing wordpress is installing apache.

We will check:

  • if you have a webserver running on port 80

  • and we can connect to it

  • and the main page responds to helloworld

  • and you've use debian packages to install it

  • action:prepare the VM

  • check:apache is running

  • score:got apache running

Install Mysql

Now that you have Apache running, we can continue with installing mysql.

We will check:

  • if mysql is running port 6399

  • if we can connect with user wordpress and password cappucino

  • check:mysql is running

  • score:got mysql running

Install Wordpress

More levels will come

Actions

Prepare the VM

sudo apt-get -y install htop
sudo apt-get -y install nc

Checks

Apache is running

  • type: combi
  • checks:
    • apache2 http responds
    • apache2 package is installed

Apache2 http responds

  • type: http
  • statuscode: 200
  • url: http://{{{vm.ubuntu.ipaddress}}}/

Apache2 package is installed

  • type: exec
  • exitcode: 0
apt-get list | grep apache2

Mysql is running

  • type: exec
service mysql status | grep OK

Score

Got Apache Running

  • type: points
  • value: 20

Got Mysql Running

  • type: points
  • value: 20

Got Wordpress Running

  • type: points
  • value: 20

Solution

Apache running

  • type: exec
sudo apt-get -y install apache2

Mysql running

  • type: exec
sudo apt-get -y install mysql
sudo useradd wordpress
...

Meta

Credits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment