OpenSUSE is one of the most outstanding operating systems in the world of Linux for being very stable. Its stability and popularity come from being the community distribution of SUSE that is so well positioned. This company collaborates and sponsors many projects related to open source providing professional support. So, I could say that it competes with RHEL or Canonical but with new technologies. Therefore, it is not surprising that it is chosen by many sysadmins as a system where to deploy their applications. In this post, you will learn how to install Nginx on OpenSUSE 15 / 15.1 or SUSE 15.
Nginx is one of the most popular Open Source services in the world. It is a web server that stands out for being high-performance and providing an ability to handle many requests on one server. In addition, Nginx has recently been purchased by F5 Networks to continue a growth process.
All in all, it is easy to deduce that OpenSUSE or SUSE are privileged options for running network services. So today I will show you how to install Nginx on OpenSUSE 15/ 15.1 or SUSE 15. This way you can enjoy a great web server in a great Linux distribution.
1. Upgrade the system
As always we recommend doing a general update to the system. With this, you will be more stable and ready to start the process.
:~$ sudo zypper up
The result will be that your system will have the latest security patches installed. So it will be safer and more protected against cybercrime.
2. Install Nginx on OpenSUSE 15/15.1 or SUSE 15
Nginx is available in the OpenSUSE and SUSE repositories. This is a great advantage to increase ease of installation. On the other hand, we will not always have the latest versions.
So, first, search for Nginx using Zypper.
:~$ sudo zypper search nginx
As you can see, there are several packages related to Nginx within the official repositories of the distribution. However, the nginx package is the one you need to install the web server.
:~$ sudo zypper in nginx
Then, it is a good idea to enable the Nginx service to run as soon as the system starts.
:~$ sudo systemctl enable nginx
After that, start the service.
:~$ sudo systemctl start nginx
If you want to see the status of the Nginx service, you can use the following command:
:~$ sudo sytemctl status nginx
Now, it is time to test it.
3. Test Nginx on OpenSUSE
The next step is to check that Nginx is running correctly. To do this, you need to make an HTML file and place it in the root directory of Nginx in OpenSUSE / SUSE.
So, use nano to do it.
:~$ sudo nano /srv/www/htdocs/index.html
Add the following:
<html> <body> <h1>Welcome to osradar </h1> </body> </html>
Save the file and close it.
Then, make some changes to the firewall settings to allow the HTTP service:
:~$ sudo firewall-cmd --add-port=80/tcp --permanent :~$ sudo firewall-cmd --reload
Now, open your favorite web browser like Firefox or Chrome and go to http://SERVER_IP/ and you will see this.
So, Nginx is working.
OpenSUSE and SUSE have been characterized by fairly professional distributions that behave excellently on a server. However, they do this without sacrificing the power and robustness that Linux offers.
In this tutorial, you have learned how to install Nginx on OpenSUSE 15 or OpenSUSE 15.1 / SUSE 15 and it is the gateway to great things with this distribution.
Please, shared this post with your friends.
You can also read: