Config/tools for getting a basic LEMP server off the ground and easy to configure for multiple users/domains and subdomains.
Find a file
Joby Elliott 2a5b05b320 Refactor error page handling and configuration
Simplify the error page handling and configuration by refactoring the code. Removed the unnecessary error message "IP banned for bad behavior" and replaced it with a generic 403 error response. Also, added new error pages for 404, 503, and 50x errors. The error pages are now stored in the /var/www/error-pages directory. Updated the nginx configuration to use the new error pages and added PHP handling for the error pages.
2024-10-23 19:37:16 -06:00
install Refactor error page handling and configuration 2024-10-23 19:37:16 -06:00
add-site.sh vastly expanded nginx config 2024-10-22 20:17:00 -06:00
install.sh bug fixes 2024-10-22 20:32:46 -06:00
README.md broke install into many separate scripts 2024-10-20 19:57:00 -04:00
site-config.conf Refactor error page handling and configuration 2024-10-23 19:37:16 -06:00

Web Server Setup Scripts

This repository contains scripts for setting up a very basic web server and adding new sites. It is not perfect, but it will get you off the ground quickly.

Installation

These commands will clone the tool onto your server and do the basic installation and configuration of core server software. At the moment that is Nginx, PHP, MySQL, and Certbot. A variety of fail2ban and ufw security measures are also added to improve your security posture.

# clone the repository and cd into it
git clone https://github.com/joby-lol/webserver-config
cd webserver-config
# run installation script
./install.sh

Adding a site

To set up a site, run add-site.sh and it will prompt you for all the data necessary. What you will need before running it is:

  • A domain name using Cloudflare's DNS, with both @ and * subdomains pointing at your server
    • If you want to use their proxy, you need to turn on the SSL/TLS encryption mode of Full, Full(Strict), or Strict(SSL-Only Origin Pull). Flexible or Off will not work.
  • A Cloudflare API key capable of editing the DNS for that domain