Debian | LinuxHostSupport https://linuxhostsupport.com/blog/category/debian/ Linux Tutorials and Guides Tue, 25 Jun 2024 15:55:14 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 How to Install Python on Debian 12 https://linuxhostsupport.com/blog/how-to-install-python-on-debian-12/ https://linuxhostsupport.com/blog/how-to-install-python-on-debian-12/#respond Tue, 30 Jul 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2138 Python is a versatile programming language that can run on almost any system architecture, from web development to machine learning, and can be used for applications in various fields. Besides its versatility, Python is also relatively easy for beginners to learn, making it one of the most popular programming languages. This tutorial will show you […]

The post How to Install Python on Debian 12 appeared first on LinuxHostSupport.

]]>
Python is a versatile programming language that can run on almost any system architecture, from web development to machine learning, and can be used for applications in various fields. Besides its versatility, Python is also relatively easy for beginners to learn, making it one of the most popular programming languages. This tutorial will show you how to install Python on Debian 12.

Prerequisites

  • A Debian 12 VPS
  • SSH root access or a user with sudo privileges is required

Conventions

# – given commands should be executed with root privileges either directly as a root user or by use of sudo command
$ – given commands should be executed as a regular user

Login to VPS and Update the System

First of all, we need to log in to our Debian 12 VPS through SSH:

ssh root@IP_Address -p Port_number

Replace “root” with a user with sudo privileges or root if necessary. Replace “IP_Address” and “Port_Number” with your server’s IP address and SSH port number. Next, let’s make sure that we’re on Debian 12. You can do that like this:

# lsb_release -a

The command should return an output similar to this:

No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

Before starting, you have to make sure that all Debian packages installed on the server are up to date. You can do this by running the following commands:

# apt update -y

Install Python from Source

Debian 12 ships Python 3.11 as the default version. You can verify this by executing the command below:

# apt show python3

The command will return an output like this:

Package: python3
Version: 3.11.2-1+b1
Priority: optional
Section: python
Source: python3-defaults (3.11.2-1)
Maintainer: Matthias Klose doko@debian.org
Installed-Size: 82.9 kB
Provides: python3-profiler, python3-supported-max (= 3.11), python3-supported-min (= 3.11)
Pre-Depends: python3-minimal (= 3.11.2-1+b1)
Depends: python3.11 (>= 3.11.2-1~), libpython3-stdlib (= 3.11.2-1+b1)
Suggests: python3-doc (>= 3.11.2-1+b1), python3-tk (>= 3.11.2-1~), python3-venv (>= 3.11.2-1+b1)
Replaces: python3-minimal (<< 3.1.2-2)
Homepage: https://www.python.org/
Tag: devel::interpreter, devel::lang:python, devel::library,
implemented-in::c, implemented-in::python, role::devel-lib,
role::program, role::shared-lib
Download-Size: 26.3 kB
APT-Manual-Installed: no
APT-Sources: http://deb.debian.org/debian bookworm/main amd64 Packages
Description: interactive high-level object-oriented language (default python3 version)
Python, the high-level, interactive object oriented language,
includes an extensive class library with lots of goodies for
network programming, system administration, sounds and graphics.
.
This package is a dependency package, which depends on Debian's default
Python 3 version (currently v3.11).

Ubuntu has deadsnake’s PPA, which allows us to install multiple Python versions on an Ubuntu machine. Although we can install it on our Debian 12 machine using the same Deadsnake’s PPA with a little modification, it is not recommended. So, to install another version of Python 3 on a Debian 12 system, we need to install it from the source. We will show you how to install it.

Install Dependencies

Let’s install the dependencies by invoking this command below.

# apt install openssl \
build-essential \
curl \
gcc \
libbz2-dev \
libev-dev \
libffi-dev \
libgdbm-dev \
liblzma-dev \
libncurses-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
make \
tk-dev \
wget \
git \
zlib1g-dev

Download and Install Python 3.12.3

For example, you want to install Python 3.12. So, you need to go to Python download page and get the link. In this example, you want to download Python 3.12.4.

Now, after getting the download link, let’s download it.

# cd /tmp
# wget https://www.python.org/ftp/python/3.12.3/Python-3.12.3.tgz

Then, extract the downloaded file and go to the directory Python-3.12.3

# tar zxf Python-3.12.3.tgz
# cd Python-3.12.3

Finally, we can install it.

# ./configure --prefix=/usr/local
# make
# make install

That’s it — you have Python 3.12 now. It’s installed at /usr/local/bin/python3.12. To install multiple versions, repeat the steps and specify the versions you want to install.

Install Python using pyenv

Before installing pyenv, we need to get the latest version of pyenv frm GitHub. Let’s execute this command below.

# git clone https://github.com/pyenv/pyenv.git ~/.pyenv

Now, we need to edit our ~/.bashrc file

# nano ~/.bashrc

and add these lines to it.

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"

Save the file and exit from the editor. To apply the changes, we can source the file.

# source ~/.bashrc

At this point, we can use pyenv. Run this command below to see the available Python versions to install.

# pyenv install -l

Let’s say we are going to install Python 3.10, we can execute this command:

# pyenv install 3.10

Wait until it finishes installing Python. Once completed, you can run this command to check the available version.

# pyenv versions
* system (set by /root/.pyenv/version)
3.10.14

As your screen shows, Python 3.10.14 has been installed but is not activated. The one listed there with an asterisk (*) is currently the active one. The asterisk indicates the currently active version and refers to the system-wide Python version.

To activate Python 3.10.14 globally, let’s run this command

# pyenv global 3.10.14

That’s it. Python 3.10.14 is active now. You can verify it by running the command

# python3 --version

It will return an output like this:

Python 3.10.14

Besides activating it globally, you can also use it locally. Use this command instead:

# pyenv local 3.10.14

You can also install a virtual environment when using pyenv. The command is similar to the one you usually use.

# python -m venv [VENV-NAME]

That’s it all. You have learned how to install Python on Debian 12.

