This repository contains an automation script to deploy web applications using Nginx. The script supports various application types, including static HTML/CSS/JS applications, as well as modern JavaScript frameworks like React, Angular, and Vue. It adapts to the user's operating system, whether it's Debian/Ubuntu or RHEL/CentOS.
- Automatic Environment Setup: Installs necessary packages and dependencies based on the selected application type.
- Supports Multiple Application Types:
- Static HTML/CSS/JS
- React
- Angular
- Vue
- OS Compatibility: Detects whether the operating system is Debian/Ubuntu or RHEL/CentOS and uses the appropriate package manager.
- Easy to Use: Prompts the user for input and executes the deployment automatically.
- Linux Server: This script is intended to be run on a Linux server.
- Root Access: The script requires
sudoprivileges to install packages and configure Nginx. - Git: Make sure Git is installed on your server. If not, the script will install it automatically.
Follow these steps to use the deployment script:
-
Switch to Root User you will need root permissions to do the configurations
sudo su
-
Clone the Repository: You can download the script using
curl. Run the following command in your terminal:curl -O https://raw.githubusercontent.com/yashGoyal40/nginx-automation-script/refs/heads/main/script.sh
-
Make the Script Executable: Once the script is downloaded, make it executable by running:
sudo chmod +x script.sh
-
Run the Script: Execute the script with the following command:
./script.sh
- The script will prompt you for the following inputs::
- The GitHub repository URL containing your project.
- The type of application (HTML/CSS/JS, React, Angular, or Vue).
- The operating system type (Debian/Ubuntu or RHEL/CentOS).
After providing the required inputs, the script will:
-
- Clone the specified repository.
- Install the necessary packages.
- Set up the Nginx configuration to serve your application.
- Restart Nginx to apply the changes.
You can use the script as follows:
curl -O https://raw.githubusercontent.com/yashGoyal40/nginx-automation-script/refs/heads/main/script.sh
sudo chmod +x script.sh
./script.sh <git repo URL> <app_type> <os_type>Contributions are welcome! If you have suggestions for improvements or encounter issues, feel free to open an issue or submit a pull request
Yash Goyal Feel free to connect with me on GitHub.