Set up Nginx and Apache2 on RHEL (Red Hat Enterprise Linux) with Self-Signed SSL/TLS Certificates

Below is the Bash script to download and set up Nginx server with SSL using a self-signed certificate and user-provided details on RHEL (Red Hat Enterprise Linux): #!/bin/bash # Check if the script is running with root privileges if [ "$EUID" -ne 0 ]; then echo "Please run this script as root or with sudo." exit 1 fi # Check if a domain name is provided as an argument if [ $# -ne 1 ]; then echo "Usage: $0 <domain_name>" exit 1 fi # Assign the provided domain name to a variable domain_name="$1" # Prompt the user for SSL certificate details read -p "Enter the Country Code (e....

July 20, 2023 · 5 min · 1027 words · PandaC

Set up Nginx and Apache2 on Ubuntu with Self-Signed SSL/TLS Certificates

Below is a Bash script to download and set up Nginx server with SSL using a self-signed certificate and user-provided details: #!/bin/bash # Check if the script is running with root privileges if [ "$EUID" -ne 0 ]; then echo "Please run this script as root or with sudo." exit 1 fi # Check if a domain name is provided as an argument if [ $# -ne 1 ]; then echo "Usage: $0 <domain_name>" exit 1 fi # Assign the provided domain name to a variable domain_name="$1" # Prompt the user for SSL certificate details read -p "Enter the Country Code (e....

July 20, 2023 · 5 min · 982 words · PandaC