openSUSE is a very stable distribution sponsored by SUSE, which is a pioneer in the use of Linux and has a business model based on open technologies. Although in the server environment openSUSE is not as popular as Debian or RHEL-based distributions, there are many sysadmins who rely on it. So today, you will learn how to install Nginx on openSUSE 15.
What is Nginx and is it worth having on openSUSE?
Along with Apache, Nginx dominates the web server industry. But Nginx is not only this, it is also widely used as a Reverse Proxy for many web applications. Therefore, having Nginx on the system is a guarantee of a fast, light and well-supported web server on the Internet.
In addition to this, when combined with openSUSE as a server, we will get better results due to the robustness that this SUSE derivative gives us. So as you can see, installing Nginx on openSUSE can be your solution for a home or production server.
Let’s go for it.
Install Nginx on openSUSE
Before you start, it’s a good idea to upgrade your whole machine by using the command
sudo zypper up
Nginx is included in the openSUSE repositories, so we won’t have to make much effort to install it. In this case, just run.
sudo zypper install nginx
This will start the installation of the application.
Managing the Nginx service on openSUSE
For security reasons, Nginx will not run immediately after it is installed. So, we have to start it manually using the
systemctl command- To start it run
sudo systemctl start nginx
As it is an important application on a server, it is also a good idea to make it start with the system.
sudo systemctl enable nginx
You can then check the status of the service.
sudo systemctl status nginx
It is also good to know that you can restart the service by running
sudo systemctl restart nginx
This is critical to know because then you can apply the changes you make to the Nginx configuration.
And if at some point you need to stop the service, you have to run
sudo systemctl stop nginx
Configuring the firewall for Nginx
In openSUSE a firewall is installed and configured by default, this makes Nginx not working for now. To achieve this, we need to open ports
443 for Nginx to work.
sudo firewall-cmd --add-port=80/tcp --permanent sudo firewall-cmd --add-port=443/tcp --permanent
Apply changes by restarting the firewall
sudo firewall-cmd --reload
This way, the rules are now set up for Nginx.
Testing Nginx on openSUSE
The best way to know if Nginx is working, it is testing it. To achieve this, let’s create a simple HTML file that we can use as a test.
Create it using a text editor of your choice
sudo nano /srv/www/htdocs/index.html
And add some code. For example:
<html> <body> <h1>Hi from Atechtown</h1> </body> </html>
Save it and now if you open a web browser and visit your domain or server IP address you should see the file we created.
In this post, you learned how to install NGinx on openSUSE through the official repositories of the distribution. I hope you liked this post and I hope you found it useful. Share it to reach more people.
Also you can learn how to install Nginx on Debian 11 or on CentOS 8