Collection of Opensource Runbooks

👋 Welcome to Runbook.Site - A collection of Opensource Runbooks!

Backing Up a MySQL Database

This runbook describes the process to back up a MySQL database. Prerequisites Access to the database server Database credentials Steps Login to the Database Server ssh user@db-server Dump the Database mysqldump -u root -p database_name > backup.sql Compress the Backup tar czf backup.tar.gz backup.sql Transfer the Backup to a Safe Location scp backup.tar.gz user@backup-server:/path/to/backup/ Remove Old Backups find /path/to/backup/ -type f -mtime +30 -exec rm {} \; Verification Check the backup file size and integrity....

Runbook.site

Configuring Nginx as a Reverse Proxy

This runbook outlines the steps to configure Nginx as a reverse proxy for an application. Prerequisites Access to the server Nginx installed Application running on a specific port Steps Install Nginx sudo apt install -y nginx Create Nginx Configuration File sudo nano /etc/nginx/sites-available/app_proxy Add the Configuration server { listen 80; server_name yourdomain.com; location / { proxy_pass http://localhost:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } Enable the Configuration sudo ln -s /etc/nginx/sites-available/app_proxy /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx Verification Check the application at http://yourdomain....

Runbook.site

Creating a Cron Job

This runbook provides instructions on how to create a cron job on a Linux server. Prerequisites Access to the server Root or sudo privileges Steps Open Crontab crontab -e Add a Cron Job # m h dom mon dow command 0 2 * * * /usr/bin/backup.sh Save and Exit Save the file and exit the editor. Verify the Cron Job crontab -l Verification Ensure the cron job is listed. Check logs to verify the cron job runs at the specified time....

Runbook.site

Deploying a Web Application

This runbook outlines the steps to deploy a web application. Prerequisites Access to the repository Deployment credentials Steps Clone the Repository git clone https://github.com/your-repo/web-app.git cd web-app Install Dependencies npm install Run Tests npm test Build the Application npm run build Deploy to Server scp -r build/ user@server:/var/www/web-app Verification Check the web application at http://your-server-address. Ensure all endpoints are working.

Runbook.site

Installing Docker

This runbook explains how to install Docker on a Linux server. Prerequisites Access to the server Root or sudo privileges Steps Update Package List sudo apt update Install Required Packages sudo apt install -y apt-transport-https ca-certificates curl software-properties-common Add Docker GPG Key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - Add Docker Repository sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" Install Docker sudo apt update sudo apt install -y docker-ce Start and Enable Docker sudo systemctl start docker sudo systemctl enable docker Verification Check Docker version: docker --version Run a test container: sudo docker run hello-world

Runbook.site

Monitoring System Performance

This runbook provides steps to monitor system performance on a Linux server. Prerequisites Access to the server Steps Check CPU Usage top Check Memory Usage free -h Check Disk Usage df -h Check Network Usage iftop Install Monitoring Tools (Optional) sudo apt install -y htop glances nload Run Monitoring Tools htop glances nload Verification Ensure system resources are within acceptable limits. Identify and troubleshoot any bottlenecks or issues.

Runbook.site

Restoring a MySQL Database

This runbook details the steps to restore a MySQL database from a backup. Prerequisites Access to the database server Database credentials Backup file available Steps Login to the Database Server ssh user@db-server Transfer the Backup File scp user@backup-server:/path/to/backup/backup.tar.gz . Extract the Backup tar xzf backup.tar.gz Restore the Database mysql -u root -p database_name < backup.sql Verify the Restoration mysql -u root -p -e "SHOW TABLES;" database_name Verification Check that all tables and data are present in the database....

Runbook.site

Runbook Template

This is a template for creating runbooks. Prerequisites Steps Verification

Runbook.site

Setting Up a Firewall

This runbook explains how to set up a firewall on a Linux server using UFW. Prerequisites Access to the server Root or sudo privileges Steps Install UFW sudo apt install -y ufw Allow SSH Connections sudo ufw allow OpenSSH Enable the Firewall sudo ufw enable Allow Other Essential Services sudo ufw allow http sudo ufw allow https Check Firewall Status sudo ufw status verbose Verification Ensure SSH connection remains intact. Verify that the web server and other allowed services are accessible....

Runbook.site

Setting Up a New Linux Server

This runbook provides the steps to set up a new Linux server. Prerequisites Access to the server Root or sudo privileges Steps Update Package Lists sudo apt update Upgrade Packages sudo apt upgrade -y Install Common Utilities sudo apt install -y curl wget git vim Set Up Firewall sudo ufw allow OpenSSH sudo ufw enable Create a New User sudo adduser newuser sudo usermod -aG sudo newuser Configure SSH Access sudo cp /root/....

Runbook.site