Skip to content

Commit

Permalink
Merge pull request #265 from xsub/nginx-series
Browse files Browse the repository at this point in the history
[DOC] HowTo Series: AlmaLinux Tutorials.
  • Loading branch information
bennyvasquez authored Jan 12, 2024
2 parents 6d4fad8 + e89aa9d commit 9c6e77c
Show file tree
Hide file tree
Showing 17 changed files with 3,475 additions and 6 deletions.
29 changes: 27 additions & 2 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
'/sigs/LiveMedia',
'/sigs/Marketing',
'/sigs/Migration',
'/sigs/ProcessForCreatingNewSIG'
'/sigs/ProcessForCreatingNewSIG'
]
},
]
Expand Down Expand Up @@ -63,7 +63,32 @@ module.exports = {
title: 'Howto Series',
path: '/series/',
children: [
]
{
title: "Nginx Series",
path: '/series/nginx/',
children: [
'/series/nginx/NginxSeriesA01',
'/series/nginx/NginxSeriesA02R8',
'/series/nginx/NginxSeriesA02R91',
'/series/nginx/NginxSeriesA02R92',
'/series/nginx/NginxSeriesA03',
'/series/nginx/NginxSeriesA04P1',
]
},
{
title: "System Series",
path: '/series/system/',
children: [
'/series/system/SystemSeriesA01',
'/series/system/SystemSeriesA02',
'/series/system/SystemSeriesA03',
'/series/system/SystemSeriesA03R8',
'/series/system/SystemSeriesA03R9',
'/series/system/SystemSeriesA04',
'/series/system/SystemSeriesA05',
]
}
]
},
{
title: 'Release Notes',
Expand Down
54 changes: 50 additions & 4 deletions docs/series/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@
---
title: "Howto Series"
---
# Howto Series: AlmaLinux Tutorials 🚀

# Series Page
Welcome to our Howto series on AlmaLinux! In this series, we provide comprehensive guides and tutorials to help you learn and master various aspects of AlmaLinux. Whether you are interested in Nginx or system-related topics, we've got you covered.

## Nginx Series

The Nginx series focuses on all things related to Nginx web server. From installation to configuration, security, and optimization, you will find step-by-step guides to help you deploy and manage a powerful web server on AlmaLinux.

Browse the articles in the Nginx series:

- [A01](nginx/NginxSeriesA01.md) ❯ Beginner's Guide
- [A02 R8](nginx/NginxSeriesA02R8.md) ❯ AlmaLinux 8.x Installation Examples
- [A02 R9.1](nginx/NginxSeriesA02R91.md) ❯ AlmaLinux 9.1 Installation Examples
- [A02 R9.2](nginx/NginxSeriesA02R92.md) ❯ AlmaLinux 9.2 Installation Examples
- [A03](nginx/NginxSeriesA03.md) ❯ Default Configuration Guide
- [A04](nginx/NginxSeriesA04P1.md) ❯ Secure Nginx Deployment

## System Series

**The vision:** (In near future) The System series covers a wide range of system-related topics on AlmaLinux. This guides will help you enhance your system administration skills and ensure the stability and security of your AlmaLinux environment.

Explore the articles in the System series:

- [A01](system/SystemSeriesA01.md) ❯ Application Streams
- [A02](system/SystemSeriesA02.md) ❯ Firewalld: A Beginner's Guide
- [A03](system/SystemSeriesA03.md) ❯ NVIDIA Driver Installation Guide
- [A03 R8](system/SystemSeriesA03R8.md) ❯ NVIDIA Driver: Installation on 8.x
- [A03 R9](system/SystemSeriesA03R9.md) ❯ NVIDIA Driver: Installation on 9.x
- [A04](system/SystemSeriesA04.md) ❯ Snapd Installation Guide
- [A05](system/SystemSeriesA05.md) ❯ Multimedia Codecs Installation Guide

Dive into our Howto series and unlock the full potential of AlmaLinux. Happy hacking! 🐧💻🚀

----

##### Trademark Notices
:::warning

**AlmaLinux** is a registered trademark of AlmaLinux OS Foundation.

**Linux®** is a registered trademark of Linus Torvalds in the U.S. and other countries.

**macOS** are trademarks of Apple Inc., registered in the U.S. and other countries.

**NVIDIA** is a registered trademark of NVIDIA Corporation in the U.S. and other countries.

**Red Hat** is a registered trademark of Red Hat, Inc. or its subsidiaries in the United States and other countries.

**Windows** is a registered trademark of Microsoft Corporation in the United States and other countries.

All other trademarks are the property of their respective owners.
:::
170 changes: 170 additions & 0 deletions docs/series/nginx/NginxSeriesA01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# A01 ❯ A Beginner's Guide
<small>ℹ️ This article is part of AlmaLinux [Nginx Series](/series/).</small>
<hr>
| 💡 | Experience Level | ⭐☆☆☆☆ |
|--- | --------- | --------|
| 📆 | <small>Last modified </small>| 2023-05-10
| 🔧 | <small>Tested by <br> ↳ version \| platform \| date </small>| <small>[Pawel Suchanecki](mailto:psuchanecki@almalinux.org) <br> ↳ 9.1 \| x86_64 \| 2023-04-21 </small>|
<br>

## 🌟 Introduction

In this guide, we offer a detailed walk-through of Nginx installation, exploring three potential installation methods with examples for AlmaLinux OS 8.x and 9.x. You'll gain insights into essential Nginx interactions, and we'll present a tailored-learning path crafted to assist you in mastering Nginx and achieving proficiency in its utilization.


### About Nginx

Nginx is a popular open-source, powerful web server and reverse proxy that is known for its high performance and stability. It can be used to serve static and dynamic content, load balance traffic, and optimize performance and scalability.


### Architecture
Nginx is based on an event-driven architecture, which differs from traditional thread-based web servers by handling multiple connections simultaneously without creating a separate thread for each one. This approach enables Nginx to efficiently manage a large number of connections with minimal overhead, resulting in improved performance, especially under high load conditions.


### Primary components
The primary components of Nginx include the master process, worker processes, and configuration files. The master process is responsible for reading and validating the configuration file, managing worker processes, and handling signals. Worker processes handle incoming client requests, process them, and send responses back to the clients. Configuration files define the behavior of Nginx, specifying how it should handle different types of requests, route traffic, and manage other settings.

### Best practices

In this series, we will delve into best practices and uncover new aspects of Nginx to accelerate your learning and develop practical skills. Here is a basic set of best practices:


- **Strengthen Server Security**: Adopt security best practices, including firewalls, intrusion detection systems, and regular software updates, to safeguard your server from potential attacks.
- **Implement HTTPS**: Ensure SSL/TLS certificates are in place to encrypt traffic between your server and users.
- **Enhance Performance**: Employ caching and load balancing techniques to optimize your server's performance and scalability.

## 🧠 Fundamental Concepts

### Nginx Installation Variants

There are three ways of installing Nginx on AlmaLinux 8.x and 9.x:

- **AppStream non-module**
-- Installs the default, non-module version from the AppStream repository
- **AppStream module**
-- Installs the module version from the AppStream repository
-- Allows installation of a specific version for compatibility reasons
- **F5 Networks repository**
-- Involves defining a new repository data for your system
-- Installs the latest RPM package from external main-line repository
-- Allows always running the latest version of Nginx


## 📝 Key Takeaways

### ➡️ Installing
- **Update System Packages**: Ensure your system packages are up-to-date before installing Nginx by running:
```
sudo dnf update
```
- **Configure Firewall**: Allow incoming traffic on TCP ports for HTTP & HTTPS services (80 & 443, respectively):

:::warning
On AlmaLinux OS, the `Firewalld` packet filtering service is enabled by default
:::

```
sudo firewall-cmd --permanent --add-service={http,https}
sudo firewall-cmd --reload
```


- **Install Nginx**: Install Nginx using one of the three variants: default package repository, Appstream module, or Nginx repository.

<u>Compatibility Matrix</u>
| Install Variant | 8.7 | 9.1| 9.2 |
|--------------------|-----|----|-----|
| I. AppStream non-module | ❗¹ || ❗² |
| II. AppStream module ||||
| III. Mainline repo ||||

¹ On 8.7, this will actually install the AppStream module.
<br>
² Default version is outdated; AppStream module is recommended.



### ➡️ Testing
- **Start Nginx Service**: After installation, start the Nginx service with:
```
sudo systemctl start nginx
```

- **Check Nginx Status**: Verify if Nginx is running properly by running:
```
sudo systemctl status nginx
```

- **Check Firewall Status**: make sure `http` & `https` services are enabled (open ports):

```
sudo firewall-cmd --list-services
```

- **Test Nginx Installation**: Navigate a web browser of your choice to your server's hostname or IP address to check for the default page.

**Example:** we use `lynx` to be able to perform the check from command-line-interface:
```
lynx http://localhost/
```

::: details
`lynx` is a text-based web browser for use on cursor-addressable character (cell) terminals.

Install it with `dnf install lynx`.
:::

::: tip
To exit `lynx` press `q` and then `y` to confirm.
:::


### ➡️ Configuring
- **Configure Nginx**: To serve your own content, edit the Nginx configuration file at:
```
/etc/nginx/nginx.conf
```

- **Test Nginx Configuration**: Before reloading Nginx, test the configuration file for syntax errors using:
```
sudo nginx -t
```


### ➡️ Management
- **Reload Nginx**: Reload Nginx to apply configuration changes with:
```
sudo systemctl reload nginx
```

- **Stop Nginx Service**: To stop the Nginx service, execute the command:
```
sudo systemctl stop nginx
```

- **Enable Nginx at Boot**: To start Nginx automatically at system boot, run:
```
sudo systemctl enable nginx
```

## 📖 Release-Specific Installation

<u>AlmaLinux version-specific examples:</u>

- AlmaLinux Nginx Series ❯ [AlmaLinux OS 8.x Installation Examples](NginxSeriesA02R8.md)
- AlmaLinux Nginx Series ❯ [AlmaLinux OS 9.1 Installation Examples](NginxSeriesA02R91.md)
- AlmaLinux Nginx Series ❯ [AlmaLinux OS 9.2 Installation Examples](NginxSeriesA02R92.md)


## 📚 Further reading and Next Steps

<u>In-depth Resources:</u>

- AlmaLinux Nginx Series ❯ [Default Configuration Guide](NginxSeriesA03.md)
- AlmaLinux Nginx Series ❯ [Secure Nginx Deployment](NginxSeriesA04P1.md)


<u>Related Resources:</u>
- AlmaLinux Firewalld Series ❯ [A Beginner's Guide](../system/SystemSeriesA02.md)
- AlmaLinux System Series ❯ [Application Streams](../system/SystemSeriesA01.md)

Loading

0 comments on commit 9c6e77c

Please sign in to comment.