From d611bb176105a0e59aa802fcc4d61c2c0066ba3e Mon Sep 17 00:00:00 2001 From: yuriy0803 <68668177+yuriy0803@users.noreply.github.com> Date: Thu, 24 Aug 2023 18:52:13 +0200 Subject: [PATCH] Update install.sh --- install.sh | 128 +++++++++++++++++++++++------------------------------ 1 file changed, 55 insertions(+), 73 deletions(-) diff --git a/install.sh b/install.sh index dc170c2..90fd31d 100644 --- a/install.sh +++ b/install.sh @@ -5,19 +5,25 @@ set -x # Enable displaying all commands echo "Welcome to the installation!" # Update and upgrade the package list -sudo apt-get update && sudo apt-get upgrade +sudo apt-get update && sudo apt-get upgrade -y # Install npm, rsync, git, redis-server, and nginx -sudo apt-get install npm rsync git redis-server nginx +sudo apt-get install npm rsync git redis-server nginx -y + +sudo systemctl enable nginx +sudo systemctl start nginx + +sudo rm -f /etc/nginx/sites-available/default +sudo rm -f /etc/nginx/sites-enabled/default # Install Node.js Version 14.x curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs # Download and install Go 1.21.0 -wget https://go.dev/dl/go1.21.0.linux-amd64.tar.gz +wget https://golang.org/dl/go1.21.1.linux-amd64.tar.gz sudo rm -rf /usr/local/go -sudo tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz +sudo tar -C /usr/local -xzf go1.21.1.linux-amd64.tar.gz # Create a symbolic link for the Go binary sudo ln -s /usr/local/go/bin/go /usr/local/bin/go @@ -25,46 +31,12 @@ sudo ln -s /usr/local/go/bin/go /usr/local/bin/go # Get the local IP address of the Linux system ip_address=$(hostname -I | cut -d' ' -f1) -# Configure Nginx -sudo sh -c 'cat > /etc/nginx/sites-available/default < www/config/environment.js @@ -165,5 +110,42 @@ bash build.sh # Change back to the main directory cd .. +# Nginx configuration +nginx_config=$(cat < /dev/null + +# Create a symbolic link in the sites-enabled directory +sudo ln -s "$pool_config_path" "/etc/nginx/sites-enabled/" + +# Restart Nginx to apply the changes +sudo systemctl restart nginx + set +x # Disable displaying commands echo "Installation completed!"