This repository contains a collection of cheat sheets useful for system administration and managing Linux servers, with a focus on tasks like configuring servers, managing users, and deploying applications.
Clone the repository and permit for execution
sudo git clone https://github.com/iMaGd/cheat-sheets.git && cd cheat-sheets
sudo chmod +x ./scripts/*.sh
To get latest changes from repo:
sudo chmod -x ./scripts/*.sh && sudo git pull && sudo chmod +x ./scripts/*.sh
# Install Ubuntu server essentials
./scripts/ubuntu-init.sh
# Add admin/moderator/regular user to server
./scripts/adduser.sh
# You can switch to new super admin user
su superadmin
# Harden SSH
./scripts/ssh.sh
# Install and configure Fail2Ban
./scripts/fail2ban.sh
# Setup firewall
./scripts/iptables.sh
# Install Web-server
./scripts/apache-install.sh # Apache2
# OR
./scripts/nginx-install.sh # Nginx
# Install PHP-FPM
./scripts/php-fpm.sh
# Install and secure Database
./scripts/mariadb-install.sh # MariaDB
# OR
./scripts/mysql-install.sh # MySQL
# Add database user
./scripts/mysql-add-user.sh
# Grant database user
./scripts/mysql-grant-user.sh
# Or update database user
./scripts/mysql-update-user.sh
# Add a virtual site
./scripts/apache-add-site.sh
# OR
./scripts/nginx-add-site.sh
# OR
./scripts/nginx-add-laravel.sh
# Install Composer
./scripts/composer-install.sh
# Install WP CLI
./scripts/wp-cli.sh
# Adds a WP site
./scripts/wp-add.sh
# Issue a SSL certificate
./scripts/ssl.sh
# Install PhpMyAdmin
./scripts/phpmyadmin.sh
# Install redis
./scripts/redis-install.sh
- Install MySQL on Ubuntu 22.04
- Docker Commands
- Install Docker and Docker Compose
- LAMP Boilerplate
- LEMP Boilerplate
- User Management and SSH User
- SSH Key Authentication and Server Setup
- Enabling OpCache in PHP
- PHP and PHP-FPM Configuration
- SSH, Fail2ban, and Firewall Configuration
- Enable SSL with Certbot
- Understanding and Managing the
www-data
User - Apache Virtual Hosts Setup
- Configuring Nginx
- Install WP CLI for WordPress Management
- WordPress Cookies and Sessions
- WordPress Multisite and Single Rewrites
- WordPress Media Management Commands
- Directory and File Size Management Commands
- Enable Custom CSS on WordPress Multisite
Cheat sheet for installing and securing MySQL on Ubuntu 22.04, including service management and user creation.
A collection of essential Docker commands for managing images and containers, as well as volume and network operations.
Steps to install Docker and Docker Compose on a Linux server.
A guide to setting up a Linux server with Apache, MySQL, and PHP (LAMP stack), including essential configurations.
Instructions for installing Nginx, PHP-FPM, and other necessary packages for a LEMP stack setup.
Commands for creating users, managing group membership, and configuring an SSH user for secure tunneling.
How to set up SSH key-based authentication and configure server settings for added security.
Configuration options to enable and manage the OpCache extension for PHP.
Guidance on tweaking PHP and PHP-FPM settings based on resource availability and application requirements.
Securing SSH access, installing Fail2ban, and configuring a firewall with iptables.
Commands to enable SSL using Certbot for domains managed by Apache.
Best practices for managing file ownership and permissions when running web servers and PHP-FPM.
Examples of Apache virtual host configurations for different scenarios including React applications and proxy to other servers or ports.
Basic Nginx server block configuration and virtual host setup for WordPress Multisite.
Instructions for installing WP CLI to streamline management of WordPress installations.
Understanding different types of cookies and their usage in WordPress.
Code templates for Apache mod_rewrite compatible with WordPress multisite (using directories or root) and single sites.
Command line operations to manage WordPress media, including removal and compression of images.
Quick commands to review and manage the sizes of directories and files.
A code snippet to allow custom CSS for users with appropriate capabilities on a WordPress Multisite network.
For more detailed information, please refer to the respective cheat sheets within this repository.