Skip to main content

[Journal] Journey securing wordpress site using apache2 with modsecurity

This is my journey 

Prepare:

Knowledge & practical VM, Cloud, Linux Commands, Webserver.

Your AWS Account


 1.  Create an instance on AWS

Make sure the server can be accessed using SSH command

e.g:

ansible-user can access the server using passwordless for ansible management. 

ssh-copy-id ansible-user@192.168.1.1

ansible-user has access to sudo.

usermod -aG sudo ansible-user



Run:

ansible-playbook playbook.yml -i hosts --ask-become-pass



2. DNS Configuration

Point your domain name to IP

Example:


bagussa.my.id IN A 192.168.1.1

www.bagussa.my.id IN A 192.168.1.1



3. Run the below Ansible Playbook for getting he certificate using Let's Encrypt 

Let's Encrypt Ansible Role:

git clone


Hosts file:


Run:

ansible-playbook letsencrypt-issue.yml -i hosts --ask-become-pass 



4. Run the below Ansible Playbook for installing the wordpress and apache2

Wordpress Ansible role:

git clone https://github.com/bagussa/wordpress-ansible-role.git


Hosts file:

change ansible_host with your own server IP address, you can change as well for ansible_port, ansible_user according to your configuration.

[servers]

wwww-instance ansible_host=192.168.1.1 ansible_port=22 ansible_user=ansible-user







Comments

Popular posts from this blog

Troubleshooting WAF, CDN, and Load balancer

 Troubleshooting issues involving a Web Application Firewall (WAF), Content Delivery Network (CDN), and Load Balancer (LB) can be complex. Here is a step-by-step guide, including testing methods and relevant commands to isolate problems at each level. ### Step 1: Check Basic Connectivity 1. **Ping the Website**:    ```sh    ping example.com    ``` 2. **Check DNS Resolution**:    ```sh    nslookup example.com    ``` ### Step 2: Verify Load Balancer 1. **Direct Access to Load Balancer**:    Modify `/etc/hosts` to bypass CDN and WAF, pointing directly to the load balancer’s IP.    ```sh    sudo nano /etc/hosts    ```    Add the line:    ```    LB_IP example.com    ```     2. **Test HTTP Response**:    ```sh    curl -I http://example.com    ```    Check headers and status code to verify the load bal...

Dasar instalasi dan konfigurasi OpenLDAP

 ### Panduan Instalasi OpenLDAP Berikut adalah panduan sederhana untuk menginstal dan mengkonfigurasi OpenLDAP pada server dengan domain `bagussa.my.id` dan IP `10.10.10.1`.  #### 1. Instalasi OpenLDAP Pertama, instal OpenLDAP beserta paket-paket yang diperlukan: ```bash sudo apt update sudo apt install slapd ldap-utils ``` Selama instalasi, Anda mungkin akan diminta untuk memasukkan kata sandi untuk `admin` LDAP. Simpan kata sandi ini dengan aman. #### 2. Konfigurasi Manual di `/etc/hosts` Tambahkan entri untuk domain dan IP di file `/etc/hosts`: ```bash sudo nano /etc/hosts ``` Tambahkan baris berikut: ``` 10.10.10.1    bagussa.my.id ``` Simpan dan keluar dari editor. #### 3. Konfigurasi `/etc/ldap/ldap.conf` Edit file konfigurasi LDAP: ```bash sudo nano /etc/ldap/ldap.conf ``` Tambahkan atau modifikasi baris berikut: ``` BASE    dc=bagussa,dc=my,dc=id URI     ldap://10.10.10.1 ``` Simpan dan keluar dari editor. #### 4. Buat OU dan Group de...

Soal dan pembahasan LKSN ITNSA

Berikut adalah koleksi soal-soal ITNSA dan beberapa website yang memberikan pembahasan pada event perlombaaan LKS SMK Nasional bidang lomba IT Network Systems Administration. 2014 Palembang Di tahun ini ada 1 soal packet tracer. Di website dibawah ini diberikan juga cara pembahasannya. https://agussas.wordpress.com/2015/04/02/review-soal-lks-nasional-it-network-23-packet-tracer-challenge/ Semua soal:  https://www.dropbox.com/sh/l90zyke2ib5msgv/AAA3kPOFo-zEn4wPOW4a3iMwa?dl=0 dan https://drive.google.com/file/d/18lDhtMjAnPAhkfOJ6uFHsC5j6ycg3K4I/view Pembahasan juga dalam bentuk video di youtube:  https://www.youtube.com/watch?v=8QML594nQBU 2015 Banten Pembahasan:   https://www.youtube.com/watch?v=quDbpC2xSfQ Soal:  https://drive.google.com/file/d/1B09IYfdoGENBL3txSQodpptG1zdQxBWI/view 2016 Malang Soal:   https://drive.google.com/file/d/13-2bRtb5IXO9vxAhLfhghZbDXeUzD0FI/view Pembahasan:   https://www.youtube.com/watch?v=zmUSUZguH24 20...