Of course, you don’t have to install Python on Debian 12 yourself if you use one of our server management plans. This means that you can ask our admins to do the installation for you, sit back, and relax. Our admins will install and set up Python on Debian 12 immediately without any additional fee, along with any helpful configurations and optimizations we can do for you. Managing Python is not just about the installation, though. We can also help you optimize your Python installation if you have an active service with us.

If you liked this post on installing Python on Debian 12, please share it with your friends on social media or leave a comment below. Thanks.

The post How to Install Python on Debian 12 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-python-on-debian-12/feed/ 0
How to Install PHP 8 on Debian https://linuxhostsupport.com/blog/how-to-install-php-8-on-debian/ https://linuxhostsupport.com/blog/how-to-install-php-8-on-debian/#respond Tue, 30 Jan 2024 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=2026 Let’s follow this step-by-step guide on how to install PHP 8.0 on Debian 10. PHP is an open-source general-purpose scripting language, mostly used by web developers as it can easily be embedded into HTML. PHP version 8.0 was officially released on November 26, 2020, and it is the latest release of the PHP language. It […]

The post How to Install PHP 8 on Debian appeared first on LinuxHostSupport.

]]>
Let’s follow this step-by-step guide on how to install PHP 8.0 on Debian 10. PHP is an open-source general-purpose scripting language, mostly used by web developers as it can easily be embedded into HTML.

PHP version 8.0 was officially released on November 26, 2020, and it is the latest release of the PHP language. It is packed with lots of new improvements, features, and optimizations including named arguments, attributes, constructor property promotion, JIT (Just in Time Compiler), match expression, union types, null safe operator, better error handling, improvements in the type system, and better consistency.

Also, according to multiple tests, PHP 8.0 can handle much more requests per second compared to the older versions of PHP. If your PHP-based website or application is fully compatible with PHP 8.0 you should definitely consider upgrading to the latest version.

Prerequisites

  • A Linux VPS or server running Debian 10.
  • SSH access
  • System user with sudo or root privileges

Login and Update the server

In order to start with the installation of PHP 8.0 on our Debian 10 server, we have to access the server via SSH. We will log in as the root user, but you can use any system user which has sudo privileges:

ssh root@IP_Address -p Port_number

IP_Address and Port_number should be replaced with the actual IP address and SSH port number.

Once the SSH connection is established and you are in, in order to have the latest bug fixes, new features, and security fixes of all installed packages, it is always a good idea to update the installed packages on the server.

apt update && apt upgrade

Add third party APT repository

Debian 10 by default has PHP 7.3 in its repositories. To check what PHP version is available in the Debian repositories, run the following command:

apt-cache policy php

Output:

php:
Installed: 2:7.3+69
Candidate: 2:7.3+69
Version table:
*** 2:7.3+69 500
500 http://httpredir.debian.org/debian buster/main amd64 Packages
100 /var/lib/dpkg/status

Or if PHP is already installed on the VPS, check the installed version:

php -v

Output:

PHP 7.3.27-1~deb10u1 (cli) (built: Feb 13 2021 16:31:40) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.27, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.27-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies

From the output above we can see that we can only install PHP 7.3 from the official Debian repositories, so if need the latest PHP 8.0 version, we will have to add a third-party repository. But first, let’s install some necessary packages:

apt -y install apt-transport-https software-properties-common gnupg2

Once the packages are installed, download the GPG key and add it to your server to verify the necessary PHP packages

wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -

Create a Personal Package Archives (PPAs) file with the new PHP repository

echo "deb https://packages.sury.org/php/ buster main" | sudo tee /etc/apt/sources.list.d/php.list

And finally, update the repositories and install PHP 8.

apt update && apt install php8.0

Once all dependencies are installed, check the version of PHP installed on your Debian 10 server, to confirm that PHP 8 is successfully installed

php -v

Output:

PHP 8.0.9 (cli) (built: Jul 30 2021 13:09:07) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.9, Copyright (c) Zend Technologies
with Zend OPcache v8.0.9, Copyright (c), by Zend Technologies

Install PHP 8 extensions

In order to enable some extra features, functionalities, or libraries, PHP has lots of additional extensions. To check the list of all available extensions for PHP 8.0, execute the following command:

apt search php8.0-*

Output:

…
php8.0-maxminddb/buster 1.10.1-1+0~20210802.2+debian10~1.gbp162f0b amd64
Reader for the MaxMind DB file format for PHP

php8.0-maxminddb-dbgsym/buster 1.10.1-1+0~20210802.2+debian10~1.gbp162f0b amd64
debug symbols for php8.0-maxminddb

php8.0-mbstring/buster 8.0.9-1+0~20210730.22+debian10~1.gbp99e7e9 amd64
MBSTRING module for PHP

php8.0-mbstring-dbgsym/buster 8.0.9-1+0~20210730.22+debian10~1.gbp99e7e9 amd64
debug symbols for php8.0-mbstring

php8.0-mcrypt/buster 3:1.0.4-5+0~20210223.3+debian10~1.gbp68347e amd64
PHP bindings for the libmcrypt library
…

If for some reason you need to install the PHP mbstring extension for example, you can easily do it with the following command:

apt -y install php8.0-mbstring

That’s all. If you closely followed the tutorial, you have successfully installed PHP 8 on your Debian 10 VPS from a third-party repository. If you need more specific details about this major update of PHP, you can check their release notes or their documentation.

Of course, you don’t need to install PHP 8.0 on Debian 10 yourself if you use our Linux server management plans, in which case you can simply ask our team of expert Linux admins to install and set this up for you. They are available 24/7 and will take care of your request immediately.

If you liked this post on how to install PHP 8.0 on Debian 10, please share it with your friends on the social networks by using the share shortcuts, or simply leave a comment in the comments section. Thank you.

The post How to Install PHP 8 on Debian appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-php-8-on-debian/feed/ 0
How to Install Jellyfin Media Server on Debian 12 https://linuxhostsupport.com/blog/how-to-install-jellyfin-media-server-on-debian-12/ https://linuxhostsupport.com/blog/how-to-install-jellyfin-media-server-on-debian-12/#respond Fri, 15 Dec 2023 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1957 Jellyfin is a free and open-source media server solution that allows you to control and manage your streaming media. In this tutorial, we will show you how to install Jellyfin on Debian 12. Jellyfin is an alternative to the proprietary Emby and Plex, designed to provide media from a server to end-user devices through a […]

