|
|
|
@ -16,12 +16,35 @@ sudo apt-get install -y nodejs |
|
|
|
wget https://go.dev/dl/go1.21.0.linux-amd64.tar.gz |
|
|
|
wget https://go.dev/dl/go1.21.0.linux-amd64.tar.gz |
|
|
|
sudo rm -rf /usr/local/go |
|
|
|
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.0.linux-amd64.tar.gz |
|
|
|
|
|
|
|
export PATH=$PATH:/usr/local/go/bin |
|
|
|
|
|
|
|
|
|
|
|
# Create a symbolic link for the Go binary |
|
|
|
# Create a symbolic link for the Go binary |
|
|
|
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go |
|
|
|
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go |
|
|
|
|
|
|
|
|
|
|
|
# Check the installed Go version |
|
|
|
# Configure Nginx |
|
|
|
go version |
|
|
|
sudo sh -c 'cat > /etc/nginx/sites-available/default <<EOF |
|
|
|
|
|
|
|
upstream api { |
|
|
|
|
|
|
|
server 127.0.0.1:8080; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
echo "Installation completed!" |
|
|
|
server { |
|
|
|
|
|
|
|
listen 0.0.0.0:80; |
|
|
|
|
|
|
|
root /var/www/etc2pool; |
|
|
|
|
|
|
|
index index.html index.htm; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
server_name localhost; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
location /api { |
|
|
|
|
|
|
|
proxy_pass http://127.0.0.1:8080; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
location / { |
|
|
|
|
|
|
|
try_files $uri $uri/ /index.html; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
EOF' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Reload Nginx configuration |
|
|
|
|
|
|
|
sudo systemctl reload nginx |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Installation completed!" |
|
|
|
|