Explanation of KDE 6: Tips and Features

When choosing which Linux Desktop Environment you will use, what is the best available? K Desktop Environment, or shortened to KDE, is a desktop environment for Linux desktop operating systems. Recently KDE was updated to QT 6, which is necessary for proper Wayland support. There are a variety of different Linux distributions and desktop environments, and you can choose which desktop environment to use independently from the distributions. While at first glance it looks similar to KDE 5, KDE 6 (and QT6) mark an important step to broader Linux adoption, with the performance improvements to match. We will be using Fedora 42 KDE as the baseline distribution for this article.

X vs Wayland

A recent edition since KDE version 6 is Wayland support, a key component of how the desktop works graphically. Up until recently, all Linux desktops used X.org to manage the desktop space and video stream. X.org comes from the beginning times of Linux, appearing in 1984 via an MIT project, with version 11 appearing in 1987 (still being used today!): https://en.wikipedia.org/wiki/X_Window_System

Origin:

The purpose of X.org was to create window and graphical system similar to competing commercial solutions. Over time, it was realized that X.org’s implementation was inefficient, and so the Wayland project was born. Wayland is the modern Linux window system used in KDE 6, that doesn’t require a separate compositor, and its performance and security is better than X.org. Wayland also supports QT 6, a major performance and functional overhaul to desktop environment rendering. QT 5 has been the standard render/window manager tool used for over 10 years, but its “bones” are based on older less compatible solutions. Wayland did not function as well using QT 5, so its adoption was limited at best. One major upgrade QT 6 brought to Wayland is HDR support, along with a modern graphics rendering engine (Vulkan, Metal, Direct3D, etc…) to add to performance compatibility.

Issues:

This is still an ongoing project, so bugs and compatibility problems do occur. One thing I noticed is that streaming with TeamViewer to another desktop causes many graphical artifacts and potential latency issues. The developers of KDE decided that Wayland is sufficiently functional and stable to make it the default window manager for KDE 6, and my opinion so far is that it is functional and stable enough to work with new desktop installs. This is going to be a series of blog posts, so tune in this week for the next article!

FAQ: X.org vs Wayland in KDE Plasma 6:

What is X.org?

X.org (or X11) is the traditional Linux display server from 1984 (version 11 in 1987). It’s been the standard for managing windows and graphics for decades.

What is Wayland?

Wayland is a modern replacement for X11. It simplifies the graphics stack, with apps rendering directly via a compositor for better performance and security.

Why does KDE Plasma 6 default to Wayland?

KDE developers deem it stable enough for daily use. It offers smoother performance, better security, and modern features like HDR, thanks to improved Qt 6 support.

Main advantages of Wayland over X.org?

  • Higher performance and lower latency
  • Stronger security (apps are isolated)
  • Native HDR and better high-DPI support
  • Simpler, more efficient architecture

Questions?

If you have any questions or comments feel free to leave them below.

Related Resources

View our guide on How to Install WordPress on Ubuntu 22.04.

Learn How to Permanently Disable Windows Defender.

Check out our Installing Elementary OS: A Comprehensive Guide for Beginners article.

View our How to Install an Nginx RTMP Server in Ubuntu 22.04 tutorial.

Learn more cool things in Linux with our Linux Tutorials.

View all of our available online tools and converters at Formatswap.com.

How to configure a Linux Host with GPU Passthrough for Windows Mixed Reality

This is my report on researching and testing the possibility of using a Linux host, with a Windows virtual machine in KVM, with GPU passthrough and a Windows Mixed Reality(WMR) headset. My findings have been that it is indeed possible, with near native performance, but hardware and software setup is complex. It requires an understanding of the Linux operating system, virtual machines and KVM, hardware schematics, and ability to build/modify a computer tower. It is possible with a smaller budget (like I had) to do this, but that might mean searching for pre-owned parts to reduce the cost of the upgrade.

Virtual reality is growing in popularity every year, and similarly, frustrations with Windows operating systems are driving more people to Linux. In the virtual reality world, there is an increase in immersion, as your movements are mimicked by the headset tracking. But Microsoft has recently announced that they are removing support for the WMR headset in Windows 11. This is incredibly frustrating to the people who purchased a WMR headset, especially since Windows is not releasing the source code for the platform. On the other hand, Linux developers have been experimenting with creating compatibility layers of software to allow for the headsets to work natively in Linux. While this is great for open source users and developers, there are still compatibility problems with playing games designed for Windows. Specifically, the headset is still not fully functional in its alpha state.

Linux

Linux distributions generally have a stronger focus in security, privacy, and openness to customize the operating system. As Windows continues to add to the growing list of performance problems and intrusive tracking software, many people are looking for a way to continue using older devices that are not compatible with the latest Windows operating systems. In my case, I wanted the ability to make more decisions about what and how my computer runs, and the safety of using open source software has actually increased the capabilities of my system with no added tracking or telemetry.

Virtual Machine

The current way to run native Linux but have Windows for gaming available is through using a kernel-based virtual machine (KVM), a Linux native hypervisor that allows for more capabilities than other hypervisors, like VirtualBox. It uses QEMU as its emulator and Libvirt for Virtual Machine(VM) management. This is controllable with a graphical application called Virtual Machine Manager, used as a Graphical User Interface(GUI) to function without needing to use a terminal. KVM, when properly set up, provides near-native performance and the ability to dedicate PCIe devices (like graphics cards) to the virtual machine of your choice. This allows your devices to function completely separate from the Linux desktop, and can be operated independently from each other (i.e. you can play games on Windows while working or playing videos on your Linux desktop) if you have multiple monitors or separate video inputs on your current monitor.

IOMMU

The way this is achieved is through enabling virtualization tools in the BIOS, and sending Input/Output Memory Management Unit (IOMMU) PCIe groupings to the virtual machine. Modern laptops and desktops have virtualization abilities that you can enable within the BIOS, with some features for better VM performance. IOMMU groupings are the way motherboards dedicate certain pipelines of data to and from their location in the motherboard. Nearly everything, including the CPU and its components, has its own groupings, but some are grouped together in a way that would conflict with virtualization passthrough.

The Virtual Function I/O(VFIO) is responsible for allowing hardware devices to be controlled directly with an application. In other words, it is possible to pass control to an application, like KVM, for direct hardware access. The IOMMU groupings dictate what devices you can share, while giving them a hardware address that an application can recognize. Tricky part is you have to pass the entire grouping for it to function in the virtual machine. In my case, my motherboard grouped some PCIe slots I wanted to use with the CPU. I needed a solution.

PCIe

I was able to pass my Nvidia graphics card to the VM, after blocking any Nvidia drivers in the kernel from loading, but I could not pass the USB-C included on my motherboard I/O because it was tied to CPU functions. I wanted to do this so I could use my WMR headset, which requires a DisplayPort and USB-C actively connected to function. I purchased a few USB PCIe cards to use in one of my unused slots, but it only supported an x1 connection. This essentially means it can only fit very small expansion cards, and isn’t capable of transferring as much data than larger slots (4x, 8x, 16x etc.) Even with a supported x1 USB card, it was not able to be passed to my virtual machine, because the slot was shared with some CPU functions on my motherboard.

My system was originally using a Ryzen 7 5800x with 32GB of DDR4 ram, with my Asus B550-F motherboard, and an RTX 2070 + RX 550x for graphics. The Asus motherboard only had one or two PCI 4.0 slots(the latest and highest rated), the rest were 3.0 with IOMMU groupings that could not be used in passthrough.

It was powerful enough for my needs, but I wanted to push my computer to be as upgraded as possible for the AM4 generation of CPUs, since it is already considered outdated hardware. Initially, I had set up a Windows virtual machine with my Nvidia RTX 2070 graphics card passed to the VM. Along with an AMD RX 550x low profile RX 580 graphics card to be used with Fedora Linux, my host OS. I also have a separate USB microphone and USB audio output device that I similarly pass control of to the VM. It worked, but I did not have enough slots to Install any other cards (like a PCIe USB expansion card). I did not have any other option for getting my virtual reality headset, an HP Reverb G2, working correctly. So I started looking into a motherboard that could support this.

Motherboard

After some research, I realized I would need to buy a high end AM4 motherboard. I initially looked at Asus, but I read they had very mixed reviews on its IOMMU groupings, so Asus didn’t seem to have the groupings I needed. So, I looked into other motherboards, and I eventually settled on a used Gigabyte X570 Aorus Master, which was purchased for about $170, about half the price of original retail value. User accounting said that the gigabyte had better separation in its IOMMU groupings, and this seemed to match what I found in my research.

I got the new motherboard installed, and everything seemed to function properly. The BIOS was different from my Asus motherboard, but a search for the manual told me everything I needed to do (always RTFM). I also upgraded my CPU to a Ryzen 5950x, so that way I could give both my Windows machine and my Linux host machine 8 dedicated cores and 16 threads to work with. This was unnecessary, but at the time the market prices were cheaper, and it gets more expensive the longer production has stopped and the hardware becomes rarer to find. This was with upgrading my machine to 64 gigabytes (16GB x 4) of RAM, but initial tests indicated it would not be enough resources to make this work. So I ended up settling on 128 gigabytes (32GB x 4) of ram to ensure future proofing and long term stability.

PCIe USB Expansion Card

The motherboard had three x16 PCIe slots that had satisfactory IOMMU separation, so I purchased what seemed like the best USB expansion card. It has two USB-C ports and three USB type A ports. Reviews indicated other cards that have USB-A slots facing vertically are not ideal, and often led to problems because the case made the ports difficult to access, since the ports were wider than my case slots. I finally decided on a dual combined USB-A and USB-C expansion card that had the slots facing horizontally, for a total of 3 USB-A and 2 USB-C ports on a PCIe x4 card.

Windows Mixed Reality

Once I got the USB card successfully passed through to the VM, I plugged in my VR headset into the DisplayPort slot and the USB-C slot. At first, I had to configure Windows to cheat the minimum hardware standards test for Windows mixed reality because it false-reported that I didn’t have enough system resources to run the VR application. This was corrected with a careful registry change, and I was then able to then get it to accept the hardware. I plugged in my headset, downloaded all the VR games and Software that I needed to run the VR. I turned it on, and it worked! Side note: leaving the headset plugged in before turning on the VM ended up crashing the VM every time, so I disconnect power to the headset until I am logged in.

Gaming Performance

I had interestingly better results with the performance of the VR. I suspect this is because I had only one monitor plugged into the GPU, instead of all 3 of the monitors I use. The framerate and response time were more consistent, and while testing Half Life: Alyx I was no longer getting the VRAM warning messages I had before.

Resource Allocation

I initially had my Windows VM set up as a virtual disk partition in the KVM software. But then I decided I wanted two separate M.2 SSDs for maximum space and performance. So I purchased the exact same 2TB Inland SSDs. I passed one of those SSDs, through the isolated IOMMU group, directly to Windows with minimal performance loss. The virtual machine was assigned 40 gigabytes of dedicated RAM solely for Windows. This may sound excessive, but I have plenty of resources are available to spare for increased stability. My Windows VM now runs games and VR as if it’s on a completely separate computer, though it does generate more heat.

Occasionally, the virtual machine will not work properly with Evdev, which is a function that can be added to the VM configuration to pass keyboard and mouse controls to the VM with minimal input lag. I can switch desktops by hitting both my left and my right control keys, but occasionally the keyboard shortcut stops working (mouse stays with one desktop and keyboard starts malfunctioning in the VM). Power cycling the VM can fix the issue.

UPDATE: I have not had this problem since the latest Fedora 42 update, so I can still use my primary keyboard and mouse in the VM without anything breaking!

Networking

At first, I struggled to figure out the networking side of the VM, as it did not have a visible IP on my network that I could interact with. I found a solution that shares the network in bridged mode that allows both the Linux host and the Windows VM to share the connection while having separate IP addresses visible to my local network. And I can still use my Linux host machine that performs with no difference to if the VM is being used or not. While I’m sure my system draws more power now, it costs less and draws less power than if I were to build a second dedicated gaming machine, and it is much easier to tweak and interact with Windows through the virtualization controls.

Inspiration

This was just a fun hobby project that I really wanted to test out. I was encouraged by many sources, such as Mutahar AKA SomeOrdinaryGamers who has discussed his desktop setup in many of his videos, my friends, and Linux memes I’ve encountered discussing the idea. I had to add a few extra steps to get my WMR headset functioning, but it was truly worth every bit of effort!

Update 12/2025

So I’ve made some recent adjustments and changes to my setup. Because of how premium the Aurora Master is, I have 2 separate Ethernet connections for my machine, and I can directly pass one of them to my virtual machine without issue. I wanted to highlight this because it changes the way I use it now. No more network bridging, just two separate direct connections with individual IP addresses. This will vary from motherboard to motherboard, so always check your motherboards iommu groupings to ensure compatibility.

I also swapped out my AMD card with the larger RX 580, so unfortunately I had to sacrifice my SATA expansion card to make room for the new card. Thankfully I have just enough ports on the motherboard so not a big deal, but I thought I would mention this.

FAQ: Using a Linux Host with a Windows VM for WMR Headset and GPU Passthrough

Can I use a Windows Mixed Reality (WMR) headset with a Linux host and a Windows virtual machine (VM)?

Yes, it’s possible with a Linux host running a Windows VM using KVM with GPU passthrough. However, the setup is complex, requiring knowledge of Linux, KVM, hardware schematics, and PC building. The WMR headset can work, but compatibility is limited due to its alpha-state support on Linux.

What hardware is needed for this setup?

You’ll need a motherboard with good IOMMU groupings for PCIe passthrough (e.g., Gigabyte X570 Aorus Master), a compatible GPU (e.g., Nvidia RTX 2070), a CPU with virtualization support (e.g., Ryzen 5950x), ample RAM (64GB or more recommended), and a PCIe USB expansion card for WMR headset connectivity.

Why use a Linux host instead of Windows for VR gaming?

Linux offers better security, privacy, and customization. With Windows dropping WMR support in Windows 11 and adding performance issues, a Linux host with a Windows VM allows you to use open-source software while running Windows games and VR applications with near-native performance.