The post How to Install Jellyfin Media Server on Debian 12 appeared first on LinuxHostSupport.

]]>
Jellyfin is a free and open-source media server solution that allows you to control and manage your streaming media. In this tutorial, we will show you how to install Jellyfin on Debian 12.

Jellyfin is an alternative to the proprietary Emby and Plex, designed to provide media from a server to end-user devices through a number of client applications. Media content can be accessed through specialized Jellyfin applications, extensions designed for various streaming platforms, a web interface, or by means of DLNA uPnP streaming to a wide range of compatible devices. Let’s start with the installation.

Prerequisites

  • A Debian 12 server or VPS
  • SSH access with sudo privileges, or root access.

Step 1. Log in to your VPS and Update the System

First of all, we need to log in to our Debian 12 VPS through SSH:

ssh root@IP_Address -p Port_number

Replace “root” with a user that has sudo privileges or root if necessary. Additionally, replace “IP_Address” and “Port_Number” with your server’s respective IP address and SSH port number.

Next, let’s make sure that we’re on Debian 12. You can do that like this:

# lsb_release -a

The command should return an output similar to this:

No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

Step 2. Install Dependencies

Installing Jellyfin requires some packages. So, before starting, we will install the dependencies on our Debian 12 system. Let’s execute the command below to proceed.

# apt install gnupg curl apt-transport-https ca-certificates -y

Step 3. Add the Jellyfin Repository

There are two ways to install Jellyfin on Debian 12; we can install it using the repository or the deb package. In this tutorial, we are going to use the repository to install Jellyfin on Debian 12.

# curl -fsSL https://repo.Jellyfin.org/Jellyfin_team.gpg.key | gpg --dearmor -o /etc/apt/keyrings/Jellyfin.gpg

Then, we’ll create our Jellyfin source list.

# nano /etc/apt/sources.list.d/Jellyfin.sources

Insert the following into the file.

Types: deb
URIs: https://repo.Jellyfin.org/debian
Suites: bookworm
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/Jellyfin.gpg

Save the file then exit from the editor.

Next, we need to update the package index files on the system.

# apt update

Step 4. Install Jellyfin

After adding the Jellyfin repository and updating the package index files in the previous step, we should be able to install Jellyfin from its repository now. Simply execute this command below.

# apt install jellyfin -y

Once installed, Jellyfin should be up and running on a Debian 12, you can verify this by executing the command below.

# systemctl status Jellyfin

The command should return an output similar to this:

root@debian12:~# systemctl status jellyfin
● jellyfin.service - Jellyfin Media Server
     Loaded: loaded (/lib/systemd/system/jellyfin.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/Jellyfin.service.d
             └─jellyfin.service.conf
     Active: active (running) since Mon 2023-10-16 04:59:06 CDT; 2min 19s ago
   Main PID: 590854 (Jellyfin)
      Tasks: 15 (limit: 2306)
     Memory: 183.4M
        CPU: 28.848s
     CGroup: /system.slice/jellyfin.service
             └─590854 /usr/bin/Jellyfin --webdir=/usr/share/jellyfin/web --restartpath=/usr/lib/jellyfin/restart.sh --ffmpeg=/usr/lib/jellyfin-ff>

Oct 16 04:59:33 debian12.linuxhostsupport.net jellyfin[590854]: [04:59:33] [INF] ServerId: c580665228f148dc8e24e556ee48d263
Oct 16 04:59:34 debian12.linuxhostsupport.net jellyfin[590854]: [04:59:34] [INF] Executed all pre-startup entry points in 0:00:00.430609
Oct 16 04:59:34 debian12.linuxhostsupport.net jellyfin[590854]: [04:59:34] [INF] Core startup complete
Oct 16 04:59:34 debian12.linuxhostsupport.net jellyfin[590854]: [04:59:34] [INF] StartupTrigger fired for task: Update Plugins
Oct 16 04:59:34 debian12.linuxhostsupport.net jellyfin[590854]: [04:59:34] [INF] Queuing task PluginUpdateTask
Oct 16 04:59:34 debian12.linuxhostsupport.net jellyfin[590854]: [04:59:34] [INF] Executing Update Plugins
Oct 16 04:59:34 debian12.linuxhostsupport.net jellyfin[590854]: [04:59:34] [INF] Executed all post-startup entry points in 0:00:00.7256918
Oct 16 04:59:34 debian12.linuxhostsupport.net jellyfin[590854]: [04:59:34] [INF] Startup complete 0:00:25.7226079
Oct 16 04:59:36 debian12.linuxhostsupport.net jellyfin[590854]: [04:59:36] [INF] Update Plugins Completed after 0 minute(s) and 2 seconds
Oct 16 04:59:36 debian12.linuxhostsupport.net jellyfin[590854]: [04:59:36] [INF] ExecuteQueuedTasks

You should be able to access Jellyfin at http://YOUR_SERVER_IP_ADDRESS:8096

Step 5. Install and Configure Nginx

To access Jellyfin using your domain or subdomain, we need to install and configure a reverse proxy. In this step, we will install Nginx and create an Nginx server block for our Jellyfin website.

# apt install nginx

Once installed, we can create a new configuration file.

# nano /etc/nginx/sites-enabled/Jellyfin.yourdomain.com.conf

Insert the following into the file.

upstream jellyfin {
 server 127.0.0.1:8096;
}

server {
      listen 80;
      server_name jellyfin.yourdomain.com;

      access_log /var/log/nginx/jellyfin.access.log;
      error_log /var/log/nginx/jellyfin.error.log;

    resolver 127.0.0.1 valid=30;

    
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";


    location / {
        
        proxy_pass http://jellyfin;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_set_header X-Forwarded-Host $http_host;

        proxy_buffering off;
    }

    
    location = /web/ {
        
        proxy_pass http://jellyfin/web/index.html;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
    }

    location /socket {
        
        proxy_pass http://jellyfin/socket;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
    }
}

Do not forget to replace jellyfin.yourdomain.com with your actual domain or subdomain name which is already pointing to your server IP address. Then, save the file, exit, and restart Nginx.

# systemctl restart nginx

At this point, you should be able to access your Jellyfin website at http://jellyfin.yourdomain.com

Choose your language then click on the Next button.

In this step, we can create a new account. Fill in the blanks with your preferred values, then click Next to proceed.

In this step, you can create a media library or simply hit the Next button to skip it.

Here, you can choose your language then country, and click Next to continue.

Check the “Allow remote connections to this server” then click Next.

Click Finish, then you will be brought to the login page.

Log in using the credentials you created earlier to access the backend.

Once logged, in you can navigate to the dashboard and customize your Jellyfin installation.

Congratulations! You have successfully installed Jellyfin on Debian 12.

Of course, if you are one of our Managed Linux Support customers, you don’t have to install Jellyfin on Debian 12 yourself – simply ask our admins, sit back, and relax. Our support team will install Jellyfin on Debian 12 for you immediately without any additional fee, along with anything else you need.

If you liked this post about how to install Jellyfin on Debian 12, please share it with your friends on social networks using the share buttons, or simply leave a comment in the comments section. Thanks.

The post How to Install Jellyfin Media Server on Debian 12 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-jellyfin-media-server-on-debian-12/feed/ 0
How to Set Up an OpenVPN Server on Debian 11 https://linuxhostsupport.com/blog/how-to-set-up-an-openvpn-server-on-debian-11/ https://linuxhostsupport.com/blog/how-to-set-up-an-openvpn-server-on-debian-11/#respond Wed, 30 Aug 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1858 OpenVPN is a well-known VPN protocol that secures your connection when accessing the internet. It is a tool that lets you browse the internet world with some level of anonymity. OpenVPN is an open-source network protocol to facilitate a secure connection between two points in a network. In this tutorial, we will show you how […]

The post How to Set Up an OpenVPN Server on Debian 11 appeared first on LinuxHostSupport.

]]>
OpenVPN is a well-known VPN protocol that secures your connection when accessing the internet. It is a tool that lets you browse the internet world with some level of anonymity.

