- Install NGINX on Linux Mint
- Step 1: Updating packages
- Step 2: Install NGINX on Linux Mint
- How to Install NGINX on Linux Mint 21
- How to Install NGINX on Linux Mint 21
- UFW Configuration
- How to Remove NGINX on Linux Mint 21
- Conclusion
- About the author
- Syeda Wardah Batool
- How To Install Linux, Nginx, MariaDB, PHP (LEMP Stack) on Linux Mint 19
- Install MariaDB
- Install Nginx
- Test Nginx
- Install PHP-FPM
- EnablePHP-FPM Support on Virtual Host
- Testing PHP-FPM support on the Virtual Host
- On Client machine
Install NGINX on Linux Mint
NGINX accelerates content and application delivery, improves security, and facilitates availability and scalability for the busiest websites on the world.
NGINX is one of a handful of servers written to address the C10K problem. Unlike traditional servers, NGINX doesn’t rely on threads to handle requests. Instead it uses a much more scalable event-driven (asynchronous) architecture. This architecture uses small, but more importantly, predictable amounts of memory under load. Even if you don’t expect to handle thousands of simultaneous requests, you can still benefit from NGINX’s high-performance and small memory footprint. NGINX scales in all directions, from the smallest VPS all the way up to large clusters of servers. Don’t you think it’s time for web servers to handle 10,000 to 100,000 clients simultaneously? After all, the web is a big place now with billions of people. Nginx is here for your rescue.
Step 1: Updating packages
To Install NGINX on Linux Mint, you will need to update packages first.
Open terminal by searching ‘terminal’ in your Linux Mint search bar or use the shortcut Ctrl + T to open the terminal.
You can then run the following command which will update packages on your Linux Mint-
It takes a few minutes to update and then you are all set to install nginx next.
Step 2: Install NGINX on Linux Mint
Now that you have updated packages, its much easier to install nginx. Just run the following command in your terminal-
Installation usually takes a few seconds or minutes depending on the internet speed and your computer’s configuration.
Once the installation is complete you can see that NGINX is installed. Next good step is to test it in the terminal by typing nginx -v and then its version.
$ nginx -v nginx version: nginx/1.22.0 built with OpenSSL 3.0.1g 8 Oct 2022 TLS SNI support enabled
Congratulations! You’ve just installed NGINX! Happy coding with the latest version of NGINX.
In case you have problems installing nginx and want to remove nginx from your Linux Mint, you can remove nginx easily.
I hope this tutorial was useful for install nginx on Linux Mint.
How to Install NGINX on Linux Mint 21
In the Linux system, NGINX is a free, open-source, and highly scalable web server based on an asynchronous and event-driven structure. It performs different functions like reverse proxy, load balancing, web serving, media streaming, and HTTP cache serving. It was primarily designed for web serving only but later extended its services.
It is a high-performance HTTP server that top-ranked companies use. Also, it is adopted by most Linux users because of its rich features like stability, simple configuration, and high performance.
How to Install NGINX on Linux Mint 21
Update the Linux Mint system repository to upgrade and refresh all the packages up-to-date. This ensures that system will install the latest update of the required application:
In the next move, execute the installation command to install the NGINX server on Linux Mint 21 system. It would be done using the mentioned command:
Confirm its installation and check if the system has installed the latest update of NGINX server:
Start the NGINX service with the help of command:
You can also enable to let the service start automatically:
Now, check the status of NGINX service for further configuration:
Active status shows that you can configure NGINX service.
UFW Configuration
Enable the firewall by the following command:
List down the available applications for the firewall using the command:
Now, allow the server to enable HTTP (Port 80) and HTTPS (Port 443). It would be done using the NGINX Full command:
To adopt the changes, we have given to ufw service, reload the firewall through the command:
Confirm the firewall rules we have updated above by using the status command:
Now, test the NGINX server its working by assigning your IP address if it works properly:
How to Remove NGINX on Linux Mint 21
You can also remove it by typing the mentioned command:
Conclusion
Nginx software is a web-based server used for HTTP cache serving, media streaming, web serving, email proxy and reverse proxy. It is famous among Linux users because of its notable features like high performance, load balancing, stability, and many more.
This guide has mentioned a detailed guide on how to install the Nginx server on Linux Mint. We have seen a step-by-step process to install it. Moreover, the details configuration setup is also mentioned in this guide.
About the author
Syeda Wardah Batool
I am a Software Engineer Graduate and Self Motivated Linux writer. I also love to read latest Linux books. Moreover, in my free time, i love to read books on Personal development.
How To Install Linux, Nginx, MariaDB, PHP (LEMP Stack) on Linux Mint 19
This tutorial will help to install Nginx on Linux Mint 19 with PHP support (through PHP-FPM) and MariaDB support.
I hope you know what Nginx is? Nginx is an open-source web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache.
Nginx was created by Igor Sysoev, released under BSD-like license.
Install MariaDB
First, we will install the MariaDB by issuing the following command. Update the repository index using the apt command.
Install MariaDB server using the following command.
sudo apt install -y mariadb-server
You can quickly log in to MariaDB server without the MySQL root password by running sudo mysql -u root -p or mysql -u root -p command as root in Linux Mint.
Install Nginx
Download the Nginx signing key from the official site.
wget http://nginx.org/keys/nginx_signing.key
Add Nginx repository to the system using the below commands.
echo "deb [arch=amd64] http://nginx.org/packages/ubuntu/ bionic nginx" | sudo tee /etc/apt/sources.list.d/nginx.list echo "deb-src [arch=amd64] http://nginx.org/packages/ubuntu/ bionic nginx" | sudo tee -a /etc/apt/sources.list.d/nginx.list
Install Nginx using the following command.
Test Nginx
Open a web browser and hit it to,
You should see the below page, and this confirms you that the Nginx is successfully installed on the server.
The default document root of Nginx on Linuxmint 19 is /usr/share/nginx/html/. The configuration files are stored under /etc/nginx directory.
Install PHP-FPM
Next is to install PHP through PHP-FPM (PHP-FPM (FastCGI Process Manager), it is an alternative PHP FastCGI implementation. Install it by using the apt command.
sudo apt install -y php-fpm php-mysql php-cli
Edit the respective php.ini depending on the PHP version you have installed on the system.
sudo nano /etc/php/7.2/fpm/php.ini
set cgi.fix_pathinfo to 0.
Edit the /etc/php/7.2/fpm/pool.d/www.conf file.
sudo nano /etc/php/7.2/fpm/pool.d/www.conf
Make sure to change the following value.
listen = /var/run/php7.2-fpm.sock
EnablePHP-FPM Support on Virtual Host
Let’s create name-based virtual host on Nginx server for the following details.
Server Name : web.itzgeek.local
Document Root : /usr/share/nginx/html/web.itzgeek.local
Create the configuration file /etc/nginx/conf.d/web.itzgeek.local.conf for our virtual host.
sudo nano /etc/nginx/conf.d/web.itzgeek.local.conf
Add the following content.
Testing PHP-FPM support on the Virtual Host
Create the document root directory.
sudo mkdir /usr/share/nginx/html/web.itzgeek.local
For testing the PHP, place a .php file on to the document root of the created virtual host. In the terminal copy/paste the following line.
sudo nano /usr/share/nginx/html/web.itzgeek.local/index.php
Now, Copy/Paste this line into the index.php file and then save it.
sudo systemctl restart php7.2-fpm sudo systemctl restart nginx
On Client machine
Create host entry for your domain (web.itzgeek.local) in /etc/hosts file or make an A record in case you have DNS server in your environment.
Add a host entry something like below.
192.168.1.10 web.itzgeek.local web
Now open up a browser and type your domain in the web address.
The page looks like below.
From the above screenshot, PHP is working through FPM/FastCGI, as shown in the Server API line.
Additionally, scroll the page further down to see all the modules that are enabled in PHP.
MySQL support information:
More To Read: