In this guide we will go through how to install Apache Web Server on a VPS running on Ubuntu as it is one of the most popular web servers in the world. Please make sure you have the root privileges on your VPS.
1. First, update your package list using the following command:
\`\`\`\` sudo apt-get update \`\`\`\`1. Then, install the apache2 package using the following command:
\`\`\` sudo apt-get install apache2 \`\`\`1. After the installation is over, open web browser and type in your IP address. It should show “It Works!” page, which means Apache has been installed on your VPS and it’s working.
Now if you wish to install Nginx on your VPS follow these steps, Nginx is another popular web server, less resource-heavy than Apache and often used as a reverse proxy.
1. As before, first, update your package list:
\`\`\` sudo apt-get update \`\`\`1. How you can install Nginx server using the following command:
\`\`\` sudo apt-get install nginx \`\`\`1. After it’s installed, type in your IP address in web browser. If you see a welcome page, Nginx has been installed on your VPS.
In the end don’t forget to allow incoming HTTP and HTTPS connections on your firewall if you using any, on ufw you can do so by `sudo ufw allow ‘Nginx Full’`
For other web servers the procedures would be similar: You’d first need to update your system, then install the desired web server package using the package manager your version of Linux uses (apt-get, yum etc). Depending on firewall settings of your server, you might need to allow incoming traffic to your web server’s port (usually 80 for HTTP and 443 for HTTPS).