OpenVPN is an open-source network protocol to facilitate a secure connection between two points in a network. In this tutorial, we will show you how to install OpenVPN on the Debian 11 server.

Prerequisites

  • A Debian 11 VPS
  • SSH root access or a user with sudo privileges

Step 1. Log in to your server via SSH

First, you will need to log in to your Debian 11 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the system user with sudo privileges.

You can check whether you have the proper Debian 11 installed on your server with the following command:

# lsb_release -a

The command will show you an output like this.

No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

Then, run the following command to make sure that all installed packages on the server are updated to their latest available versions:

# apt update

Step 2. Install OpenVPN Server

OpenVPN server packages are available in the default Debian 11 repository. But, in this article, we will use a shell script we can download from github.com to install the OpenVPN server. The installation is fairly easy and straightforward. Let’s download the script and proceed with the OpenVPN Server installation.

# wget https://git.io/vpn -O openvpn-install.sh

The installation script has been downloaded and saved as openvpn-install.sh; let’s execute the file and proceed with the installation.

# bash openvpn-install.sh

After the executable is executed, you will be prompted for a few options. Select UDP as the protocol, port 1194, and choose your favorite DNS resolver and the VPN client name.

Welcome to this OpenVPN road warrior installer!

Which protocol should OpenVPN use?
1) UDP (recommended)
2) TCP
Protocol [1]: 1

What port should OpenVPN listen to?
Port [1194]:

Select a DNS server for the clients:
1) Current system resolvers
2) Google
3) 1.1.1.1
4) OpenDNS
5) Quad9
6) AdGuard
DNS server [1]: 3

Enter a name for the first client:
Name [client]: vpnclient

OpenVPN installation is ready to begin.
Press any key to continue…

At this point, we can press any keyboard key to start the installation. It will finish in a few seconds, depending on your network speed.

Once installed, the OpenVPN service will be automatically up and running. You will see a message about where the .ovpn file you can download.

Step 3. Connecto to OpenVPN Server

A VPN client is required to connect to our OpenVPN server. If you are using a Windows machine, you can use OpenVPN Client or Tunnelblick if you are using a MacOS device. For Linux desktops users, you can use the openvpn client file to import the network configuration file and then connect to your VPN server.

In this tutorial, we created ‘vpnclient’ as a VPN user, and the installation script generated the configuration file at /root/vpnclient.ovpn. We can download this file to connect to our OpenVPN server.

The client configuration is available in: /root/vpnclient.ovpn
New clients can be added by running this script again.

Download the file or print the file using the cat command, then create a .ovpn using the file’s content. Then, simply double-click on it to start using the VPN client.

Step 4. Create Additional OpenVPN Users

To create new VPN users, simply execute the installation script, and the script will ask you one of the options.

OpenVPN is already installed.

Select an option:
1) Add a new client
2) Revoke an existing client
3) Remove OpenVPN
4) Exit
Option:

Choose number 1, then ENTER. You will be asked for a client name. And it will show you an output like this.

* Using Easy-RSA configuration:
  /etc/openvpn/server/easy-rsa/pki/vars

* Using SSL: openssl OpenSSL 1.1.1n  15 Mar 2022

Generating a RSA private key
............................+++++
............+++++
writing new private key to '/etc/openvpn/server/easy-rsa/pki/5e4b9ee0/temp.1.1'
-----

Notice
------
Keypair and certificate request completed. Your files are:
* req: /etc/openvpn/server/easy-rsa/pki/reqs/rosehosting.req
* key: /etc/openvpn/server/easy-rsa/pki/private/rosehosting.key 

Using configuration from /etc/openvpn/server/easy-rsa/pki/5e4b9ee0/temp.4.1
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
commonName            :ASN.1 12:'rosehosting'
Certificate is to be certified until Jun 16 07:27:20 2033 GMT (3650 days)

Write out database with 1 new entries
Data Base Updated

Notice
------
Certificate created at:
* /etc/openvpn/server/easy-rsa/pki/issued/rosehosting.crt

Notice
------
Inline file created:
* /etc/openvpn/server/easy-rsa/pki/inline/rosehosting.inline


rosehosting added. Configuration available in: /root/rosehosting.ovpn

That’s it! You have successfully installed the OpenVPN server the easy way. You can now add more users and use the VPN network for your activity.

Check out a more complicated installation without a script.

Of course, you don’t have to install OpenVPN server on Debian 11 if you use one of our Debian Hosting services, in which case you can simply ask our admins, sit back, and relax. Our admins will install and set up OpenVPN on Debian 11 immediately without any additional fee, along with many useful optimizations we can do for you. Managing an OpenVPN server is not just about the installation; we can help you optimize your OpenVPN installation if you have a VPS with us.

PS. If you liked this post on how to set up an OpenVPN Server on Debian 11, please share it with your friends on social networks or simply leave a reply below. Thanks.

The post How to Set Up an OpenVPN Server on Debian 11 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-set-up-an-openvpn-server-on-debian-11/feed/ 0
How to Install Ntopng on Debian 11 https://linuxhostsupport.com/blog/how-to-install-ntopng-on-debian-11/ https://linuxhostsupport.com/blog/how-to-install-ntopng-on-debian-11/#comments Wed, 30 Mar 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1650 In this blog post, we are going to install Ntopng on Debian 11 OS and explain in step-by-step detail the installation process. Ntopng is a web-based application for tracking the network traffic on your server. It is free and open-source and supports different operating systems like Linux, Windows MacOS and etc. Ntopng is a very […]

The post How to Install Ntopng on Debian 11 appeared first on LinuxHostSupport.

]]>
In this blog post, we are going to install Ntopng on Debian 11 OS and explain in step-by-step detail the installation process.

Ntopng is a web-based application for tracking the network traffic on your server. It is free and open-source and supports different operating systems like Linux, Windows MacOS and etc. Ntopng is a very useful monitoring tool that shows, multiple graphs in the GUI such as network usage, analytical data, bandwidth utilization, apps and etc. Also, Ntopng analyzes the traffic and sorts it by source/destination.

Installing Ntopng on Debian 11, is a very easy and straightforward process in just a few steps. Let’s get to work!

Prerequisites

  • A server with Debian 11 as OS
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

We need to update the packages to their latest versions available before we start with the installation. Execute the following commands to update the system.

sudo apt update -y && sudo apt upgrade -y

Step 2. Add Ntopng Repository

By default Debian 11, does not contain the repository for Ntopng, so we need to add it manually. To add the repository execute the commands below:

cd /opt

wget http://apt.ntop.org/buster/all/apt-ntop.deb

dpkg -i apt-ntop.deb

Step 3. Install Ntopng

Once, the package is added update the system again.

sudo apt update -y

After updating the system, we are ready to execute the command for installing Ntopng.

sudo apt install ntopng

Once, the Ntopng monitoring tool is installed, start and enable the service for automatic boot on system reboot.

sudo systemctl start ntopng && sudo systemctl enable ntopng

Check the status of the Ntopng service with the following command:

sudo systemctl status ntopng

You should receive the following output:

