Install Nginx
Table of Contents
Introduction
In this Section we learn to install nginx on a V Server and create a alternative Start Website for your V Server on the Web.
Prerequisites:
You need a Ubuntu Cloud VM to setting your VServer.
Login to your V-Server
-
Update Respoitories on your Server.
sudo apt update" -
Install Nginx on your Server. Use the following command:
sudo apt install nginx -y
Create-alternatvie-Webseite and install nginx
-
Crearte Alternative html side for your nginx Serrver:
- Create a new Directory
mkdir -p /var/www/alternatives- Create a new HTML file:
sudo touch /var/www/alternatives/alternate-index.html- Add a new configuration to:
sudo nano /etc/nginx/sites-enabled/alternatives- Open File
- Add:
server {
listen 8081;
listen [::]:8081;
root /var/www/alternatives;
index alternate-index.html;git
location / {
try_files $uri $uri/ =404;
} - Save this file and close it.
- Open the new html file.
sudo nano var/www/alternatives/alternate-index.html- Take your HTML Code into this file.
- Save and Close this file.
- Open your new Website on
your_ip>:8081