(1) Install AWS CDK

npm i -g aws-cdk

(2) Create a template

cdk init --language typescript

When you initialize the project, it creates a bunch of files with all the configuration done. It has App and Stack.

- bin
- myapp.ts
- lib
- constructs
- mykinesis.ts
- mylambda.ts
- stacks
- mysimplestack.ts

(3) Compile the app

install S3 and Dynamodb construct libraries from npm:

npm install @aws-cdk/aws-s3@aws-cdk/aws-dynamodb

Now compile app

npm run build

(4) List the stacks in the app

cdk ls

(5) Synthesizing CloudFormation template

cdk synth

(6) Deploying

You can use the command to install the bootstrap stack into an environment:

cdk bootstrap

Use to deploy a CDK app:

cdk deploy

(7) Checking diff

cdk diff

(8) Deleting the stack

cdk destroy


Create Custom Maintenance Page

In order to change override the default maintenance page, we need to add the following commands into the file

<!doctype html>
<html>
<head>
<title>Be right back.</title>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"><style>
html, body {
height: 100%;
}
body {…

1-Apache Vhost Configuration

A domain name registered and pointed to your server’s public IP address. For this tutorial, we use redhillinteractive.com and www.redhillinteractive.com which are pointed to our server. (you should use yourselves domain)

vi /etc/apache2/sites-enabled/wordpress.conf

<VirtualHost *:80> ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName redhillinteractive.com
ServerAlias www.redhillinteractive.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log …


Step 1 — Creating a New User

sudo adduser sftpuser
sudo passwd sftpuser

Step 2 — Creating a Directory for File Transfers

sudo mkdir -p /var/sftp/sftpuser
sudo chown root:root /var/sftp
sudo chmod 755 /var/sftp
sudo chown sftpuser:sftpuser /var/sftp/sftpuser

Step 3 — Restricting Access to One Directory

We will append following commands in /etc/ssh/sshd_config file for Restricting Access to One Directory.

sudo vi /etc/ssh/sshd_configMatch User sftpuser
ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/sftp
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

Exclude Packages with yum Command

suddo yum update --exclude=mysql* --exclude=zabbix*

Exclude Packages from Auto Update

Edit /etc/yum.conf in vi editor

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
exclude=mysql* zabbix*

Install the required packages:

sudo yum install -y device-mapper-persistent-data lvm2

Add the Docker CE repo:

sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo

Install the Docker CE packages:

sudo yum install -y docker-ce docker-ce-cli containerd.io

Start and enable the Docker service:

sudo systemctl start docker
sudo systemctl enable docker

How to test your docker installation

docker run hello-world

Get system-wide information about Docker:


How to create a second database in the same RDS instance on AWS RDS

If you want to create a second database schema in running RDS instance. So you may follow the below steps.

1-Connect your RDS instance through master password.

# mysql -uusername -ppassword -h rds-hostname

2-Now in RDS instance (MySQL) shell prompt. You can create a new database and a new user

mysql> CREATE USER 'newusername'@'%' IDENTIFIED BY 'password';
mysql> CREATE DATABASE newdatabase;
mysql> GRANT ALL PRIVILEGES on newdatabase.* To newusername@'%';
mysql> FLUSH PRIVILEGES;
mysql> SHOW databases;

3- Now you be able to login with the new_user with new_database

# mysql -unewusername -ppassword -h rds-hostname

4- You be able to restore the dump (from bash shell) in your new database.


MySQL replication is a process that enables data from one MySQL database server (the master) to be copied automatically to one or more MySQL database servers (the slaves).

First, let’s set up 2 MySQL servers. (MySQL install)
Master Database: 10.0.0.11
Slave Database : 10.0.0.12

Change settings on Master Host

Change in /etc/my.cnf file settings and…


Laravel is an open source PHP framework designed for the faster development of MVC web applications in PHP.

Setup Amazon Linux Extra

First of all, you need to check the system architecture.

cat /etc/*-release


If you run “yum install mysql” on CentOS 7, it is MariaDB that is installed rather than MySQL. MySQL is not available in the default CentOS 7 repositories so we will be installing the packages from the MySQL Yum Repository.

Install MySQL 8.0 on CentOS 7

Enable the MySQL 8.0 repository:

sudo yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

Install…

Hakan Bayraktar

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store