This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update && sudo apt upgrade -y | |
sudo apt install apache2 -y | |
sudo apt install easy-rsa -y | |
cd /usr/share/easy-rsa | |
sudo ./easyrsa init-pki | |
yes "" | sudo ./easyrsa build-ca nopass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Step 1 ## | |
In your current user directory, create a folder named ".aws". | |
Also create a file named "credentials" with your AWS credentials. | |
## Step 2 ## | |
Download Terraform (https://releases.hashicorp.com/terraform/0.14.7/terraform_0.14.7_windows_amd64.zip) | |
Create a folder with a name of your taste and place the "terraform.exe" file. | |
## Step 3 ## | |
In that same folder you just created, create the files: "provider.tf", "variables.tf", "main.tf" and "config.sh". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Download link: https://we.tl/t-mUDSSDVmff | |
apt update && apt upgrade -y | |
apt install docker.io -y | |
echo "'apache2' or 'nginx'?" | |
read var1 | |
if [[ "$var1" =~ ^([n][g][i][n][x])$ ]] | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## In this tutorial we are creating a simple Apache2 docker image. The main ideia is to create and push a docker image from scratch. ## | |
## Creating a local directory to store the configuration files ## | |
mkdir myapp | |
cd myapp | |
## Creating a "Dockerfile" with the following content ## | |
nano Dockerfile | |
FROM ubuntu:18.04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Topology: | |
172.31.0.11/24 (With Assossiated Elastic IP) | |
__________ | |
| | | |
| | | |
| CLIENT | | |
| | | |
|__________| | |
172.31.1.11/24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./easy-rsa init-pki | |
## Build the ca.crt ## | |
./easy-rsa build-ca nopass | |
## Generate a certificate request. This command automatically creates the private key (.pki file) ## | |
./easy-rsa gen-req <Server Name> nopass | |
## Self-sign the certificate to create the .crt file ## | |
./easy-rsa sign-req <Server Name> nopass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## We'll be creating and protecting a new website folder named "private" with the user "saissemet". ## | |
sudo mkdir /var/www/html/private | |
sudo echo 'saissemet' >> /var/www/html/private/index.html | |
sudo nano /etc/nginx/sites-available/default | |
location /private/ { | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/.htpasswd1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 443 ssl; | |
listen [::]:443 ssl; | |
server_name ec2-54-152-84-236.compute-1.amazonaws.com; | |
ssl_certificate /etc/ssl/certs/ec2-54-211-232-203.compute-1.amazonaws.com.crt; | |
ssl_certificate_key /etc/ssl/private/ec2-54-211-232-203.compute-1.amazonaws.com.key; | |
root /var/www/htmls; | |
index index.html; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 8443 ssl; | |
listen [::]:8443 ssl; | |
server_name ec2-54-152-84-236.compute-1.amazonaws.com; | |
ssl_certificate /etc/ssl/certs/ec2-54-211-232-203.compute-1.amazonaws.com.crt; | |
ssl_certificate_key /etc/ssl/private/ec2-54-211-232-203.compute-1.amazonaws.com.key; | |
ssl_client_certificate /etc/ssl/certs/ca.crt; | |
ssl_verify_client optional; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## We'll be creating and protecting a new website folder named "secreta" with the user "saissemet". ## | |
sudo nano /var/www/htmls/secreta/.htaccess | |
AuthType Basic | |
AuthName "Password Required" | |
Require valid-user | |
AuthUserFile /etc/apache2/.htpasswd | |
sudo nano /etc/apache2/sites-available/default-ssl.conf | |
<Directory /var/www/htmlapaches> |
NewerOlder