HTML Page On Vultr VPS PDF
HTML Page On Vultr VPS PDF
1. Create a Droplet, copy the ip and use this command to login terminal
• Ssh root@youripaddress
• Password and enter
2. We should install nginx on that server or any other server but agin is highly preferred
• To install nginx on linux ubuntu server, we use the command “sudo apt-get install nginx” nginx
required some dependencies to work sometime they are preinstalled on the server and other
times we have to install them by overselves by the following commands.
“sudo apt-get install build-essential”
• To update this library and to make sure that all the programs are up to date we write
“sudo apt update && sudo apt upgrade”
3. It included a list of official apps that are available to download for linux. when we write these
commands it makes sure we have the latest one
4. After doing all these steps test it opening on browser using the ip address you will see a welcome
message from nginx, if shows then everything is fine till now.
5. Now we need to configure the server to listen to connections for those domains and instruct where
to find the website files
server {
listen 80;
listen [::]:80;
server_name yourfirstdomain.com www.yourfirstdomain.com;
# The line below is used to tell the server where the website files are
root /var/www/yourfirstdomain.com/public_html;
# In this case it is expecting a folder named with your domain in “/var/www”
index index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
}
• Before this point the domain to the server going to vultr server products dns settings add the
domain, ip and save it, once you point the domain to the server you will see Welcome to
nginx message when you access the domain.
• To add the above mentioned code follow the commands given below.
• cd /etc/nginx/sites-enabled/
• you will see this reply command /etc/nginx/sites-enabled#
• type only ls at the end of the reply command and enter like this
• root@New_Server2:/etc/nginx/sites-enabled# ls (here l means small L) enter it you will see a
“default” command below that as a result, now move further
• next add “ls -al” at the end of the result command like this and enter.
• root@New_Server2:/etc/nginx/sites-enabled# ls -al (here l means small L)
6. Now you should copy and paste the configuration code in a new file and move it to the settings
folder. (the code is mentioned above, you can copy the and paste)
7. To get out of text editor on terminal press Esc and then : (the colon). The cursor will go to the
bottom of the screen at a colon prompt. Write your file by entering :wq! And enter
8. No do the following
• root@New_Server2:~# cd /etc/nginx/sites-enabled (enter)
• root@New_Server2:/etc/nginx/sites-enabled# ls (LS small)
default
• root@New_Server2:/etc/nginx/sites-enabled# ls -al
default in last line
• root@New_Server2:/etc/nginx/sites-enabled#
9. Now you should copy and paste the configuration code in a new file and move it to settings folder.
10. You can do it by the terminal directly with ”vi” command or create a new file then upload it.
11. This will opens the text editor in the terminal, I’m going to press “i” in the terminal to open the text
editor to change the mode to edit then past the code below and adjust the settings. Change all the
domain names to your real domain names in 3 places, after you done it press ESC button once
then semi colon : then wq and ! in total :wq! (enter) it will save and exit from text editor.
Next
• root@New_Server2:/etc/nginx/sites-enabled# vi pickmoneyonline.com.conf (enter)
• root@New_Server2:/etc/nginx/sites-enabled#
12. Now I copy this file to the second domain from first one
• root@New_Server2:/etc/nginx/sites-enabled# cp pickmoneyonline.com.conf
picmoneyonline.club (enter)
• root@New_Server2:/etc/nginx/sites-enabled# c (enter)
• root@New_Server2:/etc/nginx/sites-enabled# ls (LS small)
default picmoneyonline.club pickmoneyonline.com.conf (here you see only one .conf domain)
• root@New_Server2:/etc/nginx/sites-enabled#
13. We make sure that both the domains are with .conf extension otherwise we need to add this
14. To rename or change the domain or anything like that we need to use “mv” command
• root@New_Server2:/etc/nginx/sites-enabled# mv picmoneyonline.club
picmoneyonline.club.conf (there should be one space between 2 domains and enter)
• root@New_Server2:/etc/nginx/sites-enabled# ls (LS small) (enter)
• default picmoneyonline.com.conf pickmoneyonline.com.conf
Now you can see both the domains with .conf extension, now its ok.
• root@New_Server2:/etc/nginx/sites-enabled#
15. So we should make this configuration & name it once under domain one then copy it & name it
under domain two with the settings to be changed inside where it says
YOURFIRSTDOMAIN.COM
16. Next we create a directory (folder) for each website in /var/www/ by the following
to go to the directory use “cd /var/www/”
19. After creating 2 configuration files in /etc/nginx/sites-enabled/ and adjusting their settings, after
creating the folder where the website files will stay stored. We should test the configuration files
that they have no errors by running this command.
• sudo nginx -t
• root@New_Server2:# sudo nginx -t (enter) it will show everything ok and successful
now we restart the nginx using this code “sudo service nginx restart” (enter) everything fine
now
Let’s install https for both the domains
1. After both domain are active on http and we would like to install a certificate
https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx