Let's say you want to host domains first.com and second.com.
Create folders for their files:
| Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
| The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
| The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
| To use: | |
| 1. Install [Ansible](https://www.ansible.com/) | |
| 2. Setup an Ubuntu 16.04 server accessible over ssh | |
| 3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
| 4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
| #!/usr/bin/env bash | |
| export DEBIAN_FRONTEND=noninteractive | |
| sudo apt-get update | |
| sudo apt-get -y upgrade | |
| # Get "add-apt-repository" Command | |
| sudo apt-get install -y software-properties-common |
| # post_loc.txt contains the json you want to post | |
| # -p means to POST it | |
| # -H adds an Auth header (could be Basic or Token) | |
| # -T sets the Content-Type | |
| # -c is concurrent clients | |
| # -n is the number of requests to run in the test | |
| ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
| <?php | |
| $attributeValues = array( | |
| 'color' => array('Red', 'White', 'Blue'), | |
| 'size' => array(1, 2, 3, 4), | |
| 'fabric' => array('Cloth', 'Silk') | |
| ); | |
| class Cartesian | |
| { |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project name="DB Post Deploy Restore" default="run"> | |
| <property file="properties" /> | |
| <!-- find out what db's need to be restored and loop through the process for each --> | |
| <target name="run"> | |
| <input propertyname="production.user">(Required) Please enter your ssh user name:</input> | |
| <foreach list="${dbs}" param="db" target="prepare" /> |
| # update | |
| sudo yum -y update | |
| sudo yum -y upgrade | |
| # enable EPEL6 by changing enabled=0 -> enabled=1 | |
| sudo vim /etc/yum.repos.d/epel.repo | |
| # install htop | |
| sudo yum install htop |