What are the challenges with this setup?

Challenges include complex hardware and software configuration, ensuring proper IOMMU groupings, and managing compatibility issues with WMR headsets. You may need to tweak BIOS settings, block conflicting drivers, and handle occasional VM issues like input lag or crashes.

How does GPU passthrough work with KVM?

GPU passthrough uses KVM and VFIO to dedicate a GPU to the Windows VM, providing near-native performance. This requires enabling virtualization in the BIOS, configuring IOMMU groupings, and passing PCIe devices (like the GPU and USB card) to the VM.

Are there any tips for setting up a WMR headset?

Ensure the USB-C and DisplayPort connections are passed through correctly via a PCIe USB card. Disconnect the headset before starting the VM to avoid crashes, and you may need to adjust Windows registry settings to bypass WMR’s hardware check.

Questions?

If you have any questions or comments feel free to leave them below.

Affiliate

This page contains affiliate links. If you make a purchase through these links, we may earn a small commission at no extra cost to you.

Related Resources

View our How to Mount an SMB (Samba) Share in Linux with cifs-utils guide.

Learn How to Install Ubuntu Server 22.04 [Step by Step].

Check out How to Setup OpenSSH with Keys on Ubuntu 22.04.

View our How to Create a Mapped Network Drive in Windows 10 tutorial.

Learn How to Install and Configure Grafana on Ubuntu 22.04.

View all of our available online tools and converters at Formatswap.com.

How to Mount a Hard Drive at Boot in Ubuntu 22.04

mount hard drive boot ubuntu 22.04 splash image

Efficiency and convenience are at the heart of any well optimized operating system experience. Imagine every time you start your Ubuntu 22.04 system having all of your hard drives automatically mounted at boot. This is where the power of configuring /etc/fstab comes into play.

In this article we will explore automatic drive mounting in Ubuntu 22.04 using fstab. You’ll gain the skills to ensure your system efficiently recognizes and mounts your hard drives as part of its boot sequence. Whether you’re an experienced Linux user or just getting started, this guide will walk you through the process. This will make your daily computing tasks smoother and more efficient. So let’s dive in and improve your Ubuntu hard drive mounting experience.

List Drives and Partitions

list all partitions and disks

The first step to mounting you hard drive at boot is finding its name. You can list out all hard drive and partition names using the lsblk command. Our drive is the 32GB one labled “vda”. The partition we want to mount is “vda1”. Locate your drive and partition name from the list as it may differ. In most cases it will be sdb or sdc.

lsblk -a

Create Mount Point

create a mount point directory

The next step is creating the folder for the drives mount point. We will be using the media folder but feel free to use the mnt folder instead. Use the following command to create a mount folder called data in the media folder.

sudo mkdir /media/data

Open The fstab File

open /etc/fstab file

After we create the mount directory we will edit the fstab file. Open it using the nano command below.

sudo nano /etc/fstab

Add Mount Point Line

add mount point line

Once the fstab file is open we will navigate to the bottom of the file and add a new line. Replace /dev/MOUNT_POINT with the partition from the disk you want to mount. You will also need to replace /media/MOUNT_DIR with the directory you want to mount it in. After you have added the line save and close the file. In our case we will be using /dev/vda1 and /media/data.

#Hard Drive Mount Points
/dev/MOUNT_POINT /media/MOUNT_DIR ext4 defaults 0 0

Mount All Partitions

mount all drives

After editing the fstab file we need to remount all of the partitions. Use the mount -a command to mount them.

sudo mount -a

Verify Mounting

verify you can see mounted files

Now we want to check if the disks partition was mounted successfully. Use cd to navigate to the mount point you used in the fstab file, and verify that you can see your files. You can use the ls command to list all files. If you can see your files in the mount directory you have successfully configured a partition to mount at boot in Ubuntu 22.04.

cd /media/data && ls

Reboot System

reboot system

After verifying that we can see our files in the mount directory the last step is to reboot the system. Use the reboot command to proceed. Once your system reboots you should see you hard drives partition mounted in the mount directory automatically. This concludes the guide on automatically mounting hard drives at boot.

Fstab FAQ

What is fstab in Linux and what is its purpose?

fstab stands for “file system table” and is a configuration file in Linux that specifies how various storage devices, such as hard drives and partitions should be mounted on the file system at boot. It defines the mounting points, file system types, options, and other parameters essential for device mounting. Essentially fstab ensures that your storage devices are accessible and functional every time your Linux system starts up.

Can I mount network shares and remote filesystems using fstab in Linux?

Yes, you can use fstab to mount network shares and remote filesystems in Linux. To do this you would typically use entries that specify the network location (such as NFS or Samba shares) along with the mount point and other necessary parameters. By configuring fstab in this way you can ensure that these network resources are automatically mounted at boot. This will provide you with seamless access to remote data or networked storage devices. View our tutorial on How to Mount an SMB (Samba) Share in Linux with cifs-utils for additional information.

What should I do if I encounter errors or issues after editing the fstab file?