root@vps:/opt# sudo systemctl status ntopng
● ntopng.service - ntopng high-speed web-based traffic monitoring and analysis tool
     Loaded: loaded (/etc/systemd/system/ntopng.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-02-14 17:27:07 EST; 6min ago
   Main PID: 27734 (2/flow_checks)
      Tasks: 35 (limit: 4678)
     Memory: 205.4M
        CPU: 55.493s
     CGroup: /system.slice/ntopng.service
             └─27734 /usr/bin/ntopng /run/ntopng.conf

Feb 14 17:27:23 ntopng.vps ntopng[27734]: 14/Feb/2022 17:27:23 [startup.lua:120] [lists_utils.lua:421] Updating list 'Abuse.ch URLhaus' [https://urlhaus.abuse.ch>
Feb 14 17:27:23 ntopng.vps ntopng[27734]: 14/Feb/2022 17:27:23 [startup.lua:120] [lists_utils.lua:421] Updating list 'Emerging Threats' [https://rules.emergingth>
Feb 14 17:27:23 ntopng.vps ntopng[27734]: 14/Feb/2022 17:27:23 [startup.lua:120] [lists_utils.lua:421] Updating list 'Feodo Tracker Botnet C2 IP Blocklist' [http>
Feb 14 17:27:23 ntopng.vps ntopng[27734]: 14/Feb/2022 17:27:23 [startup.lua:120] [lists_utils.lua:421] Updating list 'NoCoin Filter List' [https://raw.githubuser>
Feb 14 17:27:23 ntopng.vps ntopng[27734]: 14/Feb/2022 17:27:23 [startup.lua:120] [lists_utils.lua:421] Updating list 'SSLBL Botnet C2 IP Blacklist' [https://sslb>
Feb 14 17:27:24 ntopng.vps ntopng[27734]: 14/Feb/2022 17:27:24 [startup.lua:120] [lists_utils.lua:718] Category Lists (1711 hosts, 2117 IPs, 0 JA3) loaded in 1 s>
Feb 14 17:27:25 ntopng.vps ntopng[27734]: 14/Feb/2022 17:27:25 [startup.lua:202] Completed startup.lua
Feb 14 17:27:25 ntopng.vps ntopng[27734]: 14/Feb/2022 17:27:25 [PeriodicActivities.cpp:167] Found 10 activities
Feb 14 17:27:25 ntopng.vps ntopng[27734]: 14/Feb/2022 17:27:25 [NetworkInterface.cpp:3195] Started packet polling on interface lo [id: 1]...
Feb 14 17:27:25 ntopng.vps ntopng[27734]: 14/Feb/2022 17:27:25 [NetworkInterface.cpp:3195] Started packet polling on interface eth0 [id: 2]...

Step 4. Configure Ntopng

Before we access Ntopng we need to configure it. Open the Ntopng configuration file /etc/ntopng/ntopng.conf

sudo nano /etc/ntopng/ntopng.conf

Paste the following lines of code:

##Define the network interface for network monitoring.
##Define the HTTP port for the web server.
-w=5000

Save the file, and close it. Create new ntopng.start file to define the network.

sudo nano /etc/ntopng/ntopng.start

Paste the following lines of code:

--local-networks "YourLocalIPaddressHere/24"  ## give your local IP Ranges here.
--interface 1

Save the newly created file and restart the Ntopng service.

sudo systemctl restart ntopng

You can check the service if is running on port with the following command:

netstat -tunlp | grep 5000

You should receive the following output:

root@vps:~# netstat -tunlp | grep 5000
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN      37148/ntopng

Step 5. Access the Ntopng

To access the Ntopng GUI visit the URL http://YourIpAddress:5000. You will see the screen as described below:

On a fresh installation the default username and password is admin. Once, you enter admin as username and password hit on the “Login” button.

On the next screen you will have to change the default password with a strong one for better security.

Enter the strong password twice and click on the “Change Password” button.

After this, you will be automatically logged in to the Ntopng GUI with the changed password.

Congratulations! You successfully installed and configured Ntopng on Debian 11.

Of course, you don’t have to install Ntopng on Debian 11, if you use one of our SSD VPS Hosting plans, in which case you can simply ask our expert Linux admins to install Ntopng on Debian 11 for you. They are available 24×7 and will take care of your request immediately.

If you liked this post on how to install Ntopng on Debian 11, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

The post How to Install Ntopng on Debian 11 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-ntopng-on-debian-11/feed/ 1
How to Set Up Nginx as a Reverse Proxy For Apache on Debian 11 https://linuxhostsupport.com/blog/how-to-set-up-nginx-as-a-reverse-proxy-for-apache-on-debian-11/ https://linuxhostsupport.com/blog/how-to-set-up-nginx-as-a-reverse-proxy-for-apache-on-debian-11/#respond Sat, 15 Jan 2022 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1622 Nginx and Apache are both free, open-source, and considered some of the most popular web servers around the world.If we combine both servers, then we will get a better result for our services. Nginx is generally faster than Apache and Apache is well-known for its powerful features. In today’s tutorial, you will learn how to […]

The post How to Set Up Nginx as a Reverse Proxy For Apache on Debian 11 appeared first on LinuxHostSupport.

]]>
Nginx and Apache are both free, open-source, and considered some of the most popular web servers around the world.
If we combine both servers, then we will get a better result for our services. Nginx is generally faster than Apache and Apache is well-known for its powerful features.

setting up nginx as a reverse proxy for apache on debian 11

In today’s tutorial, you will learn how to set up Nginx as a reverse proxy for Apache, using Debian 11 OS. Make sure to follow the official documentation, if any issues arise in the meantime.

Prerequisites

  • Server running Debian 11
  • Root access to the server

Updating system and installing dependencies

Before starting, it’s hugely important to have your system up-to-date. So, you can run the following commands on your server to update it:

 apt-get update -y; apt-get upgrade -y 

After the system is updated, you need to install the dependencies:
apt-get install gnupg2 curl -y

Installing and configuring Apache

In this part, we’ll proceed with the Apache installation and configuration to run on port 8000. First of all, you need to install it with this command:
apt-get install apache2 -y

Once it’s installed, you need to edit the port from 80 to 8000 on the following files:
nano /etc/apache2/ports.conf
From: Listen 80
To: Listen 8000

nano /etc/apache2/sites-enabled/000-default.conf
From:
80
To:
8000

Now, we’ll restart apache to apply the changes:

systemctl restart apache2

And once it’s restarted, you should see the default page on the following link:
http://your-ip:8000

Installing and configuring Nginx.

Now, since we already have our Apache up and running on port 8000, we need to set up our Nginx as the reverse proxy to run on port 80 and proxy the traffic to port 8000. First of all, let’s install Nginx with:
apt-get install nginx -y

Then, once the installation is done, we need to empty the default vhost, so you can run this command:
echo "" > /etc/nginx/sites-enabled/default

After that, just open it and paste this content to redirect the accesses from port 80 (Nginx)
to 8000 (Apache2):

server {
    listen 80 default_server;
    index index.php index.html index.htm;
    location / {
        proxy_pass http://localhost:8000;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Then just save the file and check the Nginx for any syntax error with this command:
nginx -t

Next, just reload the Nginx service to apply our changes:
systemctl restart nginx

Now, once you access your IP address, you’ll be accessing your Nginx and being proxied to the Apache2 service.

And that’s it. You have successfully installed Nginx as a Reverse Proxy for Apache on Debian 11. Of course, if you have any Linux VPS hosting with us, you don’t need to do this installation. Our admins are available 24/7/365 to help you with those steps.

installing nginx as a reverse proxy for apache on debian 11

You will gain all the free benefits of fully managed hosting, including premium customer support, free and unlimited site migration, 99.99% uptime guaranteed, and many other features for your increased satisfaction.

The post How to Set Up Nginx as a Reverse Proxy For Apache on Debian 11 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-set-up-nginx-as-a-reverse-proxy-for-apache-on-debian-11/feed/ 0
How to Install GitLab on Debian 11 https://linuxhostsupport.com/blog/how-to-install-gitlab-on-debian-11/ https://linuxhostsupport.com/blog/how-to-install-gitlab-on-debian-11/#comments Thu, 30 Dec 2021 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1609 GitLab is a self-hosted git repository management system. It is a Git repository manager providing wiki, issue-tracking, and continuous integration and deployment. Because of the advantage that brings development, operations, and security teams into a single application, GitLab is now widely used across the globe. Installing GitLab on Debian 11 is a fairly easy task […]

The post How to Install GitLab on Debian 11 appeared first on LinuxHostSupport.

]]>
GitLab is a self-hosted git repository management system. It is a Git repository manager providing wiki, issue-tracking, and continuous integration and deployment. Because of the advantage that brings development, operations, and security teams into a single application, GitLab is now widely used across the globe. Installing GitLab on Debian 11 is a fairly easy task and it should take around 15 minutes for the installation. Today we will show you how to install GitLab on your Debian 11 VPS.

Prerequisites

  • A Debian 11 VPS.
  • At least 4GB of RAM.
  • SSH access with sudo privileges, or root access.

In addition, it is recommended to have at least 2GB of SWAP memory, even if you have enough available RAM.

Step 1. Update System

First of all, we need to log in to our Debian 11 VPS through SSH:

ssh master@IP_Address -p Port_Number

Replace “master” with a user that has sudo privileges or root if necessary. Additionally, replace “IP_Address” and “Port_Number” with your server’s respective IP address and SSH port number. Next, let’s make sure that we’re on Debian 11. You can do that like this:

$ lsb_release -a

You should get this as the output:

Distributor ID: Debian
Description: Debian GNU/Linux 11 (bulleseye)
Release: 11
Codename: bullseye

Then, run the following command to make sure that all installed packages on the server are updated to their latest available versions:

$ sudo apt update && apt upgrade

Step 2. Add Repository

There are two ways to install GitLab on Debian 11; we can install it using the repository or the deb package. In this tutorial, we are going to use the repository to install GitLab on Debian 11.

At this step, we will use the repository for Debian 10, because the repository for Debian 11 is not available at this time of writing.

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

The command above will download the GitLab repository to the APT source list file at /etc/apt/sources.list.d/gitlab_gitlab-ce.list
Since the GitLab package source file is for Debian 10, we need to modify these lines.

deb https://packages.gitlab.com/gitlab/gitlab-ce/debian/ bullseye main
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/debian/ bullseye main

Replace ‘bullseye’ with ‘buster’ by running this command.

$ sudo sed -i 's/bullseye/buster/g' /etc/apt/sources.list.d/gitlab_gitlab-ce.list

Now, we need to update the repository.

$ sudo apt update -y

Step 3. Install GitLab

After adding the repository, we can install GitLab Community Edition by running this command:

$ sudo apt install gitlab-ce -y
installing gitlab on debian 11

Once the installation is finished, we can run this command to reconfigure it and run GitLab

$ sudo gitlab-ctl reconfigure

At this point, you should be able to access GitLab at http://YOUR_SERVER_IP_ADDRESS/ and log in as root using the password in /etc/gitlab/initial_root_password

Please note that the password in /etc/gitlab/initial_root_password is valid only for 24 hours. You can log in and change your password immediately or reset it using this command below

$ sudo gitlab-rake "gitlab:password:reset[root]"

Step 4. Configure GitLab

GitLab has been successfully installed, and it is time to configure it.

Secure GitLab Server with Let’s Encrypt SSL Certificate

By default, when installing GitLab without passing an environment for the EXTERNAL_URL value. The installation will set http://gitlab.example.com as the external URL. If we want to access our GitLab installation through a domain or subdomain name and install an SSL certificate for it, we can edit the configuration file /etc/gitlab/gitlab.rb

Open /etc/gitlab/gitlab.rb and find external_url line

external_url 'http://gitlab.example.com'

Replace it with

external_url 'https://gitlab.yourdomain.com'

Make sure that your domain or subdomain DNS record is pointing to your GitLab server.

Then, still in the same file, make sure these are uncommented and modified as follows.

letsencrypt['enable'] = true
letsencrypt['contact_emails'] = ['you@yourdomain.com'] 
letsencrypt['auto_renew'] = true

Save the file then exit.

Now, we need to reconfigure Omnibus GitLab, and we need to do this every time we edit /etc/gitlab/gitlab.rb file.

$ sudo gitlab-ctl reconfigure

Run the command above and wait, once completed you the SSL certificate from Let’s Encrypt should be installed and you should be able to access your GitLab at https://YOUR_DOMAIN_NAME.COM

Email Configuration

By default, GitLab should be able to send its email using sendmail. However, for better email deliverability, you should consider using an SMTP server for this purpose. With the SMTP credentials, we can configure GitLab to use SMTP to send its email.

Open /etc/gitlab/gitlab.rb

$ sudo nano /etc/gitlab/gitlab.rb

Then, find the following

# gitlab_rails['smtp_enable'] = true
# gitlab_rails['smtp_address'] = "smtp.server"
# gitlab_rails['smtp_port'] = 465
# gitlab_rails['smtp_user_name'] = "smtp user"
# gitlab_rails['smtp_password'] = "smtp password"
# gitlab_rails['smtp_domain'] = "example.com"
# gitlab_rails['smtp_authentication'] = "login"
# gitlab_rails['smtp_enable_starttls_auto'] = true
# gitlab_rails['smtp_tls'] = true
# gitlab_rails['smtp_pool'] = false
# gitlab_rails['smtp_openssl_verify_mode'] = 'none'
# gitlab_rails['smtp_ca_path'] = "/etc/ssl/certs"
# gitlab_rails['smtp_ca_file'] = "/etc/ssl/certs/ca-certificates.crt"

You need to uncomment the lines and use your SMTP credentials to make it work. Also, make sure that your SMTP password does not contain any string delimiters used in a YAML file, otherwise, it will not work. Save your changes then exit the file.

As mentioned earlier, we need to reconfigure Omnibus GitLab after editing the gitlab.rb file.

$ sudo gitlab-ctl reconfigure

And that’s it. From now on, GitLab will send emails through SMTP which will result in better email deliverability if compared to using sendmail. You can log in to your GitLab website at https://yourdomain.com and start using it.

configuring gitlab on debian 11

Congratulations! You have successfully installed GitLab on Debian 11.

Of course, if you are one of our Debian Hosting customers, you don’t have to install GitLab on Debian 11 yourself – simply ask our admins, sit back, and relax. Our admins will install GitLab on Debian 11 for you immediately without any additional fee, along with many useful optimizations that we can do for you. Managing a GitLab website is not just about the installation, we can help you with optimizing your GitLab installation if you have a VPS with us.

PS. If you liked this post about how to install GitLab on Debian 11, please share it with your friends on the social networks using the share buttons below, or simply leave a comment in the comments section. Thanks.

The post How to Install GitLab on Debian 11 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-gitlab-on-debian-11/feed/ 3
How to Install Apache Tomcat 10 on Debian 10 https://linuxhostsupport.com/blog/how-to-install-apache-tomcat-10-on-debian-10/ https://linuxhostsupport.com/blog/how-to-install-apache-tomcat-10-on-debian-10/#respond Thu, 30 Sep 2021 17:30:33 +0000 https://linuxhostsupport.com/blog/?p=1532 If you ever wondered how to install Apache Tomcat 10, and how to configure it on Debian 10 then you are at the right place. In this tutorial, we are going to cover every step needed to install the latest version on Tomcat 10 with all requirements Apache Tomcat 10 or simply Tomcat 10 is […]

The post How to Install Apache Tomcat 10 on Debian 10 appeared first on LinuxHostSupport.

]]>
Install Apache Tomcat 10 on Debian 10If you ever wondered how to install Apache Tomcat 10, and how to configure it on Debian 10 then you are at the right place. In this tutorial, we are going to cover every step needed to install the latest version on Tomcat 10 with all requirements

Apache Tomcat 10 or simply Tomcat 10 is a Java application server used to render the Java web pages. It is an open-source software developed by the Apache Software Foundation responsible to execute Java servlets and render the Java web pages as mentioned above.

Apache Tomcat 10 is compatible with multiple distributions of Linux as Ubuntu, CentOS, and Debian. Installing Tomcat 10 on Debian is very easy and will take less than 15 minutes with all requirements and configuration files.

Let’s start with the installation on Debian 10!

 

Prerequisites

  • Fresh install of Debian 10
  • User privileges: root or non-root user with sudo privileges
  • Java 8 or higher version.
  • VPS with at least 1GB of RAM

Check the distribution of your OS on your server before the installation.

lsb_release -a

The out should be similar to this:

root@vps:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster

1. Updating the System

Execute the commands below to get the latest changes on your Debian 10 OS.

sudo apt update -y && sudo apt upgrade -y

2. Install Java

Apache Tomcat is based on Java, and that is why we need to install it first on the VPS:

sudo apt install default-jdk -y

Check the installed version with the following command:

java --version

The output should be similar to this:

root@vps:~# java --version
openjdk 11.0.12 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2deb10u1, mixed mode, sharing)

3. Tomcat User Creation

In order for Apache Tomcat to run propely we need to create user:

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

4. Downloading and installing Tomcat 10

First, go in /opt directory on your server (cd /opt) and then download the Tomcat within. Tomcat 10 can be downloaded from the official Apache website with the command below:

wget https://downloads.apache.org/tomcat/tomcat-10/v10.0.10/bin/apache-tomcat-10.0.10.tar.gz

The next, step is to extract the archived file into a directory.

tar -xzvf apache-tomcat-10.0.10.tar.gz -C /opt/tomcat --strip-components=1

Once, the extraction is completed, set the right “tomcat” permissions recursively on the tomcat directory:

chown -R tomcat:tomcat /opt/tomcat/

Also, set the execute permissions on scripts in the bin directory of the tomcat installation:

chmod -R u+x /opt/tomcat/bin

5. Systemd Unit File for Tomcat

In the bin directory of Tomcat at /opt/tomcat/bin there are shell scripts for starting and stopping Tomcat. It is not recommended to start and stop Tomcat manually via these scripts thus it is recommended via system unit files. This way Tomcat will be able to start after system boot. Create a systemd file and paste the following lines into it:

nano /etc/systemd/system/tomcat.service
[Unit]
Description="Tomcat Service"
After=network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment="JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64"
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom"
Environment="CATALINA_BASE=/opt/tomcat"
Environment="CATALINA_HOME=/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

Save the file, close it and start the service.

systemctl start tomcat
systemctl enable tomcat

To check if the service is up and running execute the command:

systemctl status tomcat

The output will be similar to this:

root@vps:~# systemctl status tomcat
● tomcat.service - "Tomcat Service"
Loaded: loaded (/etc/systemd/system/tomcat.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2021-08-12 03:54:54 EDT; 4min 27s ago
Process: 17708 ExecStart=/opt/tomcat/bin/startup.sh (code=exited, status=0/SUCCESS)
Main PID: 17715 (java)
Tasks: 32 (limit: 4700)
Memory: 236.0M
CGroup: /system.slice/tomcat.service
└─17715 /usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Djava.util.logging.manager=org.a

Now you can open the Tomcat GUI in your web browser via your server IP address and port 8080:

http://YOUR_IP_ADDRESS:8080

6. Configuration of Tomcat

Tomcat Manager is a place when you can easily deploy, list, and manage your applications. It has a nice GUI and is very intuitive to use. Later, you will need access to Tomcat Manager and in this step, we are going to enable it. Open the file:

nano /opt/tomcat/conf/tomcat-users.xml

And, add the following lines at the bottom before the line “”:

<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="admin" password="YourStrongPasswordHere" roles="manager-gui,admin-gui"/>

Save the file and close it. Now we need to allow access to Tomcat for WebApp and Host Managers:

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

Comment out the following lines

<!-- 
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> 
-->
nano /opt/tomcat/webapps/host-manager/META-INF/context.xml
<!-- 
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> 
-->

Save the files close it and restart the tomcat service:

systemctl restart tomcat

Install Apache Tomcat 10 on Debian 10Now, refresh the tomcat page and you will be able to access the Manager App at http://162.246.248.185:8080/manager/html with the username and password set above. Congratulations! You successfully installed and configured Tomcat 10 on Debian 10. Now you can easily deploy Java applications and make them run in no time. Of course, if you find some difficulties while installing the app you do not have to install it by yourself. You can always contact our system admins and with their expertise, they will install Tomcat 10 for you. All you need to do is order an SSD VPS plan and contact our support. We are available 24/7.

PS. If you liked this post, on how to install Apache Tomcat 10 on Debian 10, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

The post How to Install Apache Tomcat 10 on Debian 10 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-apache-tomcat-10-on-debian-10/feed/ 0