Bash script designed to automate the installation, configuration, and maintenance of a web application using NGINX, Python's Flask framework, and various other tools using a script template given by the professor.
The script was developed by a team of four students as part of a university project during our third year of engineering studies.
This script automates the setup and maintenance of a web application environment. It handles the installation and configuration of NGINX, Flask, and Gunicorn, sets up a virtual environment, manages file permissions, and monitors server logs and SSH connection attempts.
- Install NGINX: Installs NGINX if not already installed.
- Start NGINX: Starts NGINX if not already running.
- Test NGINX Ports: Checks the ports used by NGINX.
- View Index: Opens the default NGINX index page.
- Customize Index: Replaces the default index.html with a custom one.
- Create New Location: Sets up a new directory for the web application.
- Setup Virtual Environment: Sets up a Python virtual environment.
- Install Virtual Environment Libraries: Installs necessary Python libraries.
- Copy Project Files to New Location: Copies project files to the new location.
- Install Flask: Installs Flask in the virtual environment.
- Test Flask: Opens the Flask application.
- Install Gunicorn: Installs Gunicorn in the virtual environment.
- Configure Gunicorn: Configures Gunicorn for the Flask app.
- Set Permissions: Sets the appropriate file permissions.
- Create Flask Service: Sets up a systemd service for Flask.
- Configure Reverse Proxy: Configures NGINX as a reverse proxy.
- Reload NGINX Configuration: Reloads NGINX configuration.
- Restart NGINX: Restarts the NGINX service.
- Test Virtual Hosts: Tests the NGINX virtual hosts.
- View NGINX Logs: Views the NGINX logs.
- Monitor SSH Connection Attempts: Monitors SSH connection attempts.
- Exit Menu: Exits the script menu.
The index.html
file contains basic HTML structure for displaying group members.
- Clone the repository.
- Run the script: ./script.sh
- Follow the menu options to install, configure, and maintain the web application environment.