Nginx is an open source HTTP web server that is often used as reverse proxy or HTTP cache. Nginx is popular for high-performance, speed, stability and low resource consumption.
In this article, we will walk through installing and setting up NginX server on Ubuntu. Follow these steps to install and setup NginX on your ubuntu.
Requirement
You need to be logged in non-root user with sudo permission.
Installing Nginx
Nginx is available Ubuntu's default repository, so you can directly install with below command.
After installing it, open your browser and run your server IP address. If you see this page, then you have successfully installed Nginx on your Ubuntu. This default page placed at /var/www/html/
location.
Configure Nginx
Check ufw application list with below command.
Add Nginx to use port 80.
If you want to check Nginx server status, then you can run following command.
Add websites to Nginx
When using multiple websites, you need to add your websites to Nginx configuration. For that first create a new Nginx configration file.
And put the site details in it.
Now create a website folder /var/www/html/website
. And also give 755 permission.
Now create simple page for website homepage.
And put any HTML code to check.
Save this file. And now restart the Nginx server.
Now open your and open your website. you should get your page.
Apache is open-source and most widely used web server in the world. It provides dynamic modules, and powerful support to website.
In this article, we will go through on how to install Apache web server in your Ubuntu 20.04 system.
Prerequisites:
You should have non-root user account logged in with sudo privileges to install Apache server.
Install apache2 server
Apache is already included in Ubuntu's repository, So you can directly install apache server from the Terminal command.
First update the repository index with bellow command.
Install Apache server:
Configure apache server
First check the Apache in ufw
application list.
And allow the Apache server
You can also check the ufw status
Apache server status
You can check the apache server status with the command:
Start the Apache server
Or stop the server
This way, you can also restart the server
This way you can setup your Apache to your server. If you have any suggestions or query, please let us know in the bellow comment section.