If you encounter errors or issues after editing the fstab file it’s important to address them promptly to prevent disruptions to your system. Here are some steps to follow:

  • Double-check your fstab entries for accuracy. Ensure that the device paths, mount points, and options are correctly specified.
  • Use a rescue or live Linux environment to access your system if it fails to boot due to fstab errors. From there you can make corrections to the fstab file.
  • If you’re unsure about a specific entry consider commenting it out (adding a “#” at the beginning of the line) temporarily to see if the issue resolves.
  • Always keep a backup of the original fstab file before making changes so that you can easily revert to a working configuration if needed.
  • Seek assistance from Linux forums, communities, or experienced users if you encounter persistent issues as fstab errors can impact system stability.

Questions?

If you have any questions or comments feel free to leave them below.

Related Resources

View our How to Mount an SMB (Samba) Share in Linux with cifs-utils guide.

Learn How to Install Ubuntu Server 22.04 [Step by Step].

Check out How to Setup OpenSSH with Keys on Ubuntu 22.04.

View our How to Create a Mapped Network Drive in Windows 10 tutorial.

Learn How to Install and Configure Grafana on Ubuntu 22.04.

View all of our available online tools and converters at Formatswap.com.

How to Install and Configure Apache Tomcat 10 on Ubuntu 22.04

apache tomcat ubuntu splash image

Apache Tomcat 10 is a powerful tool for deploying Java-based web applications, and if you’re running Ubuntu 22.04 you can easily harness its capabilities. In this easy to follow tutorial we’ll walk you through the straightforward process of installing and configuring it on your Ubuntu 22.04 system.

Whether you’re a seasoned developer or new to web development, this guide simplifies the installation and setup. By the end of the tutorial you’ll have Apache Tomcat 10 up and running on your Ubuntu 22.04 machine. This will have you ready to host your Java web applications.

Let’s get started with this quick guide to Apache Tomcat 10 on Ubuntu 22.04. Tomcat 10 will open up a new world of possibilities for your web development projects.

Update and Upgrade Ubuntu 22.04

update ubuntu 22.04

The first step to installing Apache Tomcat is to update and upgrade your system. Use the following apt command.

sudo apt update && sudo apt upgrade -y

Download and Install Java Development Kit

download java jdk

Next we need to install the Java Development Kit (JDK) package. Install the latest version will the apt command below.

sudo apt install openjdk-11-jdk 

Verify Java Version

verify java version

After installing the Java JDK we will want to verify the version, and that it was installed correctly. Use the java command shown below.

java -version

Create a User for Tomcat

create linux user for tomcat

The next step will be to create a Linux user account to manage our Apache Tomcat installation. Use the useradd command to create the user.

sudo useradd -r -m -U -d /opt/tomcat -s /bin/false tomcat 

Download Apache Tomcat 10

download apache tomcat 10

Once we have finished creating our user we will download Tomcat. Use wget to download the latest version with the below command.

wget https://dlcdn.apache.org/tomcat/tomcat-10/v10.1.13/bin/apache-tomcat-10.1.13.tar.gz

Extract Apache Tomcat

extract apache tomcat

Now that we have downloaded Tomcat we need to extract it. Use the tar command below to extract the archive into the /opt/tomcat folder.

sudo tar xzf apache-tomcat-*.tar.gz -C /opt/tomcat

Executable Files and Permissions

set permissions and make files executable

The next thing we will do is set the permissions of the /opt/tomcat folder.

sudo chown -R tomcat: /opt/tomcat

After you set the permissions you will need to make all of the .sh files in the /opt/tomcat folder executable. Use the following sh command.

sudo sh -c 'chmod +x /opt/tomcat/apache-tomcat-10.1.13/bin/*.sh'

Create Tomcat Users

create a user for tomcat

Next we will create the Tomcat user accounts using the tomcat-users.x file. First create the file with the nano command.

sudo nano /opt/tomcat/apache-tomcat-10.1.13/conf/tomcat-users.xml 

Then add the following text replacing _SECRET_PASSWORD_ with the passwords you wish to use. Save the file when finished.

<!-- user manager can access only the manager section -->
<role rolename="manager-gui" />
<user username="manager" password="_SECRET_PASSWORD_" roles="manager-gui" />
 
<!-- user admin can access manager and admin section both -->
<role rolename="admin-gui" />
<user username="admin" password="_SECRET_PASSWORD_" roles="manager-gui,admin-gui" />

Allow External Connections to Tomcat

allow external connections in manager context.xml file

After you had created the users you will want to make Apache Tomcat accessible externally. The first thing is to open the context.xml file with nano.

sudo nano /opt/tomcat/apache-tomcat-10.1.13/webapps/manager/META-INF/context.xml

Once the file is open comment out the following section shown in the red box of the above screenshot.

<!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> -->

Additionally Edit the Host Manager Context.xml File

allow external connections in host manager context.xml file

Additionally we have to comment out a section of the host manager context.xml file. This is also needed to allow external access. Open the file with nano.

sudo nano /opt/tomcat/apache-tomcat-10.1.13/webapps/host-manager/META-INF/context.xml

Then comment out the following line. After saving the file your Tomcat should be accessible from outside your network.

<!--<Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> -->

Create Systemd Service File

create a systemd service file

Next we will created a systemd service file to manage Apache Tomcat. First create the file with the nano text editor.

sudo nano /etc/systemd/system/tomcat.service 

Then add the following text. Save the file after adding it.

[Unit]
Description=Apache Tomcat 10 Web Application Server
After=network.target
 
[Service]
Type=forking
 
User=tomcat
Group=tomcat
 
Environment="JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
Environment="CATALINA_HOME=/opt/tomcat"
Environment="CATALINA_BASE=/opt/tomcat"
Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
 
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
 
[Install]
WantedBy=multi-user.target

Reload Systemctl Daemon

reload systemctl daemon

After creating the service file we will reload the daemon.

sudo systemctl daemon-reload

As well as start the Apache Tomcat application.

sudo systemctl start tomcat

Check Tomcat Status

check status of tomcat

Next we will check the current status of Tomcat to make sure it started correctly.

sudo systemctl status tomcat.service

Enable Tomcat to Start at Boot

enable tomcat at boot

After that set Apache Tomcat to start at system boot with the systemctl enable command.

sudo systemctl enable tomcat

Configure UFW Firewall

allow tomcat port through firewall

Now we can allow Tomcat through the ufw firewall. Use the following command to allow it.

sudo ufw allow 8080

Test Tomcat Configuration

test apache tomcat

The final step of installing Apache Tomcat is to navigate to the application. Open a web browser and go to http://UBUNTU_IP_ADDRESS:8080/ replacing the IP with the IP of your box. If everything is successful you should see a page similar to the above. You have now successfully installed Apache Tomcat 10 on Ubuntu 22.04.

Questions?

If you have any questions or comments feel free to leave them below.

Related Resources

View our How to Setup Nginx as a Reverse Proxy on Ubuntu 22.04 LTS.

Learn How to Install Ubuntu Server 22.04 [Step by Step].

Check out our How to Easily Create a Bootable Linux USB Drive using Rufus article.

View our How to Setup an SFTP Server on Ubuntu 22.04 using OpenSSH tutorial.

Learn more cool things in Linux with our Linux Tutorials.

View all of our available online tools and converters at Formatswap.com.

How to Install and Configure Grafana on Ubuntu 22.04

grafana splash image

In this tutorial you will learn the installation process of Grafana on Ubuntu 22.04. Grafana is renowned for its versatility and powerful data visualization capabilities. It has become an essential tool for monitoring and analyzing data across various industries and applications. Whether you’re a seasoned systems administrator or a curious enthusiast eager to use the potential of Grafana for your data driven needs, this guide will provide you with clear instructions to set up Grafana on your Ubuntu 22.04 system. Let’s dive in and unleash the potential of Grafana for your data visualization and monitoring endeavors.

Install Prerequisite Packages

install prerequisite packages

The first step for installing Grafana is to download and install all of the prerequisite packages. Install them using the apt command below.

sudo apt install apt-transport-https software-properties-common wget

Import Grafana GPG Key

install grafana gpg key

Next we need to import Grafanas repository GPG key. First create a keyrings folder with the mkdir command. Then download the key with the wget command.

sudo mkdir -p /etc/apt/keyrings/

wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null

Add The Grafana Repository

add the grafana repository

Now we will add the stable Grafana repository. Use the echo command to add it to your sources.list file.

echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

Update Ubuntu 22.04

update ubuntu 22.04

Afterwards we will use apt to update Ubuntu 22.04.

sudo apt update

Start and Enable Grafana Service

enable and start grafana service

Next we will start and enable the grafana-server package. Use the systemctl start and enable commands to complete this step.

sudo systemctl start grafana-server

sudo systemctl enable grafana-server.service

Test Grafana Login

login to the test grafana account

Navigate to the login page of your new Grafana installation by navigating to http://SERVER-IPADDRESS:3000 . Replace SERVER-IPADDRESS with the IP address of the server you installed Grafana onto. Then login using the default credentials below.

Username: admin
Password: admin

Start Using Grafana

start using grafana

Once you login you have successfully installed Grafana on Ubuntu 22.04. You can now create a dashboard and get started with Grafana. For more information on getting started see the Grafana Build Your First Dashboard article.

FAQ

What is Grafana, and what is its primary purpose?

Answer: Grafana is an open source platform for monitoring data. Its primary purpose is to visualize and analyze data from different sources, including databases, cloud services, and monitoring systems. This help users gain insights into the performance of their applications and infrastructure.

What data sources can Grafana connect to?

Answer: Grafana can connect to a wide range of data sources, including but not limited to:

  • Time series databases like InfluxDB, Prometheus, and Graphite.
  • Relational databases such as MySQL, PostgreSQL, and Microsoft SQL Server.
  • Cloud monitoring services like AWS CloudWatch and Azure Monitor.
  • Log management systems like Elasticsearch and Loki.
  • Custom APIs through HTTP requests.
  • Many other data sources through community-supported plugins and integrations.

How can I create dashboards in Grafana?

Answer: Dashboards in Grafana are created using the web based interface. Here are the general steps:

  1. Log in to your Grafana instance.
  2. Click on “Create” and then “Dashboard.”
  3. Add a panel to your dashboard.
  4. Configure the panel’s data source, query, and visualization options.
  5. Customize the panel’s appearance and layout.
  6. Add more panels as needed to build a complete dashboard.
  7. Save the dashboard for future use and sharing.

Can Grafana be used for alerting and notifications?

Answer: Yes, Grafana includes alerting and notification features. You can set up alerts based on various thresholds or conditions in your data. When an alert condition is met Grafana can send notifications via various channel, such as email, Slack, PagerDuty, or custom webhooks, helping you to monitor and respond to issues.

Is Grafana suitable for large-scale enterprise environments?

Answer: Yes, Grafana is suitable for both small scale and large scale environments. It is highly scalable and can handle large volumes of data and users. Additionally Grafana supports features like user authentication, access control, and integration with various authentication providers. This makes it a great choice for use in enterprise level environments where security and access control are important considerations.

Questions?

If you have any questions or comments feel free to leave them below.

Related Resources

View our 5 Reasons to Switch from Windows 10 to Linux.

Learn How to Install Ubuntu Server 22.04 [Step by Step].

Check out our How to Easily Create a Bootable Linux USB Drive using Rufus article.

View our How to Setup an SFTP Server on Ubuntu 22.04 using OpenSSH tutorial.

Learn more cool things in Windows with our Linux Tutorials.

View all of our available online tools and converters at Formatswap.com.

How to Create a Windows 10 Virtual Machine Using VirtualBox on Ubuntu 22.04

install virtualbox splash image

Welcome to our comprehensive tutorial on creating a Windows 10 virtual machine using VirtualBox on Ubuntu 22.04. In this article we will guide you through the step-by-step process of not only installing VirtualBox on your Ubuntu 22.04 system, but also constructing a new virtual machine within VirtualBox. Whether you’re a beginner or an experienced user this tutorial will equip you with the necessary knowledge to set up and configure Windows 10 within a virtualized environment. This will enable you to seamlessly run Windows applications on your Ubuntu system. So, let’s dive in and explore the exciting world of virtualization with VirtualBox!

Update and Upgrade Ubuntu 22.04

update and upgrade ubuntu

The first step is to update and upgrade Ubuntu 22.04. You can do so using the apt command.

sudo apt update && sudo apt upgrade

Install VirtualBox

install virtualbox

Next you will need to install the VirtualBox package as well as the VirtualBox DKMS package. You can install them both with the following command.

sudo apt install virtualbox virtualbox-dkms

Install VirtualBox Extension Pack (optional)

install virtualbox extensions

After installing the two packages you can install the VirtualBox extension pack. This gives you features such as shared clip board, and shared folders within your virtual machine. This step is optional but it is highly recommended.

sudo apt install virtualbox-ext-pack

Add Your User to the User Group

add user to virtualbox group

The final step of the installation process is to add your user account the the vboxusers group. Use the usermod command below to complete this operation.

sudo usermod -a -G vboxusers $USER

Download Windows 10 ISO

Download Windows 10

Now that VirtualBox is installed we can download our ISO that we will use for the virtual machine. In this example I will be using the Windows 10 (64 Bit) installation ISO file. However the Windows 11 process would be virtually the same.

Download Windows 10 (ISO File)

Create a New Virtual Machine with VirtualBox

create new vm with virtualbox

The next step is to open VirtualBox and create a new virtual machine. Simply open the application and click on the “New” button as shown in the screenshot.

Set the Virtual Machines Options

fill out virtualbox config

You will then be asked to choose a name for the virtual machine. Then you will need to select the amount of memory you want available to the virtual machine. Finally select “Create a virtual hard disk now” then press the “Create” button.

Create a Virtual Hard Disk

create the virtual hard drive

On the virtual hard disk creation wizard you will be asked to choose a location, as well as choose the disks size. After you have made your selections click on “Create” to finish.

Power on the Windows 10 Virtual Machine

start the virtual machine

After creating the new virtual machine you will be greeted with this screen showing the Windows 10 VM. Click on the machine and then click “Start” to launch the machine.

Select the Boot Disk

select the iso file

Once the virtual machine starts you will be asked to choose an installation ISO. Select the Windows 10 ISO file we downloaded earlier (or another of your choice). Then click on “Start”.

Start the Windows 10 Installation

start installation process for windows 10

After a few moments you will reach the Windows 10 installation screen. Select a language and click “Next” to continue.

Click Install Now

click install windows 10 now

On the next screen simply press “Install now”.

Windows Product Activation

enter up skip product key

The next screen will ask you if you want to provide a Windows activation key. Either enter your key and press next, or click “I don’t have a product key” to continue.

Select the Version of Windows 10 to Install

select windows version

You will now be asked which version of Windows 10 you would like to install. For this demo I will be selecting “Windows 10 Pro”. After you select it click “Next”.

Accept the License Agreement

accept the licence

Now you will be asked to accept Microsoft’s license terms for the Windows Operating System. Enable the checkbox then click “Next”.

Choose Custom Windows Install

choose custom install

Next you will be asked if you would like to upgrade an existing Windows installation or install a fresh version. Since this is a virtual machine we will want to select “Custom: Install Windows only (advanced)”.

Choose Where to Install Windows

select the disk

After selecting “Custom” you will be asked to choose the location Windows should be installed. Click on the virtual hard disk we created in the earlier, then click “Next”.

Wait for the Windows Installation to Complete

wait for windows 10 to finish installing

Once you reach this screen Windows is installing. Wait for the process to complete successfully.

Finalize the Windows 10 Configuration

follow windows setup prompts

After the base installation finishes you will see this screen. Go through each of the steps and provide your personalization preferences.

Wait for Windows to Configure

wait for final windows 10 setup

Wait for Windows 10 to finish configuring on the virtual machine.

Insert the VirtualBox Guest Additions CD

insert virtualbox guest cd

Once you are able to login to Windows we will want to install the VirtualBox Guest Additions package. To do so simply click on “Devices”, and then “Insert Guest Additions CD image…” shown in the screenshot above.

Open the VirtualBox Guest Additions CD

open guest additions cd

Now that you have inserted the CD it can’t be located in File Explorer under “This PC”. Double click on the CD to open it.

Launch the VirtualBox Guest Additions Installation Wizard

install guest cd

Launch the Oracle VM VirtualBox Guest Additions installer executable found in the CD folder. Follow the onscreen prompts to install the software.

Reboot the Windows 10 Virtual Machine

reboot virtualbox

The final step will be to reboot the virtual machine. Once the machine reboots you have successfully setup a Windows 10 virtual machine using VirtualBox in Ubuntu 22.04.

Questions?

If you have any questions or comments feel free to leave them below.

Related Resources

View our guide on How to Install WordPress on Ubuntu 22.04.

Learn How to Permanently Disable Windows Defender.

Check out our Installing Elementary OS: A Comprehensive Guide for Beginners article.

View our How to Install an Nginx RTMP Server in Ubuntu 22.04 tutorial.

Learn more cool things in Linux with our Linux Tutorials.

View all of our available online tools and converters at Formatswap.com.

How to Install and Remotely Access Squid Proxy on Ubuntu 22.04

squid splash image

This tutorial provides a comprehensive guide on setting up and remotely accessing the Squid proxy server on an Ubuntu 22.04 system. Squid proxy is a popular caching and forwarding HTTP proxy server that acts as an intermediary between clients and web servers. It enables efficient caching of web content, improves browsing performance, and provides various features for network administrators to manage and control internet access.

By installing and configuring Squid proxy on an Ubuntu 22.04 system, you gain the ability to cache frequently accessed web content, reducing bandwidth usage and improving response times for subsequent requests. Additionally, Squid proxy offers features such as access control, content filtering, and user authentication. This allows you to enforce policies and restrictions for internet access within your network.

The article not only walks you through the installation process of Squid proxy on Ubuntu 22.04 but also provides instructions for remote access. This means you can send your devices traffic to the proxy server from a remote location granting you accessibility and security from anywhere.

Overall, understanding how to install and remotely access Squid proxy on Ubuntu 22.04 empowers you to optimize your network’s performance, enhance security, and efficiently manage internet access for your organization or personal use.

Update and Upgrade Ubuntu 22.04

update and upgrade ubuntu 22.04

The first thing we will need to do to install Squid Proxy is update and upgrade your system. Run the apt update and apt upgrade command below.

sudo apt update && sudo apt upgrade -y

Install Squid Proxy

install squid and apache2-utils

The next thing we need to do is install Squid proxy and Apache utilities. The utilities package will allow us to create a password authentication file for authentication our proxy users. Use the apt command below to install the two packages.

sudo apt install squid apache2-utils

Create a Credential File

touch and create squid passwords file

Now we will create a passwords file and assign the correct permissions. Squid will read this file to authenticate our proxy users. Use the below command to touch and chmod the file.

sudo touch /etc/squid/passwords && sudo chmod 777 /etc/squid/passwords

Create Authentication User

create user and password

Next create the proxy authentication user with the htpasswd command. Replace “username” with the username you want to use for logging into the proxy. After you run the command you will be asked to type and retype the password you wish to use.

sudo htpasswd -c /etc/squid/passwords username

Test Authentication

test the authentication file

Now we can test our proxy authentication file with the basic_ncsa_auth command. Run the following command and confirm you get “OK” as shown in the above image. This means that the credential file is configured properly.

/usr/lib/squid/basic_ncsa_auth /etc/squid/passwords

Backup Squid Config

backup the original squid config

After we create our credentials file we need to make a backup of the squid config. Move it to a temporary location with the command below.

sudo mv /etc/squid/squid.conf /etc/squid/squid.conf.backup

Create Squid Config File

create new squid config file

Now create a new squid config file with the nano command.

sudo nano /etc/squid/squid.conf

Add Lines to Config (Local Network Only)

add to squid config for localnet only

Once the file opens it will be blank and we need to add a few lines. Copy and paste the below config into your squid.conf file. Make sure to change the “acl localnet src 192.168.2.0/24” line to reflect your own IP range. With this configuration you will only be able to access your proxy from within the local network. If you want to access the proxy remotely skip to the next optional step. Otherwise save and close the config file.

auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 24 hours
auth_param basic casesensitive off
acl authenticated proxy_auth REQUIRED
acl localnet src 192.168.2.0/24 # RFC1918 possible internal network
http_access allow localnet
http_access deny all
dns_v4_first on
forwarded_for delete
via off
http_port 8888

[optional] Add Lines to Config (Remote)

add to squid config for both wan and lan access

This step is optional, however it will allow you to access the proxy server remotely. To enable remote access replace your config with the lines shown below. Keep in mind you will also have to enable port forwarding in your router for remote access. Save and close the file.

When allowing remote access to your proxy it is recommended to configure a firewall. For guidance on this please see our How to Configure a Firewall in Linux using UFW tutorial.

auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 24 hours
auth_param basic casesensitive off
acl authenticated proxy_auth REQUIRED
acl all src 192.168.2.0/24 # RFC1918 possible internal network
http_access allow all
http_access deny all
dns_v4_first on
forwarded_for delete
via off
http_port 8888

Start and Enable Squid Process

start and enable squid

The last step in the installation process is to start and enable the squid proxy service. Use the systemctl command below to complete these steps.

sudo systemctl start squid && sudo systemctl enable squid

Install Curl

install curl on separate machine

Now that the installation is complete we can test our squid proxy server. For this step you will need to install Curl onto a separate machine.

sudo apt install curl

Test the Squid Proxy Server

test the proxy with curl

After you have installed Curl run the following command. Replace “myuser:password” with the username and password you choose when you created the credential file. Additionally replace IP-ADDRESS with the IP of the Ubuntu machine with the squid proxy server.

curl --proxy-user myuser:password --proxy IP-ADDRESS:8888 https://www.google.com

Verify Curl Results

confirm curl response with proxy

If the connection to the proxy server was successful you should see a bunch of text in the Curl response. You have now successfully installed Squid proxy on Ubuntu 22.04.

[optional] Verify the Proxy Requests in the Log

confirm the connection test in the squid access log

If you would like extra verification that Squid is functioning you can check the log file. Use the tail command below and verify you see a new request appear when you run the test Curl command from above.

sudo tail -f /var/log/squid/access.log

Questions?

If you have any questions or comments feel free to leave them below.

Related Resources

View our guide on How to Install WordPress on Ubuntu 22.04.

Learn How to Install Ubuntu Server 22.04 [Step by Step].

Check out our Installing Elementary OS: A Comprehensive Guide for Beginners article.

View our How to Setup an SFTP Server on Ubuntu 22.04 using OpenSSH tutorial.

Learn more cool things in Linux with our Linux Tutorials.

View all of our available online tools and converters at Formatswap.com.

How to Install WordPress on Ubuntu 22.04

install wordpress on ubuntu splash image

In today’s tech age having a powerful and user friendly website is essential for businesses, bloggers, and individuals. WordPress a renowned content management system (CMS), has emerged as the go-to solution for creating stunning websites with ease. If you’re looking to use WordPress on your Ubuntu 22.04 server this article is your comprehensive guide to getting started.

WordPress offers a vast array of themes, plugins, and customizable features that enable you to create a unique online presence. Whether you’re a beginner or a seasoned web developer, WordPress simplifies website creation and management. Best of all it eliminates the need for extensive coding knowledge. By leveraging its intuitive interface and extensive community support, you can effortlessly establish a professional online presence.

In this step by step tutorial, we will walk you through the process of installing WordPress on Ubuntu 22.04. By following these instructions, you’ll be well-equipped to embark on your WordPress journey and start using this dynamic platform. Let’s dive in and empower your web presence with WordPress on Ubuntu 22.04.

Update and Upgrade Ubuntu

Update and Upgrade Ubuntu

The first step to installing WordPress is to update and upgrade your Ubuntu installation. Run the following command.

sudo apt update && sudo apt upgrade -y

Install Required Packages

Install Required Packages

Next you will need to install all of the required packages. Install them using the apt command below.

sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql -y

Login to the Root MySQL Account

Login to the Root MySQL Account

Once you have installed all of the required packages you will need to login to SQL. Use the below mysql command, then enter your user password to login.

sudo mysql -u root -p

Update the Database Records

Update the Database Records

After you get into mysql, run the following four mysql statements. Replace ‘wordpressuser’ and ‘password’ with the username and password you want to use for your mysql user.

CREATE DATABASE wordpress;

CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';

FLUSH PRIVILEGES;

Once the mysql statements have been ran, exit the mysql command line with ‘EXIT;’.

EXIT;

Download WordPress

Download WordPress

After running your mysql commands you will need to download WordPress. First navigate to your web directory at /var/www/html.

cd /var/www/html

Then download the latest version of WordPress using the wget command.

sudo wget https://wordpress.org/latest.tar.gz

Extract the WordPress Archive

Extract the WordPress Archive

Next extract the WordPress files from the .tar.gz archive using the tar command.

sudo tar -xvzf latest.tar.gz

Move the Files to the Web Directory

Move the Files to the Web Directory

After the files have been extracted, move them to the root web directory using the mv command.

sudo mv wordpress/* .

Apply Permissions

Apply Permissions

Next apply read/write permission to the folder using the chown and chmod commands.

sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 755 /var/www/html/

Move the WordPress Config File

Move the WordPress Config File

After applying the permissions, create a WordPress config file based off of the sample file. Use the following command.

sudo mv wp-config-sample.php wp-config.php

Open the WordPress Config File

Open the WordPress Config File

After creating the wp-config.php file you need to open it using the nano text editor, or your editor of choice.

sudo nano wp-config.php

Update the Config Values

Update the Config Values

Now you need to update the three lines highlighted in red. Fill out the DB_NAME, DB_USER, and DB_PASSWORD lines with the values you choose during the mysql step. Once you finish editing these lines, save and close the file.

Edit the Apache Configuration File

Edit the Apache Configuration File

Afterwards open up your Apache configuration file with nano.

sudo nano /etc/apache2/sites-enabled/000-default.conf

Scroll down until you see the line “DocumentRoot /var/www/html”, add the following to the line underneath.

DirectoryIndex index.php index.html

Once you have made your changes save and close the file.

Enable Apache a2enmod

Enable Apache a2enmod

Now we have to enable the Apache extension “a2enmod”. Enable it using the below command. If it was successful you should see “Enabling module rewrite”.

Restart Apache

Restart Apache

Finally we will restart Apache to apply all of our changes. Use the systemctl restart command below.

sudo systemctl restart apache2

Navigate to the WordPress Setup Page

Navigate to the WordPress Setup Page

Now you can open a web browser and navigate to your servers IP address. You can find it by opening a terminal window on Ubuntu and running the “ip a” command. Once you arrive to the page you will be asked to select your language before continuing.

Configure the WordPress Site

Configure the WordPress Site

On the next page you will be asked for the title of your site, your username, password, and email. After you fill out these fields select “Install WordPress” to complete the installation.

WordPress Successfully Installed on Ubuntu 22.04

Wordpress Successfully Installed on Ubuntu 22.04

Once you see this page your WordPress installation is complete. Click “Log In” to begin using WordPress. You have now successfully installed WordPress on Ubuntu Server 22.04.

Questions?

If you have any questions or comments feel free to leave them below.

Related Resources

View our How to Setup Nginx as a Reverse Proxy on Ubuntu 22.04 LTS.

Learn How to Install Ubuntu Server 22.04 [Step by Step].

Check out our How to Easily Create a Bootable Linux USB Drive using Rufus article.

View our How to Setup an SFTP Server on Ubuntu 22.04 using OpenSSH tutorial.

Learn more cool things in Linux with our Linux Tutorials.

View all of our available online tools and converters at Formatswap.com.

How to Setup Nginx as a Reverse Proxy on Ubuntu 22.04 LTS

nginx splash

What is a reverse proxy server?

With the rise of cloud computing and distributed systems, it is common to have multiple web servers handling different aspects of a web application. However, managing and directing traffic to multiple servers can be a complex task. This is where setting up a Nginx reverse proxy can come in handy.

A reverse proxy acts as an intermediary between the clients device and one or more web servers. It receives requests from clients and sends them to the appropriate server based on a configuration file. This allows for load balancing and distribution of traffic across multiple servers. This ensures that none of your servers are overwhelmed with requests.

One of the primary benefits of using a reverse proxy is that it enables you to have multiple web servers handling different sections of your website or web application while still appearing as a single website to your users. For example, you could have the main section of your website handled by one Nginx server, while the additional subsections of your website are handled by a separate Nginx server.

This will not only help with managing traffic but also provides an added layer of security by hiding the origin servers from external users. If one of the servers fails, the reverse proxy has the ability to automatically redirect traffic to other healthy servers. This ensures that the website will always remain available and responsive.

Overall a reverse proxy is a powerful tool that can help manage traffic to multiple web servers, provide load balancing, improve security, and ensure high availability of web applications.

Initial Setup

This tutorial assumes that you already have a primary Nginx server set up (reverse proxy server). As well as a second Nginx server with the web app you want to appear on the first. If you need help installing a basic Nginx server, please read our How to install and configure Nginx tutorial.

Overview of Goal

primary nginx reverse proxy web server

For this example the above web server 192.168.2.154 (shown above) will be our primary web server where we will configure the Nginx reverse proxy.

secondary nginx reverse proxy web server

The second web server 192.168.2.155 (shown above) hosts the web application we want to reverse proxy to the first server.

404 not found example reverse proxy

The goal is to be able to access the second web servers content from a subfolder app2/ on the primary server. We want to be able to access the above URL on the primary server and have the blue website content load from the second server. Once we have finished configuring the reverse proxy, we will be able to access the second web servers content using a subfolder on the primary web server 192.168.2.154/app2/.

Connect to the Primary Web Server

To get started connect to the primary web server. In my case this will be the 192.168.2.154 server. Once connected open a new terminal window. Next create a new directory in the /var/www/html/ folder. This is where you will access your secondary web server from. In my case I will use the command shown below.

sudo mkdir /var/www/html/app2

Edit the Nginx Config File

nginx config file

Afterwards we need to edit the /etc/nginx/sites-available/default config file. Open the file in your favorite text editor and navigate to the location / section inside the server { } parentheses as shown above. The command below will open the file with the nano text editor.

sudo nano /etc/nginx/sites-available/default

Add a New Location

add lines to nginx config for proxy_pass

Now we need to add a new location under the first location / block. Use the command block below as an example. Replace FOLDER_NAME with the name of the directory you want the secondary web server accessible from. This is the folder we created in the first step. We also need to replace IP_ADDRESS with the IP of the secondary web server.

location /FOLDER_NAME {
                proxy_pass http://IP_ADDRESS/;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

After adding the location block, close and save the file with Crtl+X.

Restart Nginx

Next we need to restart the Nginx web server to apply our configuration changes. To do this we use the systemctl command below.

sudo systemctl restart nginx.service

Test the Nginx Reverse Proxy

successful nginx reverse proxy test

Now we will need to test that the reverse proxy is working. We will navigate to our subfolder we created earlier using the primary web server 192.168.2.154/app2/. Assuming the Nginx config was set up correctly your second web servers content should appear. You have now successfully configured a reverse proxy using the Nginx web server.

Questions?

If you have any questions or comments feel free to leave them below.

Related Resources

View our 5 Reasons to Switch from Windows 10 to Linux tutorial.

Learn How to Generate Images From Text Prompts with Python and TensorFlow.

Check out our How to Setup OpenSSH with Keys on Ubuntu 22.04 tutorial.

View our Deep Learning Image Style Transfer Tutorial Using Neural Style Pt tutorial.

Learn How to Setup Nginx as a Reverse Proxy on Ubuntu 22.04 LTS.

Learn How to Install an Nginx RTMP Server in Ubuntu 22.04.

View all of our available online tools and converters at Formatswap.com.

How to Install an Nginx RTMP Server in Ubuntu 22.04

nginx rtmp splash

In this tutorial, you will learn how to install the Nginx web server and enable the RTMP (Real-Time Messaging Protocol) module on any Ubuntu-based distribution. The RTMP protocol is a robust and efficient means of transmitting live video streams from your computer to the internet. This makes it an indispensable tool for content creators and streamers. With this tutorial, you can master the installation and configuration of Nginx with the RTMP module. This will allow you to broadcast your live video streams with ease.

Nginx is an open-source web server that is known for its efficiency, scalability, and reliability. It is widely used by web developers and system administrators to serve dynamic web content, reverse proxy, load balance, and cache HTTP requests. The Nginx RTMP module supports live streaming, making it an all-in-one solution for web developers and content creators.

RTMP is widely used by video streaming services such as YouTube, Twitch, and Facebook Live. With Nginx and the RTMP module, you can create your own video streaming service or broadcast your content on existing platforms. Whether you are a web developer looking to add live streaming to your website or a content creator looking to broadcast your content to a global audience. This tutorial is an excellent starting point to get you up and running with Nginx and the RTMP module.

Update and Upgrade Ubuntu

update and upgrade ubuntu

The first thing you will need to do is update and upgrade Ubuntu. You can do this with the following apt command.

sudo apt update && sudo apt upgrade

Install Nginx Web Server

install nginx web server

Next install nginx using apt.

sudo apt install nginx

Enable the Ubuntu Universe Repository

enable universal repository

We will now need to enable the Ubuntu Universe Repository. It is usually enabled by default but it is a good idea to verify. This will allow us to install the Nginx rtmp module.

sudo add-apt-repository universe

Install the Nginx RTMP Module

install nginx rtmp module

After you have enabled the repository, install the Nginx RTMP module using the command below. This will allow us to stream RTMP video using the Nginx web server.

sudo apt install libnginx-mod-rtmp

Open the Nginx Config File

open nginx config

Now we will need to make a few configuration changes in the nginx config file. Open it using the nano text editor.

sudo nano /etc/nginx/nginx.conf

Add Lines to Config

edit nginx config

Once you have opened the config file, scroll to the bottom and add the following lines. After adding them, save and close the file.

rtmp {
	server {
		listen 1935;
		chunk_size 4096;

		application live {
			live on;
			record off;
		}
	}
}

Restart Nginx Web Server

restart nginx

The last step of the installation process is to restart Nginx. Do this using the following systemctl command.

sudo systemctl restart nginx

Create a Test RTMP Stream with OBS

At this point we have finished the installation and configuration of a RTMP streaming server using Nginx. We now need to test the server. In this article I will be using OBS Studio to demonstrate the test stream. Below you will see instructions for installing OBS on both Windows and Linux. Choose the option that matches the OS of the system you will be streaming from.

Install OBS Studio (Ubuntu)

install obs studio ubuntu

Run the following command to install OBS Studio on Ubuntu.

sudo apt install obs-studio

Install OBS Studio (Windows)

To install OBS on Windows download it from the link below. Then launch the installer and follow the prompts.

Download OBS Studio

Open OBS Studio

open obs

After you have finished installing OBS Studio we can test the stream. Launch the program to get started.

Add a New Source

add a new source obs

Next click on the “+” button in the lower left to add a new source. I will be using the screen capture for this example, however feel free to use any source.

Choose Display

choose a display obs

Next it will ask which screen you would like to use. Generally it is on the correct option by default, but change it if it looks incorrect. Then click on the “OK” button.

Open OBS Settings Menu

open settings menu obs

Then we will need to open the OBS settings menu. Click on “Settings” in the lower right hand corner.

Stream to a Custom RTMP Server with OBS

stream to a custom rtmp server obs

Once the settings menu opens click on the “Stream” tab on the left hand side. Once you are on the tab change all three fields highlighted in red. Change the service drop down to “Custom…”, the Server to “rtmp://NGINX_SERVER_IP/live”, and the Stream Key to “test”. Then click on “OK” to save the changes.

Start the Test Stream

start streaming obs

After saving your streaming settings click on the “Start Streaming” button to begin the RTMP stream.

Open a Network Stream in VLC

open network stream vlc

Now we will test the RTMP stream using VLC Media Player. Launch the program then navigate to the “Media” tab in the top bar. Then click on “Open Network Stream…”.

Enter Network Stream URL

enter network url vlc

Enter the following into the box highlighted in red replacing “localhost” with your Nginx servers IP address. Then click on the “Play” button to start watching the stream.

rtmp://NGINX_SERVER_IP/live/test

Verify the RTMP Stream

verify rtmp stream

Verify that you can see your OBS stream. If you are able to see it then you have successfully streamed to a Nginx RTMP server using OBS Studio.

Questions?

If you have any questions or comments feel free to leave them below.

Related Resources

View our 5 Reasons to Switch from Windows 10 to Linux.

Learn How to Install Ubuntu Server 22.04 [Step by Step].

Check out our How to Easily Create a Bootable Linux USB Drive using Rufus article.

View our How to Setup an SFTP Server on Ubuntu 22.04 using OpenSSH tutorial.

Learn more cool things in Windows with our Linux Tutorials.

View all of our available online tools and converters at Formatswap.com.