Guides | LinuxHostSupport https://linuxhostsupport.com/blog/category/guides/ Linux Tutorials and Guides Mon, 29 Apr 2024 07:55:47 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 The Best Self-Hosted Email Clients in 2024 https://linuxhostsupport.com/blog/the-best-self-hosted-email-clients-in-2024/ https://linuxhostsupport.com/blog/the-best-self-hosted-email-clients-in-2024/#respond Thu, 29 Feb 2024 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=2034 An email client is an application which provides you an ability to manage your email accounts. With an email client, we can send and receive emails. Self-hosted email clients (or webmail) give you added convenience compared to a local client installed on your computer. With so many different options to choose from, how do you […]

The post The Best Self-Hosted Email Clients in 2024 appeared first on LinuxHostSupport.

]]>
An email client is an application which provides you an ability to manage your email accounts. With an email client, we can send and receive emails. Self-hosted email clients (or webmail) give you added convenience compared to a local client installed on your computer.

With so many different options to choose from, how do you know which self-hosted email client is best? That’s where this guide comes in. Let’s go over the best self-hosted email clients. We’ll also tell you the benefits of using a self-hosted email client.

A Self-Hosted email client, also known as a webmail client, is simpler compared to other traditional mail clients. With webmail, you don’t need to do any configuration at all on your side. You can simply access your emails as long as you remember your email address and its password.

Also, with webmail, you can access your emails from any devices through any web browser. The data is stored in the server, so it never takes up space on your computer. The disadvantage is that you cannot access both old and new emails when you are disconnected from the internet.

That’s why we recommend using a self-hosted email client whenever possible, and only download emails that are important for you to have access to while offline.

With that said, let’s see what self-hosted email clients are available and which is best for your needs.

Roundcube

Roundcube is a modern webmail client that can be easily installed on any server. Its first stable version was released in 2014. Roundcube features a drag-and-drop interface that generally feels modern and fast, together with a slew of features, including these:

  • Canned responses for easy replying
  • Spell Check – no more typos
  • Localization in over 80 languages
  • Custom email templates to save you time
  • Address book integration
  • Lots more!

On top of all of this, Roundcube has extension support, along with a pluggable API for creating extensions. Some extensions that are currently available include two-factor authentication, a calendar integration, and even multiple accounts on one server.

RainLoop

The unique thing about RainLoop is that it does not require a database to run. This makes setup pretty straightforward. It’s a free and open-source application based on PHP. RainLoop also has a modern user interface which lets it handle a large number of email accounts.

Another upside is that RainLoop comes with built-in 2 factor authentication, along with social media authentication. That makes signing in both convenient and secure.

Rainloop also supports both SMTP and IMAP protocols to easily send/receive emails without any trouble. There are even more features included, like email address autocompletion, filtering, drag and drop, and so on. You can add these features with additional plugins.

Rainloop is also easy to install, you can try their online demo at https://mail.rainloop.net/ and check whether it attracts you or not.

SnappyMail

This is a fork of RainLoop, with its main focus being compatibility and performance. They tout supporting the newest browsers as well as tiny file sizes. This lets you check your email easily even on slow, unreliable connections. With added features such as dark mode, support for CSS plugins, a fully responsive design, and much better support of the IMAP RFC standard, this is a great option if you do not need some of the unique features offered by RainLoop.

Zimbra

Zimbra provides both an email server and webmail. If you want to install a mail server and webmail at the same time, Zimbra is a great choice. Zimbra is a fully featured collaboration suite that supports email, group calendars, and document sharing using an Ajax web interface. This interface enables tool tips, drag-and-drop items, and right-click menus in the UI. Also included are advanced searching capabilities and data relations, online document authoring, “Zimlet” mashups, and a full administration UI.

This is a pretty advanced platform that offers a lot more than just webmail, so it’s a great option for those that are running a business and need collaboration tools for their employees.

Squirrelmail

Squirrelmail is a PHP based webmail application, it is available for any platform supporting PHP and its initial release was in 1999. Squirrelmail is a complete webmail client, but the features are available as plugins. The default installation will include several plugins, and you can download the third-party plugins form Squirrelmail official website. It is the simplest and most lightweight webmail client, all while keeping it easy to install.

Horde

Horde webmail is a free, enterprise ready, browser-based communication suite. Users can read, send and organize email messages. You can also manage and share calendars, contacts, tasks, notes, files, and bookmarks with the standards-compliant components from the Horde Project.

Horde offers email filtering, account management, mail forwarding, password change, and on vacation message. Horde has been around since 2004, so it has some experience under its belt. The software has been packaged for all major Linux distributions and is available as a component in hosting control panels such as Plesk or cPanel.

Which Should You Use?

With so many choices that each offer a pretty solid set of features, it’s difficult to know which will work best for you. We can give you some quick recommendations, however. If you need a quick and optimized solution that you know will work with your latest browsers, we recommend going with SnappyMail.

If you need a tried and tested solution that has a large community behind it, we’d recommend that you use Roundcube. It has all the features you’d need and is continuously updated over the years.

We honestly recommend that you try and see some screenshots of each software or install the ones you like the most to try them out. They are all free to try out, so we recommend you see each of them for yourself.

That’s it – you now have the information you need about the most popular and most used mail clients. There are many alternatives to the mentioned applications, and they have their own advantages and disadvantages.

If you are having trouble knowing how to set any of these self-hosted email clients up, that’s no problem. We’re here to help. Just use our monthly server management service and we’ll set everything up for you.

If you liked this post about which Self-Hosted Email Client is best, please share it with your friends on the social networks using the buttons below or simply leave a comment in the comments section. Thanks.

The post The Best Self-Hosted Email Clients in 2024 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/the-best-self-hosted-email-clients-in-2024/feed/ 0
What to Consider When Choosing a Hosting Provider https://linuxhostsupport.com/blog/what-to-consider-when-choosing-a-hosting-provider/ https://linuxhostsupport.com/blog/what-to-consider-when-choosing-a-hosting-provider/#respond Mon, 15 Jan 2024 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=2015 All of us know that every business needs a website to help succeed. A large percentage of the population depends upon the Internet for their buying needs, or if nothing else to gather information. These two use cases alone essentially require you to set up a website of some kind. But where do you start […]

The post What to Consider When Choosing a Hosting Provider appeared first on LinuxHostSupport.

]]>
All of us know that every business needs a website to help succeed. A large percentage of the population depends upon the Internet for their buying needs, or if nothing else to gather information.

These two use cases alone essentially require you to set up a website of some kind. But where do you start with your hosting? That’s where we show you what you’ll need.

So, now that you have decided to launch your business website, there are a few things that you need to pay special attention to. One of them is the hosting company/provider that you choose. There are hundreds of hosts out there with each one claiming to provide you with the best hosting services.

Obviously, that’s not possible. You’ll need to do some research before you choose the residence for your business. And if you thought you needed a helping hand, we are here to your rescue.

Here is what to consider when choosing a hosting provider, in order of importance.

Area of Specialization

Every business and website has its own set of requirements. While you may find hundreds of web hosts in the market, not everyone can provide you what you are looking for. To know what exactly you can expect from the server host, you need to understand what your business needs in the first place.

Knowing your business needs will let you choose the most appropriate service provider. Every server host will have its own area of specialization. This is their strengths, and weaknesses.

Some hosts offer good services for growing businesses but not very appealing shared plans, while others have a wonderful enterprise solution which won’t be suited for small-time bloggers.

Therefore, look at your own needs first and decide on how big of a site you’ll need, as well as the complexity of it. That’s where you can start to reduce your list of potential hosting providers.

Price

Price is one of the next factors that needs to be considered while choosing your host. Having a budget is a great thing, but do not make it a deciding factor or don’t be rigid while hunting for a good host. The cheapest hosting usually only has one thing going for it – the price.

Keep the quality of service in mind and then decide what works best for you. A skilled workforce, stable network connection, and state-of-the-art hardware doesn’t come cheap. Do not fall for cheap plans as they likely will not have any of these features.

Our advice is to go for the most expensive hosting that is within reason for your business. Odds are it will have better hardware and some decent support.

Hardware

The hardware used by the server host plays a huge role in your website’s feel and speed. You may have to read up a little to have an idea about the best machines. That time spent researching will pay off as the quality of the hardware will affect your server and your site performance too.

I’m sure you’ll agree that it’s a bad idea to pay for a server that is already several years old. Don’t be afraid to ask the hosting provider the generation of CPU, storage, and RAM they use. The newer, the better.

It is wise to be aware of the equipment used by the hosting company as several new and small providers install used machines. These cannot be trusted to deliver top-notch hosting services.

Tech Support

What if your website goes down and your host doesn’t show up to help? This is the greatest nightmare any business owner or manager can have. That’s why you have to assess the tech support system of the hosting company.

Think about it – how often will you know where to look for the solution to your website’s problems? Are you a technical-natured person? If your answers point to you not being able to solve the problems by yourself, you have to go with a Managed Hosting provider.

Managed servers cost more compared to an unmanaged hosting service. But consider the fact that you are paying for the support team to be available at all times.

If you have to save costs anywhere you can, and if you can take care of your server completely and are confident in your skills, then unmanaged or self-managed is your next best choice.

Also, check for the different ways they are available for contact in case of server downtime. Are they available on email, call, chat, etc.? Do they provide a 24/7 service in case of server failure? These questions are ones that need answers before you make any decisions.

Migrations

Do you have an existing website that you’d want to move over to something better? Maybe you’re looking to continue development of your site, or to expand.

Check what kind of migrations the hosting service provides. Do they migrate websites only, or data and emails as well? How many websites can be migrated for free, if any?

We recommend going for a provider that has free migrations as a bare minimum. You are paying to host your services there – the least they can do is make your migration more bearable.

Security

Rapid digitalization has also led to a drastic increase in cybercrimes. You may not find it a very important factor to consider while choosing a server host, but in reality, it does play a significant role.

Modern server hosts know the importance of website security. That’s why they might incorporate firewall rules and network monitoring processes to ensure that your website is protected from malware attacks.

With unmanaged hosting providers however, you’re likely on your own here. It is wise to choose a host that provides user access control and carries out anti-virus or anti-malware checks regularly.

Reliability & Uptime Guarantee

Choosing a host where their servers are down frequently will land you in a big mess. Before selecting a hosting company, find out whether the server operates 24/7 to host your website.

What’s their uptime percentage? If it’s less than 99.99%, stay away – you don’t want your website to be down for hours each month.

Nobody wants to have a site that is down. It leads to loss of business and ultimately a loss of revenue.

Your hosting company should have a powerful server to operate on that is equipped with excellent hardware and a good network connection. Also, redundant hardware is a MUST. Redundant hardware ensures each aspect of their hardware has a backup ready to go at any moment.

Trial Period or Refund Policy

Most of the well-reputed hosting services providers provide the clients with a refund policy or a trial period. During this period, you can try their hosting services and decide if you want to continue with the provider.

The trial period is usually very cheap or free, and only if you decide to continue will you need to pay full price (or a discount if that’s what the provider offered).

Also, consider the duration of the trial period. Choose a host that provides a refund for a period of at least 7 days. That will give you sufficient time to try the service and make a call on whether they’re any good.

Growth

Growth is one of the most important considerations when choosing a web host. Look for a host that can support your company’s growth by scaling your server and site when needed. Assess whether or not the server host fits into your plans for the future.

The process of transferring from one host to another is time-consuming and complex. So, choosing a host that can accommodate all your growth needs is the best option.

Final Word

To sum up, we would like to mention that to choose a good server host, you need to do some thorough groundwork. Shortlist a few service providers and then assess them against the important factors that differ between them.

Take your time and weigh all the available options deeply. By making a decision carefully and with all factors kept in mind, you will be saved from the hassle of getting trapped with the wrong service provider and the need to move from one to another.

We hope that this post will give you a fair idea about the important factors in choosing a hosting service provider.

No matter what provider you end up choosing though, we’re here to make things work great for you. Our Linux Server Support services are the best in the industry. We can help you with almost any server issue as long as you can provide us with SSH access.

The post What to Consider When Choosing a Hosting Provider appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/what-to-consider-when-choosing-a-hosting-provider/feed/ 0
How to Install Tar.gz on AlmaLinux 9 https://linuxhostsupport.com/blog/how-to-install-tar-gz-on-almalinux-9/ https://linuxhostsupport.com/blog/how-to-install-tar-gz-on-almalinux-9/#respond Sat, 15 Jul 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1838 If you are asking what is Tar.gz, then the tar file is an archive that contains files and folders into it, while the gz stands for the compressed file format. If you combine these two, you will get a compressed archive. The compressed archives are used on a daily basis by the system administrators, developers, […]

The post How to Install Tar.gz on AlmaLinux 9 appeared first on LinuxHostSupport.

]]>
If you are asking what is Tar.gz, then the tar file is an archive that contains files and folders into it, while the gz stands for the compressed file format. If you combine these two, you will get a compressed archive.

The compressed archives are used on a daily basis by the system administrators, developers, and regular Linux users. Compressing multiple files in one archive can simplify the process of sending that compressed file quickly.

In this blog post, we will install and show you some real-life examples of using the tar.gz format with commands. Let’s get started!

  • A server with AlmaLinux 9 as OS
  • User privileges: root or non-root user with sudo privileges

Update the System

We assume that you have a fresh installation of AlmaLinux 9 so let’s first update the system packages to their latest versions available:

sudo dnf update -y && sudo dnf upgrade -y

Tar.Gz Installation

Tar.Gz can be installed and is compatible with multiple operating systems such as MacOS, Windows and Linux. We will focus of course Linux operating system because AlmaLinux is a Linux distribution. To install tar.gz on AlmaLinux 9, execute the following command:

yum install tar gzip

Once installed, you can check the installed versions of tar and gzip using the following commands:

tar --version

gzip --version

You should get the following output:

[root@host ~]# tar --version
tar (GNU tar) 1.34
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
[root@host ~]# gzip --version
gzip 1.12
Copyright (C) 2018 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License .
There is NO WARRANTY, to the extent permitted by law.

Written by Jean-loup Gailly.

How to create Tar.gz files

Now, when the tar.gz is installed, we are going to show you how to create a tar.gz file. Let’s say that we have WordPress files and folders:

[root@host wordpress]# ll
total 228
-rw-r--r--  1 root root   405 Feb  6  2020 index.php
-rw-r--r--  1 root root 19915 Dec 31 18:06 license.txt
-rw-r--r--  1 root root  7402 Mar  4 18:52 readme.html
-rw-r--r--  1 root root  7205 Sep 16  2022 wp-activate.php
drwxr-xr-x  9 root root  4096 May 16 11:45 wp-admin
-rw-r--r--  1 root root   351 Feb  6  2020 wp-blog-header.php
-rw-r--r--  1 root root  2338 Nov  9  2021 wp-comments-post.php
-rw-r--r--  1 root root  3013 Feb 23 04:38 wp-config-sample.php
drwxr-xr-x  4 root root  4096 May 16 11:45 wp-content
-rw-r--r--  1 root root  5536 Nov 23 09:43 wp-cron.php
drwxr-xr-x 28 root root 12288 May 16 11:45 wp-includes
-rw-r--r--  1 root root  2502 Nov 26 15:01 wp-links-opml.php
-rw-r--r--  1 root root  3792 Feb 23 04:38 wp-load.php
-rw-r--r--  1 root root 49330 Feb 23 04:38 wp-login.php
-rw-r--r--  1 root root  8541 Feb  3 07:35 wp-mail.php
-rw-r--r--  1 root root 24993 Mar  1 09:05 wp-settings.php
-rw-r--r--  1 root root 34350 Sep 16  2022 wp-signup.php
-rw-r--r--  1 root root  4889 Nov 23 09:43 wp-trackback.php
-rw-r--r--  1 root root  3238 Nov 29 09:51 xmlrpc.php

We want to compress them in an archive so we can easily upload somewhere or store them locally on our system. To do that, execute the following command inside the WordPress directory:

tar -zcvf wordpress.tar.gz .

This will compress all files and folders of the current directory (That is why we are using dot in the command), and the compressed file will be inside it:

[root@host wordpress]# ll
total 22700
-rw-r--r--  1 root root      405 Feb  6  2020 index.php
-rw-r--r--  1 root root    19915 Dec 31 18:06 license.txt
-rw-r--r--  1 root root     7402 Mar  4 18:52 readme.html
-rw-r--r--  1 root root 23007861 May 19 15:06 wordpress.tar.gz
-rw-r--r--  1 root root     7205 Sep 16  2022 wp-activate.php
drwxr-xr-x  9 root root     4096 May 16 11:45 wp-admin
-rw-r--r--  1 root root      351 Feb  6  2020 wp-blog-header.php
-rw-r--r--  1 root root     2338 Nov  9  2021 wp-comments-post.php
-rw-r--r--  1 root root     3013 Feb 23 04:38 wp-config-sample.php
drwxr-xr-x  4 root root     4096 May 16 11:45 wp-content
-rw-r--r--  1 root root     5536 Nov 23 09:43 wp-cron.php
drwxr-xr-x 28 root root    12288 May 16 11:45 wp-includes
-rw-r--r--  1 root root     2502 Nov 26 15:01 wp-links-opml.php
-rw-r--r--  1 root root     3792 Feb 23 04:38 wp-load.php
-rw-r--r--  1 root root    49330 Feb 23 04:38 wp-login.php
-rw-r--r--  1 root root     8541 Feb  3 07:35 wp-mail.php
-rw-r--r--  1 root root    24993 Mar  1 09:05 wp-settings.php
-rw-r--r--  1 root root    34350 Sep 16  2022 wp-signup.php
-rw-r--r--  1 root root     4889 Nov 23 09:43 wp-trackback.php
-rw-r--r--  1 root root     3238 Nov 29 09:51 xmlrpc.php

The original WordPress directory was 72 megabytes:

[root@host html]# du -csxh wordpress/
72M     wordpress/
72M     total

Now, the compressed file is 22 megabytes which is three times smaller than the WordPress directory:

[root@host wordpress]# du -csxh wordpress.tar.gz
22M     wordpress.tar.gz
22M     total

How to Extract Tar.gz Files

To extract the compressed tar.gz archive, execute the following command:

tar -xzvf wordpress.tar.gz

You can notice now that instead of the c flag, the x flag is used, which means extract.

If you want to know more about the usage of tar, you can execute the following command:

man tar

You should get the following output:

[root@host ~]# man tar
TAR(1)                                                                     GNU TAR Manual                                                                    TAR(1)

NAME
       tar - an archiving utility

SYNOPSIS
   Traditional usage
       tar {A|c|d|r|t|u|x}[GnSkUWOmpsMBiajJzZhPlRvwo] [ARG...]

   UNIX-style usage
       tar -A [OPTIONS] ARCHIVE ARCHIVE

       tar -c [-f ARCHIVE] [OPTIONS] [FILE...]

       tar -d [-f ARCHIVE] [OPTIONS] [FILE...]

       tar -t [-f ARCHIVE] [OPTIONS] [MEMBER...]

       tar -r [-f ARCHIVE] [OPTIONS] [FILE...]

       tar -u [-f ARCHIVE] [OPTIONS] [FILE...]

       tar -x [-f ARCHIVE] [OPTIONS] [MEMBER...]
          .
          .
          .
          .
          .

That’s it. In this blog post, we explained how to install Tar.gz on AlmaLinux 9 and its usage. If you find it difficult to install and use the tar command, you can always sign up for one of our NVMe VPS plans and submit a support ticket. We are available 24/7

If you liked this post about installing Tar.gz on AlmaLinux 9, please share it with your friends on social networks or simply leave a reply below.

The post How to Install Tar.gz on AlmaLinux 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-tar-gz-on-almalinux-9/feed/ 0
How To Install ERPNext on AlmaLinux https://linuxhostsupport.com/blog/how-to-install-erpnext-on-almalinux/ https://linuxhostsupport.com/blog/how-to-install-erpnext-on-almalinux/#respond Thu, 30 Mar 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1771 In this tutorial, we are going to explain in step-by-step detail how to install ERPNext on AlmaLinux OS. ERPNext or Enterprise Resource Planning is an open-source integrated software solution that collects and organizes business information. ERPNext is built on the Frappe Framework in Python and Javascript that stores the data in the MySQL database server. […]

The post How To Install ERPNext on AlmaLinux appeared first on LinuxHostSupport.

]]>
In this tutorial, we are going to explain in step-by-step detail how to install ERPNext on AlmaLinux OS.

ERPNext or Enterprise Resource Planning is an open-source integrated software solution that collects and organizes business information. ERPNext is built on the Frappe Framework in Python and Javascript that stores the data in the MySQL database server. The framework also uses Nginx as a web server and Redis cache. It is important to know that ERPNext requires only a clean server and has a configuration that needs to be installed from scratch. In this tutorial, we are going to use AlmaLinux 8.5 OS.

Installing ERPNext on AlmaLinux OS can take up to 1 hour. Let’s get things done!

Prerequisites

  • A VPS with at least 4GB of RAM (Our NVMe 4 VPS plan)
  • Fresh install of AlmaLinux 8 as OS
  • Valid domain pointed to the servers IP address
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

We need to update the system packages to their latest version available before installation of ERPNext

sudo dnf update -y && sudo dnf upgrade -y

Step 2. Install Dependencies

To install the required dependencies, execute the following command:

yum groupinstall "Development Tools" -y
yum install epel-release gcc make git openssl-devel zlib-devel bzip2-devel libffi-devel xz-devel redis -y

After installation of the required dependencies, start and enable the Redis service.

sudo systemctl start redis && sudo systemctl enable redis

Step 3. Install Python

The latest version of ERPNext requires python version 3.10. To install the Python 3.10 version, execute the following commands:

cd /opt

wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz

tar -xvf Python-3.10.0.tar.xz

rm Python-3.10.0.tar.xz

cd Python-3.10.0

./configure --enable-optimizations && make altinstall

After installation, make a symbolic link

ln -s /usr/local/bin/python3.10 /usr/bin/python3

Check the installed version with the following command: python3 -V

You should receive the following output:

[root@host Python-3.10.0]# python3 -V
Python 3.10.0

If there was already a symbolic link, just remove it with the following command:

rm -f /usr/bin/python3

Now, install pip3 and wheel dependencies with the newly installed Python3.10 version:

python3 -m pip install --upgrade pip setuptools wheel

Step 4. Install the MariaDB database server

Next, we need to install the MariaDB database server. To do that, execute the following command:

sudo yum install -y  mariadb mariadb-server

Start and enable the mariadb.service with the following commands:

sudo systemctl start mariadb && sudo systemctl enable mariadb

Check the status of the mariadb.service

sudo systemctl status mariadb

You should receive the following output:

[root@host]# sudo systemctl status mariadb
● mariadb.service - MariaDB 10.3 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2023-02-10 03:59:54 CST; 20s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
 Main PID: 47326 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30 (limit: 23666)
   Memory: 87.4M
   CGroup: /system.slice/mariadb.service
           └─47326 /usr/libexec/mysqld --basedir=/usr

Feb 10 03:59:50 host.test.vps systemd[1]: Starting MariaDB 10.3 database server...
Feb 10 03:59:50 host.test.vps mysql-prepare-db-dir[47223]: Initializing MariaDB database
Feb 10 03:59:54 host.test.vps mysqld[47326]: 2023-02-10  3:59:54 0 [Note] /usr/libexec/mysqld (mysqld 10.3.35-MariaDB) starting as process 47326 ...
Feb 10 03:59:54 host.test.vps systemd[1]: Started MariaDB 10.3 database server.

We must secure the database instance and set MySQL root password:

mysql_secure_installation

Follow the steps to secure the database:

Enter current password for root (enter for none): Hit Enter

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!

Remove anonymous users? [Y/n] Y

Disallow root login remotely? [Y/n] Y

Remove test database and access to it? [Y/n] Y

Reload privilege tables now? [Y/n] Y

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Save the MySQL root password since you will need it while installing ERPNext.

Next, we need to add the lines of code below in /etc/my.cnf file:

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]

default-character-set = utf8mb4

After adding these lines, restart the MariaDB service:

sudo systemctl restart mariadb

Step 5. Install NodeJS

ERPNext’s latest version, 14, requires a newer NodeJS version, such as NodeJS 16. To install nodejs execute the following command:

yum module list nodejs 

yum module enable nodejs:16

yum install nodejs -y

After installation, check the Node and NPM versions with the following command:

node -v && npm -v

You should get the following output:

[root@host]# node -v && npm -v
v16.18.1
8.19.2

After nodejs installation, we will install Yarn:

npm install -g yarn

Check the installed Yarn version with the yarn -v command:

[root@host]# yarn -v
1.22.19

Step 6. Install ERPNext

Finally, we are at the last step of the tutorial, and that step is the installation of ERPNext.

First, create an ERPNext user, add to the wheel group, and set a password.

sudo useradd -m erpnext -G wheel

sudo passwd erpnext

Changing password for user erpnext.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Switch to the erpnext user.

su - erpnext

Go into the /home directory of the erpnext user:

cd /home/erpnext/

Install the Frappe bench version 14 with the following command:

pip3 install --user frappe-bench

bench init frappe-bench --frappe-branch version-14

After the successful installation of the bench, you will receive the following output:

frappe/dist/js/
├─ bootstrap-4-web.bundle.22U72DEL.js                       1.73 Kb
├─ controls.bundle.RQCO7PK6.js                              1228.26 Kb
├─ data_import_tools.bundle.ZHGGYJ52.js                     106.10 Kb
├─ desk.bundle.VYQDF5SY.js                                  1414.14 Kb
├─ dialog.bundle.X36Y7A7S.js                                53.07 Kb
├─ form.bundle.6OYSHLE3.js                                  153.69 Kb
├─ frappe-web.bundle.W6O5MTCM.js                            949.60 Kb
├─ libs.bundle.YZMCKPNH.js                                  574.13 Kb
├─ list.bundle.RERWMHEV.js                                  185.53 Kb
├─ logtypes.bundle.7STJ7YLS.js                              0.73 Kb
├─ recorder.bundle.5AOEUOFD.js                              179.54 Kb
├─ report.bundle.IQ4SSISM.js                                170.93 Kb
├─ user_profile_controller.bundle.YR6XHZRM.js               11.35 Kb
├─ video_player.bundle.UO3KNN5D.js                          120.59 Kb
├─ web_form.bundle.75LN4HKD.js                              1562.54 Kb
├─ print_format_builder.bundle.KP4FAW42.js                  170.39 Kb
├─ build_events.bundle.L2HAVD4K.js                          11.62 Kb
└─ kanban_board.bundle.VCVKXCPT.js                          27.42 Kb

frappe/dist/css/
├─ desk.bundle.MBTR4LD7.css                                 547.98 Kb
├─ email.bundle.D7YLNAJF.css                                4.02 Kb
├─ login.bundle.6T5NJHU5.css                                24.88 Kb
├─ print.bundle.N3SFSER3.css                                196.28 Kb
├─ print_format.bundle.JH7UBL6H.css                         178.93 Kb
├─ report.bundle.HWLJLFER.css                               5.36 Kb
├─ web_form.bundle.YDYF7I73.css                             14.73 Kb
└─ website.bundle.IPR4YLHZ.css                              422.09 Kb

frappe/dist/css-rtl/
├─ desk.bundle.PZAWYDHE.css                                 548.23 Kb
├─ email.bundle.HU2YKLCX.css                                4.02 Kb
├─ login.bundle.FLH267FT.css                                24.88 Kb
├─ print.bundle.ALDGUYEF.css                                196.43 Kb
├─ print_format.bundle.3QFLLY7D.css                         179.05 Kb
├─ report.bundle.LY72JI7U.css                               5.35 Kb
├─ web_form.bundle.L26SZB7K.css                             14.72 Kb
└─ website.bundle.355E5L7G.css                              422.24 Kb

DONE  Total Build Time: 41.861s
Done in 45.98s.
SUCCESS: Bench frappe-bench initialized

Next is to create the website:

cd frappe-bench

bench new-site YourDomainName

The installation will ask for the MySQL root password, and you will need to set up a password for the administrator</b login user.

[erpnext@host frappe-bench]$ bench new-site YourWebsiteName
MySQL root password:
Updating DocTypes for frappe        : [========================================] 100%
Updating country info               : [========================================] 100%
Set Administrator password:
Re-enter Administrator password:
*** Scheduler is disabled ***

Enable the scheduler:

bench --site YourDomainName enable-scheduler

Once the scheduler is enabled, we need to get the ERPNext app and install it with the following commands:

bench get-app erpnext --branch version-14

bench --site YourDomainName  install-app erpnext

Step 7. Setup ERPNext in Production Mode

Now, we can install the bench in production mode with the following substeps:

pip3 install frappe-bench

Next, we will install Nginx and Supervisor:

sudo yum install nginx supervisor -y

After installation, open the /etc/nginx/nginx.conf file and change the Nginx user from root to erpnext.

user erpnext;

Save the file, close it, and start both services:

sudo systemctl start nginx && sudo systemctl enable nginx

sudo systemctl start supervisord && sudo systemctl enable supervisord

Once the services are enabled, create the symbolic links for Nginx, Supervisor, and Python3.10 again:

sudo ln -s `pwd`/config/supervisor.conf /etc/supervisord.d/frappe-bench.ini

sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe-bench.conf

sudo rm /usr/bin/python3

sudo ln -s /usr/local/bin/python3.10 /usr/bin/python3

Once the symbolic links are set, setup nginx and supervisor with the following commands:

bench setup supervisor

bench setup nginx

You should get the following output:

Site YourWebsiteDomain assigned port: 80

The last thing is to restart the services:

sudo systemctl restart supervisord

sudo systemctl restart nginx

sudo supervisorctl start all

Now, you can access your website at http://YourWebsiteDomain using administrator as username and the password you set above.

That’s it. You successfully installed and configured ERPNext 14 on AlmaLinux 8 OS in production mode. If you find this setup difficult, you can always contact our technical support and they will help you immediately. You just need to sign up for one of our NVMe VPS hosting plans with >= 4GB of RAM and submit a support ticket.

If you liked this about installing ERPNext on AlmaLinux, please share it with your friends on social networks or simply leave a reply below.

The post How To Install ERPNext on AlmaLinux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-erpnext-on-almalinux/feed/ 0
How to Install Docker CE on AlmaLinux https://linuxhostsupport.com/blog/how-to-install-docker-ce-on-almalinux/ https://linuxhostsupport.com/blog/how-to-install-docker-ce-on-almalinux/#respond Wed, 15 Mar 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1768 Docker Community Edition (CE) is a free, open-source, and community-supported version of the Docker platform. Docker CE provides all the essential features to build, ship, and run container applications. It is designed for developers who are just starting out with containerization, as well as for small-scale development and testing environments. Docker CE includes the Docker […]

The post How to Install Docker CE on AlmaLinux appeared first on LinuxHostSupport.

]]>
Docker Community Edition (CE) is a free, open-source, and community-supported version of the Docker platform. Docker CE provides all the essential features to build, ship, and run container applications. It is designed for developers who are just starting out with containerization, as well as for small-scale development and testing environments.

Docker CE includes the Docker Engine, a lightweight runtime and packaging tool, and Docker CLI, a command-line interface for interacting with the Docker Engine. With Docker CE, developers can quickly build, package, and deploy their applications as containers, making it easier to run the same application across multiple environments, such as development, testing, and production.

In the following tutorial, we will show you how to install Docker CE on AlmaLinux server.

Step 1: Log in to the Server & Update the Server OS Packages

First, log in to your AlmaLinux  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 admin account username if necessary.

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

# dnf update

Step 2. Install Docker CE and Docker Compose

By default, the latest Docker CE package is unavailable in the AlmaLinux default repository, so you must add the Docker CE official repository to your server.

To add a Docker CE repository to your AlmaLinux system, run the following command:

# dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

Update the package index by running the following command:

# dnf update

You can check the added repo, including others of your system, using the command:

# dnf repolist -v

Now that the Docker repository has been added to your system, you can continue to install Docker CE:

# dnf install docker-ce docker-ce-cli containerd.io

Once Docker is installed, verify the installed version with the following command:

# docker --version

You should get the following output:

Docker version 23.0.1, build a5ee5b1

Start the Docker CE service by running the following command:

# systemctl start docker

Enable the Docker service to start automatically at boot time by running the following command:

# systemctl enable docker

Verify the service is up and running with the following command:

# systemctl status docker

You should see a similar output with information about Docker being active:

● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
     Active: active (running) since Fri 2023-02-17 15:36:29 CET; 1min 9s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 49178 (dockerd)
      Tasks: 7
     Memory: 30.6M
        CPU: 160ms
     CGroup: /system.slice/docker.service
             └─49178 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Step 3. Run Docker without root

This step is optional, but if you prefer the ability to run Docker as your current user, add your account to the docker group with this command:

# usermod -aG docker $USER

You need to reboot your system for those changes to take effect.

# reboot

Step 4. Running Docker Containers

Now that you have installed Docker CE on AlmaLinux and set up your user account to run Docker commands, you can run Docker containers.

To run a Docker container, you need to have a Docker image. A Docker image is a pre-built environment for running an application.

Run the following command to pull a Docker image from the Docker Hub repository:

# docker pull hello-world

Note: Replace “hello-world” with the name of the Docker image you want to pull.

Run the following command to start a Docker container:

# docker run -it hello-world

The output should be similar to this:

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

You can see your locally available images by using the docker images command.

# docker images

If you want to see the container information, you can use the following command:

# docker ps -a

The output should be similar to this:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
519a0de94621 hello-world "/hello" 7 minutes ago Exited (0) 7 minutes ago gracious_hamilton

In this tutorial, we learned how to install Docker CE on your AlmaLinux server and the basics of using it.

Of course, you don’t have to spend your time and follow this article to install Docker CE on AlmaLinux if you have an active AlmaLinux VPS Hosting service with us, in which case you can ask our expert Linux admins to install Docker CE for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post about installing Docker CE on AlmaLinux, please share it with your friends on social networks or leave a reply below.

The post How to Install Docker CE on AlmaLinux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-docker-ce-on-almalinux/feed/ 0
5 most Used dig Commands in Linux With Examples  https://linuxhostsupport.com/blog/5-most-used-dig-commands-in-linux-with-examples/ https://linuxhostsupport.com/blog/5-most-used-dig-commands-in-linux-with-examples/#respond Wed, 15 Feb 2023 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1761 The DIG command offers a vast amount of functionalities and different options. In this guide, we’ll learn more about some of the most important functionalities for DNS troubleshooting. What is the DIG command? DIG command (Domain Information Groper command) is a tool with a basic command-line interface that serves for making different DNS (domain name […]

The post 5 most Used dig Commands in Linux With Examples  appeared first on LinuxHostSupport.

]]>
The DIG command offers a vast amount of functionalities and different options. In this guide, we’ll learn more about some of the most important functionalities for DNS troubleshooting.

What is the DIG command?

DIG command (Domain Information Groper command) is a tool with a basic command-line interface that serves for making different DNS (domain name system) queries. You can use the DIG command to:

– Check all of the available DNS records or individual DNS records
– Diagnose the name servers of your domain.
– Trace IP addresses.
– See the hostnames that correspond to an IP address.

And many other aspects that you can read directly on their manual. You can find the DIG command pre-installed on most Linux distros. Also, you can easily install it on macOS, too with brew, and get the DIG command on Windows 10 with bind9.

Top 5 most used DIG commands:

Here you have five examples of DIG command. We will use rosehostingtest.com as a hostname and 1.1.1.1. as an IP address. Feel free to try these commands with the domain and IP address you want by simply changing the text before you try.

Once you are on your terminal, we can proceed with the following commands:

1. Finding the website IP address

To do that function, everything you need to do is simply use the dig command with the domain name after it, for example:

dig rosehostingtest.com

This will return you the A record of your hostname but with a lot of details together, here is an example:

➜  ~ dig rosehostingtest.com

; <<>> DiG 9.10.6 <<>> rosehostingtest.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40154
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;rosehostingtest.com. IN A

;; ANSWER SECTION:
rosehostingtest.com. 300 IN A 104.21.51.178
rosehostingtest.com. 300 IN A 172.67.183.57

;; Query time: 53 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Dec 20 12:23:50 -03 2022
;; MSG SIZE  rcvd: 80

If you want an answer with fewer details, you can add +short to your command, no matter if it’s before or after the hostname, you can use it together with your domain and it will return only the IP address:

➜  ~ dig rosehostingtest.com +short
104.21.51.178

From now on, in this guide, we’ll use the +short option so it’s less information making it more friendly to be readen.

2. Getting the NameServers from the domain.

For that usage, instead of only using the dig command, we had to add the option NS to our command. So, to get the nameservers of your domain name, you can use the following command:

➜  ~ dig rosehostingtest.com NS +short
aragorn.ns.cloudflare.com.
coco.ns.cloudflare.com.

Here you can see to which DNS the domain you are checking is pointing to.

3. Check the path of your DNS.

This option will show you the path from the root servers to the DNS zone of the hostname that you are querying. To use the trace option, you should run:

➜  ~ dig rosehostingtest.com +trace +short
NS h.root-servers.net. from server 8.8.8.8 in 44 ms.
NS b.root-servers.net. from server 8.8.8.8 in 44 ms.
NS k.root-servers.net. from server 8.8.8.8 in 44 ms.
NS m.root-servers.net. from server 8.8.8.8 in 44 ms.
NS c.root-servers.net. from server 8.8.8.8 in 44 ms.
NS a.root-servers.net. from server 8.8.8.8 in 44 ms.
NS f.root-servers.net. from server 8.8.8.8 in 44 ms.
NS j.root-servers.net. from server 8.8.8.8 in 44 ms.
NS d.root-servers.net. from server 8.8.8.8 in 44 ms.
NS i.root-servers.net. from server 8.8.8.8 in 44 ms.
NS g.root-servers.net. from server 8.8.8.8 in 44 ms.
NS e.root-servers.net. from server 8.8.8.8 in 44 ms.
NS l.root-servers.net. from server 8.8.8.8 in 44 ms.
RRSIG NS 8 0 518400 20230102050000 20221220040000 18733 . Ban8EH/5IIhAO5yzTrFjKFL/ZblByKCk1ln3kXGqwwusnoBTY6fpXY/4 bQztpIpYGEE0O0Nh6afh6O2Uk/BtFvZf1YT6t1xRFZOJJ2fQGntqnvYt VX0HLYwrGmWZiaTcRWVWezLDJ/xQrxab1FGH/09qn9UQjfkswN372vb3 feGu2vbti9I63rzKTl2wJFn95jwkTRwkgrXUfP10znzJpCj3B8ZCPtN+ cvwWWrUFu1Yj5DuOS3c0SRDrcF4YFkRQTc3Fy/kMlqAvbuDuKKmGuo+f E0+oBXFWroFPLf7wB6dbHOGxoppNokqjDN1VyAHQx0uMWnfRksMpq3RC 8u3GIw== from server 8.8.8.8 in 44 ms.
A 104.21.51.178 from server 2a06:98c1:50::ac40:2143 in 37 ms.
A 172.67.183.57 from server 2a06:98c1:50::ac40:2143 in 37 ms.
RRSIG A 13 2 300 20221221162911 20221219142911 34505 rosehostingtest.com. Nn6Pr3DT0JjfqH2yV1HlMPMIbfsFYr4Voyvb5kR6aV70cTGdrItRmi6E cIKc6eDoPWJUdoIpIuDUuDwj3wcpyA== from server 2a06:98c1:50::ac40:2143 in 37 ms.

The output will show you the route of your DNS query goes. You can check if the connection is hoping somewhere to troubleshoot your DNS problems, so you can get exactly when it’s lost.

4. Checking the entries responsible for mails.

All emails to be received by the recipient, requires the domain to have their MX records properly setup, you can check yours by using the following command:

➜  ~ dig rosehostingtest.com MX +short
31 route2.mx.cloudflare.net.
42 route1.mx.cloudflare.net.
66 route3.mx.cloudflare.net.

So in our example case, the email from the test domain is handled by Cloudflare, and any email issues or problems need to be checked directly with them.

5. Check the RDNS of an IP address.

You can easily get a reverse DNS from one ip address (this means the hostname that is associated with the ip address basically) using this dig command:

➜  ~ dig -x 1.1.1.1 +short
one.one.one.one

The hostname of the queried IP address will be available on the output.

Those are the most useful commands from the dig, but you can use more options that are available in their own manual. You can run:

man dig

dig -h

This will show ALL The options available so you can do different queries. Of course, if you have an active server and need assistance in troubleshooting your DNS servers, do not hesitate to contact us. We are available 24/7/365 to help you.

The post 5 most Used dig Commands in Linux With Examples  appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/5-most-used-dig-commands-in-linux-with-examples/feed/ 0
Improve Website Performance Using gzip and Nginx on Ubuntu 22.04 https://linuxhostsupport.com/blog/improve-website-performance-using-gzip-and-nginx-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/improve-website-performance-using-gzip-and-nginx-on-ubuntu-22-04/#respond Thu, 01 Dec 2022 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1728 A website’s performance depends on many factors, and choosing a suitable web server is one of them. You can choose from many web servers, like Apache, LiteSpeed, Nginx, etc. Nginx is an open-source web server, it was initially developed by Igor Sysoev and released in October 2004. In Nginx, gzip compression can significantly reduce the […]

The post Improve Website Performance Using gzip and Nginx on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
A website’s performance depends on many factors, and choosing a suitable web server is one of them. You can choose from many web servers, like Apache, LiteSpeed, Nginx, etc.

Nginx is an open-source web server, it was initially developed by Igor Sysoev and released in October 2004. In Nginx, gzip compression can significantly reduce the size of transmitted data to website visitors.

Modern web browsers support GZIP compression by default. However, we need to configure our server to serve the compressed resources to our website visitors properly. Without a proper configuration, it could make your server load higher and even slower. This article will show you how to improve website performance using GZIP and Nginx on Ubuntu 22.04.

Prerequisites

  • Ubuntu 22.04
  • SSH access with root privileges or a regular system user with sudo privileges

What is GZIP Compression

GZIP or GNU zip is an open-source algorithm for file compression. GZIP compresses your website resources, such as Javascript and CSS files, while serving requests to the web browsers. It compresses text files effectively, while image files are not compressed because they have some built-in compression.

How to Enable GZIP Compression

To enable compression in Nginx, simply include the following directives in your nginx.conf file, or comment them out if you already have the lines.

gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

Save and close the file, then verify Nginx for any syntax errors:

$ sudo nginx -t

You should get the following output:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Next, restart the Nginx service using the following command:

$ sudo systemctl restart nginx

Then check the status.

$ sudo systemctl status nginx

You should see the following output:

● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2022-09-19 17:51:13 WIB; 1s ago
Docs: man:nginx(8)
Process: 1249555 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 1249574 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 1249579 (nginx)
Tasks: 3 (limit: 4532)
Memory: 4.4M
CGroup: /system.slice/nginx.service
├─1249579 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
├─1249580 nginx: worker process
└─1249581 nginx: worker process

Sep 19 17:51:12 home systemd[1]: Starting A high performance web server and a reverse proxy server...
Sep 19 17:51:13 home systemd[1]: Started A high performance web server and a reverse proxy server.

The following are explanations of our directives to enable and configure gzip in nginx.

gzip on;

The directive above should be turned on to enable gzipping of responses.

In gzip_type directive, you can add another MIME type because, by default, Nginx compresses responses only with MIME type text/thml.

gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

To set gzip compression level, you can add gzip_comp_level directive. The value should be between 1 and 9. The higher the value, the higher the compression. Please note that the most compressed data usually requires more work to compress or decompress, so if you have it set fairly high on a busy website, you may see the difference in your CPU usage.

gzip_comp_level 6;

Another directive, gzip_vary is optional. It is used to enable or disable inserting the “Vary: Accept-Encoding” response header. This header inform the browsers if the client can handle the compressed version of the website or not, especially when your Nginx server is behind CDN or another reverse caching server. If gzip_vary is enabled, you will see vary: Accept-Encoding in the header response, like the following.

HTTP/2 200 
server: nginx
date: Mon, 19 Sep 2022 10:25:15 GMT
content-type: text/html
content-length: 14512
last-modified: Sat, 22 Jan 2022 13:53:28 GMT
vary: Accept-Encoding
etag: "61ec0c58-38b0"
accept-ranges: bytes

Since compression happens at runtime, it can add considerable processing overhead, which can negatively affect your server performance. You can lower your gzip_comp_level if you think your CPU usage is abnormally higher after enabling gzip in Nginx.

How to Verify GZIP is working?

There are several ways to verify whether the gzip compression is working or not. You can use an online tool like Google PageSpeed Insights to check it, or use your browser’s developer tools, or even simply use the curl shell command as follow:

$ curl -I -H 'Accept-Encoding: gzip,deflate' https://www.rosehosting.com/

The command above will show you an output like this:

HTTP/2 200 
server: nginx
date: Mon, 19 Sep 2022 09:52:28 GMT
content-type: text/html
last-modified: Sat, 22 Jan 2022 13:53:28 GMT
etag: W/"61ec0c58-38b0"
content-encoding: gzip

As we can see in the output, the website is compressed using gzip (content-encoding: gzip).

Compare GZIP and Plain Text

After enabling gzip compression, you can compare the files transmitted by nginx to you by simply running these commands.

$ curl -s --output uncompressed https://www.rosehosting.com/
$ curl -s --output compressed -H 'Accept-Encoding: gzip,deflate' https://www.rosehosting.com/

Then, run ‘ls -lh’ or ‘ll -h’ command to see the file size.

As seen above, the compressed file has a lower file size. The lower the file size, the faster your website is and the higher number of concurrent visitors your server can handle.

Congratulations! You have successfully improved your website performance using gzip and Nginx on Ubuntu 22.04.

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

If you liked this post about how to improve your website performance using gzip and Nginx on Ubuntu 22.04, 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 Improve Website Performance Using gzip and Nginx on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/improve-website-performance-using-gzip-and-nginx-on-ubuntu-22-04/feed/ 0
10 Useful cron Commands in Linux With Examples https://linuxhostsupport.com/blog/10-useful-cron-commands-in-linux-with-examples/ https://linuxhostsupport.com/blog/10-useful-cron-commands-in-linux-with-examples/#respond Tue, 15 Nov 2022 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1730 In this tutorial, we will explain ten useful cron commands in Linux with examples. The cron command is used for scheduling tasks to be executed in a specific period, like a month, day, hour, minute, or even seconds. The cron uses a table of tabs called crontabs which have a list of commands that need […]

The post 10 Useful cron Commands in Linux With Examples appeared first on LinuxHostSupport.

]]>
In this tutorial, we will explain ten useful cron commands in Linux with examples.

The cron command is used for scheduling tasks to be executed in a specific period, like a month, day, hour, minute, or even seconds. The cron uses a table of tabs called crontabs which have a list of commands that need to be executed with their times respectively. These cron commands are used by system administrators mostly, to make their work easier and be sure not to forget to execute something during a specific period of their work.

In this tutorial, we are going to use Ubuntu 20.04, but you can choose any Linux distro you want. Let’s get started!

Prerequisites

  • Fresh install of Ubuntu 20.04 OS
  • User privileges: root or non-root user with sudo privileges

Update the System

Before we start with the ten useful cron commands, we need to update the system packages to the latest versions available.

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

Once the system is updated, we are ready to show you the basic cron commands in Linux.

1. Manage crond service

To check the status of the crond service, execute the following command:

systemctl status cron.service

You should receive the following output:

root@host:~# systemctl status cron.service
● cron.service - Regular background program processing daemon
     Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-08-08 23:57:40 CEST; 1 weeks 3 days ago
       Docs: man:cron(8)
   Main PID: 583 (cron)
      Tasks: 1 (limit: 4611)
     Memory: 11.7M
     CGroup: /system.slice/cron.service
             └─583 /usr/sbin/cron -f

For starting, stopping, and restarting the cron service, you can use the following commands respectively:

systemctl start cron.service

systemctl stop cron.service

systemctl restart cron.service

2. List the jobs

To list the jobs for the current user, execute the following command:

crontab -l

The output should look similar to this because we do not have cron jobs set yet:

root@host:/var/www/html# crontab -l
no crontab for root

3. Create your first cron job

To create your first cron job execute the following command:

crontab -e

After executing this command, the file will be opened, and you can paste the following lines of code:

1 0 * * *   root cd /var/www/html && /usr/bin/sh script.sh

Save the file and close it. If you execute the command crontab -l, you will get this:

root@host:/var/www/html# crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
1 0 * * *   cd /var/www/html && /usr/bin/sh script.sh

4. Schedule a job every 10 minutes

To schedule a job to run every 10 minutes, add the following lines with the crontab -e command:

*/10 * * * * root cd /var/www/html && /usr/bin/sh script.sh

This cron will call the script every 10 minutes.

5. Schedule a job every hour

To schedule a cron job to run every hour, add the following lines with the crontab -e command:

0 * * * * root cd /var/www/html && /usr/bin/sh script.sh

6. Schedule a job every day at 10:00 AM

Now, we will show you a different way to schedule a cron job. Open the file /etc/crontab. You should see the following lines of code:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

Now to add the cron job to execute every day at 10:00 AM, just add the following line at the bottom of the file, save it and close it.

0 0 * * * root cd /var/www/html && /usr/bin/sh script.sh

7. Schedule a job At 12:00 AM, only on Friday

To schedule this job, open the /etc/crontab file and paste the following command:

0 0 * * FRI root cd /var/www/html && /usr/bin/sh script.sh

8. Schedule a job for a daily backup

To schedule a daily backup, for example, with some script that will execute commands to generate a daily backup, you do not have to specify intervals. You just need to place the script to the /etc/cron.daily directory on your server:

9. Understanding the cron directories

In the previous example, we explained how to enable daily backup by putting some script into it. What if we want our script to be executed hourly, weekly, or monthly? Do not worry about that. Just execute ls -al /etc/cron and hit tab in your terminal server:

root@host:/var/www/html# ll /etc/cron
cron.d/       cron.daily/   cron.hourly/  cron.monthly/ crontab       cron.weekly/

As you can see, there are directories for different periods where you can place your scripts, which will be executed automatically.

10. Man command for cron

If you want to learn more about the cron, you must execute man cron in your terminal. You should receive complete documentation about the cron command:

CRON(8)                                                               System Manager's Manual                                                               CRON(8)

NAME
       cron - daemon to execute scheduled commands (Vixie Cron)

SYNOPSIS
       cron [-f] [-l] [-L loglevel]

DESCRIPTION
       cron is started automatically from /etc/init.d on entering multi-user runlevels.

OPTIONS
       -f      Stay in foreground mode, don't daemonize.

       -l      Enable  LSB  compliant  names  for  /etc/cron.d  files.   This  setting,  however,  does  not  affect  the  parsing of files under /etc/cron.hourly,
               /etc/cron.daily, /etc/cron.weekly or /etc/cron.monthly.

       -n      Include the FQDN in the subject when sending mails.  By default, cron will abbreviate the hostname.

       -L loglevel
               Tell cron what to log about jobs (errors are logged regardless of this value) as the sum of the following values:

That’s it. You just learned how to set up cron jobs on your own in different ways. If you find this difficult and you want some specific cron at a specific time, just contact our technical support, and they will do the rest. We are available 24/7.

If you liked this post about ten useful cron commands in Linux with examples, please share it with your friends on social networks or simply leave a reply below.

The post 10 Useful cron Commands in Linux With Examples appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/10-useful-cron-commands-in-linux-with-examples/feed/ 0
5 Most Used Echo Commands in Linux With Examples https://linuxhostsupport.com/blog/5-most-used-echo-commands-in-linux-with-examples/ https://linuxhostsupport.com/blog/5-most-used-echo-commands-in-linux-with-examples/#comments Sun, 30 Oct 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1723 This blog post will show you the five most used echo commands in Linux with examples. The echo command in Linux is a command that outputs the strings passed to its arguments. The echo command is supported on various Linux distributions such as Ubuntu, CentOS, Debian, and other OS like Windows. This command is most […]

The post 5 Most Used Echo Commands in Linux With Examples appeared first on LinuxHostSupport.

]]>
This blog post will show you the five most used echo commands in Linux with examples.

The echo command in Linux is a command that outputs the strings passed to its arguments. The echo command is supported on various Linux distributions such as Ubuntu, CentOS, Debian, and other OS like Windows. This command is most used in shell scripts and batch files to output status text to the screen.

In this tutorial, we will use the latest Ubuntu 22.04 OS, but you can choose any Linux distro per your choice. Let’s get started!

Prerequisites

  • A server with Ubuntu 22.04 OS
  • User privileges: root or non-root user with sudo privileges

Update the System

It is recommended to update the system packages to the latest versions available.

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

Once the system is updated, we are ready to show you the five most used echo commands in Linux.

Syntax of the echo command

The syntax of the echo command is the following:

echo [option(s)] [string(s)]

The echo command is simple and is being executed with the main word echo using some options and strings next to it.

1. Display simple line to standard output

To display a single line as text on standard output, execute the following echo command with the string:

echo This blog post will teach you about the echo command.

This is how looks the output of this command:

root@host:~# echo This blog post will teach you about the echo command.
This blog post will teach you about the echo command.

2. Print Files and Folders

The echo command can be used to print all files and folders in some directory as an alternative to the ls -al command for listing.

echo *
This is the output of the command above:
root@host:/# echo *
bin boot core dev etc home lib lib32 lib64 libx32 lost+found media mnt opt proc root run sbin snap srv sys tmp usr var

3. Redirect operator to output text in a file

The following command will redirect the output in the file instead of the standard output on the command line.

echo * > outputfile.txt

To check the content of the file, execute the cat outputfile.txt command, and you should receive the same as in the previous paragraph:

root@host:/# cat outputfile.txt
bin boot core dev etc home lib lib32 lib64 libx32 lost+found media mnt opt proc root run sbin snap srv sys tmp usr var

4. Removing Text Spacing

To remove the text spacing in some lines, execute the following command with option -b:

echo -e "This \bblog \bpost \bwill \bhelp \byou \bwith \understanding \bthe \becho \bcommand"

You should get the following output:

root@host:/# echo -e "This \bblog \bpost \bwill \bhelp \byou \bwith \bunderstanding \bthe \becho \bcommand"
Thisblogpostwillhelpyouwithunderstaingtheechocommand

5. Displaying the Text in Multiple Lines

To display the text in multiple lines, execute the following command with option \n.

echo -e "This \nblog \npost \nwill \nhelp \nyou \nwith \nunderstanding \nthe \necho \ncommand"

You should get the following output:

root@host:/# echo -e "This \nblog \npost \nwill \nhelp \nyou \nwith \nunderstaing \nthe \necho \ncommand"
This
blog
post
will
help
you
with
understanding
the
echo
command

These were the most used echo commands on a daily basis by system administrators and other Linux users. If you want to know more about the echo command, just execute the command man echo, and you will get a complete definition of echo and its usage:

root@host:/# man echo
ECHO(1)                                                                    User Commands                                                                    ECHO(1)

NAME
       echo - display a line of text

SYNOPSIS
       echo [SHORT-OPTION]... [STRING]...
       echo LONG-OPTION

DESCRIPTION
       Echo the STRING(s) to standard output.

       -n     do not output the trailing newline

       -e     enable interpretation of backslash escapes

       -E     disable interpretation of backslash escapes (default)

       --help display this help and exit

       --version
              output version information and exit

       If -e is in effect, the following sequences are recognized:

       .
       .
       .
       .
       .

That’s it. You just learned to use the echo command on Linux with examples. Of course, if you need some help with this, you just need to sign up for one of our NVMe plans and submit a support ticket. Our admins will start work on your request immediately. We are available 24/7.

If you liked this post about the five most used echo commands in Linux with examples, please share it with your friends on social networks or simply leave a reply below.

The post 5 Most Used Echo Commands in Linux With Examples appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/5-most-used-echo-commands-in-linux-with-examples/feed/ 1
5 Most Used Touch Commands in Linux With Examples https://linuxhostsupport.com/blog/5-most-used-touch-commands-in-linux-with-examples/ https://linuxhostsupport.com/blog/5-most-used-touch-commands-in-linux-with-examples/#comments Sat, 15 Oct 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1720 In this tutorial, we are going to show you the most used touch commands in Linux with examples. The touch command is a standard command in Linux operating system used on daily basis by the system administrators, developers, and other users familiar with the Linux command line. With the touch command, we can easily create […]

The post 5 Most Used Touch Commands in Linux With Examples appeared first on LinuxHostSupport.

]]>
In this tutorial, we are going to show you the most used touch commands in Linux with examples.

The touch command is a standard command in Linux operating system used on daily basis by the system administrators, developers, and other users familiar with the Linux command line. With the touch command, we can easily create files, empty files, modify files, timestamps and etc.

In this tutorial, we will execute the touch commands on Ubuntu 20.04 OS, but you can choose any Linux distro. Le’ts get started!

Prerequisites

  • A server with Ubuntu 20.04 OS
  • User privileges: root or non-root user with sudo privileges

Update the System

If you have a fresh installation of Ubuntu 20.04, it is recommended to update the system packages to the latest versions available.

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

Once the system is updated, we are ready to show you the basic touch commands in Linux.

1. Create a File

To create an empty zero byte file, execute the following command:

touch file.txt

You can check the size of the file:

-rw-r--r--  1 root root 0 Aug 14 22:58 file.txt

2. Change only the access time

To change only the access time to the file, you need to execute the following command:

touch -a file.txt

This command will update the last access modification time and will create the file if it does not exists.

3. Use the timestamp of another file

Sometimes we need to set the same timestamp to a file from another file. To do that, execute the following command:

touch -r file1.txt file2.txt

This command will update the timestamp of file2.txt with the timestamp of file file1.txt.

4. Create a file with a specific timestamp

To create a file and specify the time, you need to execute the following command:

touch -t 202208181118.34 file-time

The command above will create the file-time with a timestamp on August 18, 2022, at 11:18:34 AM.

5. Creating Multiple files

In the above examples, we were creating only a single file. Sometimes we need multiple files to be created. To do that, we can simply use the touch command with multiple file names:

touch file1.txt file2.txt file3.txt

This command will create three files at once:

-rw-r--r--  1 root root    0 Aug 15 11:51 file1.txt
-rw-r--r--  1 root root    0 Aug 15 11:51 file2.txt
-rw-r--r--  1 root root    0 Aug 15 11:51 file3.txt

Learn more about the touch command

In the previous paragraphs, we covered the most used touch commands. There is a brief explanation of the touch command along with options in Linux. To learn more about the touch command, execute the man touch command in your terminal.

man touch

You should get the following output:

TOUCH(1)                                                                   User Commands                                                                   TOUCH(1)

NAME
       touch - change file timestamps

SYNOPSIS
       touch [OPTION]... FILE...

DESCRIPTION
       Update the access and modification times of each FILE to the current time.

       A FILE argument that does not exist is created empty, unless -c or -h is supplied.

       A FILE argument string of - is handled specially and causes touch to change the times of the file associated with standard output.

       Mandatory arguments to long options are mandatory for short options too.

       -a     change only the access time

       -c, --no-create
              do not create any files

       -d, --date=STRING
              parse STRING and use it instead of current time

       -f     (ignored)

       -h, --no-dereference
              affect each symbolic link instead of any referenced file (useful only on systems that can change the timestamps of a symlink)

       -m     change only the modification time

       -r, --reference=FILE
              use this file's times instead of current time

       -t STAMP
              use [[CC]YY]MMDDhhmm[.ss] instead of current time

       --time=WORD
              change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m

       --help display this help and exit

Congratulations! You learned the basic touch commands with examples applicable to every Linux distribution.

You learned how to create one file or multiple files with specific timestamps. If you find it challenging to understand the touch command and you are not able to manage the files on your server, you can simply contact our epic technical support, and they will do the rest. You only need to sign up for one of our NVMe VPS plans and submit a support ticket. We are available 24/7.

If you liked this post about the five most used touch commands in Linux, please share it with your friends on social networks or simply leave a reply below. Thanks.

The post 5 Most Used Touch Commands in Linux With Examples appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/5-most-used-touch-commands-in-linux-with-examples/feed/ 1
How to Install and Configure CSF on AlmaLinux https://linuxhostsupport.com/blog/how-to-install-and-configure-csf-on-almalinux/ https://linuxhostsupport.com/blog/how-to-install-and-configure-csf-on-almalinux/#respond Thu, 15 Sep 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1713 In this tutorial we are going to install and explain in step-by-step detail how to configure CSF on AlmaLinux OS. Config Server Firewall or CSF is a free and advanced firewall for most Linux distributions. CSF can be easily installed on a server with control panels such as DirectAdmin, WHM/cPanel and etc. It includes security […]

The post How to Install and Configure CSF on AlmaLinux appeared first on LinuxHostSupport.

]]>
In this tutorial we are going to install and explain in step-by-step detail how to configure CSF on AlmaLinux OS.

Config Server Firewall or CSF is a free and advanced firewall for most Linux distributions. CSF can be easily installed on a server with control panels such as DirectAdmin, WHM/cPanel and etc. It includes security features such as login, intrusion, flood detections, and many more. With CSF we can easily block IP addresses, whitelist IP addresses, open and close ports and etc.

Installing and configuring CSF on AlmaLinux is a straightforward process that may take up to 10 minutes. Let’s get started!

Prerequisites

  • A server with AlmaLinux 20.04 as OS
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

Before we install the CSF we need to update the system packages to the latest version available.

sudo dnf update -y && sudo dnf upgrade -y

Step 2. Download and Install CSF

Install some prerequisites before you download and install CSF

sudo dnf install epel-release -y

sudo dnf install iptables perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraph wget tar perl-Math-BigInt -y

Then download the CSF file.

cd /usr/src 

wget https://download.configserver.com/csf.tgz

Once downloaded, extract the csf file with the following command:

tar zxvf csf.tgz

Once extracted enter in the csf directory and execute the script for installation.

cd csf/

sh install.sh

After successfull installation you should receive the following output:

Don't forget to:
1. Configure the following options in the csf configuration to suite your server: TCP_*, UDP_*
2. Restart csf and lfd
3. Set TESTING to 0 once you're happy with the firewall, lfd will not run until you do so

Adding current SSH session IP address to the csf whitelist in csf.allow:
Can't locate lib.pm in @INC (you may need to install the lib module) (@INC contains: /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/sbin/csf line 10.
BEGIN failed--compilation aborted at /usr/sbin/csf line 10.
'lfd.service' -> '/usr/lib/systemd/system/lfd.service'
'csf.service' -> '/usr/lib/systemd/system/csf.service'
Created symlink /etc/systemd/system/multi-user.target.wants/csf.service → /usr/lib/systemd/system/csf.service.
Created symlink /etc/systemd/system/multi-user.target.wants/lfd.service → /usr/lib/systemd/system/lfd.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Created symlink /etc/systemd/system/firewalld.service → /dev/null.
'/etc/csf/csfwebmin.tgz' -> '/usr/local/csf/csfwebmin.tgz'

Installation Completed

As you can see the first message is a reminder that the CSF is not configured. Before we configure CSF, we can check if the required iptables modules are installed. Execute the command below:

sudo perl /usr/local/csf/bin/csftest.pl

If everything is OK, you should receive the following output:

[root@host csf]# sudo perl /usr/local/csf/bin/csftest.pl
Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing xt_connlimit...OK
Testing ipt_owner/xt_owner...OK
Testing iptable_nat/ipt_REDIRECT...OK
Testing iptable_nat/ipt_DNAT...OK

RESULT: csf should function on this server

Step 3. Manage the CSF service

In the previous step we downloaded and installed the CSF. After that, we confirmed that the iptables modules are loaded. Next is to start and enable the CSF service.

To start and enable the CSF service execute the commands below:

sudo systemctl start csf.service && sudo systemctl enable csf.service

To check the status of the CSF service:

sudo systemctl status csf.service

You should receive the following output:

[root@host csf]# sudo systemctl status csf
● csf.service - ConfigServer Firewall & Security - csf
   Loaded: loaded (/usr/lib/systemd/system/csf.service; enabled; vendor preset: disabled)
   Active: active (exited) since Mon 2022-08-08 17:13:49 EDT; 5s ago
 Main PID: 6595 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 23666)
   Memory: 0B
   CGroup: /system.slice/csf.service

Aug 08 17:13:49 host.test.vps csf[6595]: csf: FASTSTART loading UDP_IN (IPv4)
Aug 08 17:13:49 host.test.vps csf[6595]: csf: FASTSTART loading UDP_OUT (IPv4)
Aug 08 17:13:49 host.test.vps csf[6595]: ACCEPT  all opt -- in lo out *  0.0.0.0/0  -> 0.0.0.0/0
Aug 08 17:13:49 host.test.vps csf[6595]: ACCEPT  all opt -- in * out lo  0.0.0.0/0  -> 0.0.0.0/0
Aug 08 17:13:49 host.test.vps csf[6595]: LOGDROPOUT  all opt -- in * out !lo  0.0.0.0/0  -> 0.0.0.0/0
Aug 08 17:13:49 host.test.vps csf[6595]: LOGDROPIN  all opt -- in !lo out *  0.0.0.0/0  -> 0.0.0.0/0
Aug 08 17:13:49 host.test.vps csf[6595]: csf: FASTSTART loading DNS (IPv4)
Aug 08 17:13:49 host.test.vps csf[6595]: LOCALOUTPUT  all opt -- in * out !lo  0.0.0.0/0  -> 0.0.0.0/0
Aug 08 17:13:49 host.test.vps csf[6595]: LOCALINPUT  all opt -- in !lo out *  0.0.0.0/0  -> 0.0.0.0/0
Aug 08 17:13:49 host.test.vps systemd[1]: Started ConfigServer Firewall & Security - csf.

Step 4. Configuring CSF

In Step 2. we received the following output after the installation process:

1. Configure the following options in the csf configuration to suite your server: TCP_*, UDP_*
2. Restart csf and lfd
3. Set TESTING to 0 once you're happy with the firewall, lfd will not run until you do so.

First add the following ports for TCP in /etc/csf.conf

# Allow incoming TCP ports
TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995"

# Allow outgoing TCP ports
TCP_OUT = "20,21,22,25,53,80,110,113,443,587,993,995"

Next, set Testing to 0

# lfd will not start while this is enabled
TESTING = "0"

End the last is to start the ldf service and restart the CSF for the changes to take effectivity

sudo systemctl start lfd.service

sudo systemctl restart csf.service

Check the status of the lfd service

sudo systemctl status lfd.service

You should receive the following output:

[root@host csf]# systemctl status lfd
● lfd.service - ConfigServer Firewall & Security - lfd
   Loaded: loaded (/usr/lib/systemd/system/lfd.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2022-08-08 17:31:26 EDT; 13s ago
  Process: 6961 ExecStart=/usr/sbin/lfd (code=exited, status=0/SUCCESS)
 Main PID: 6970 (lfd - sleeping)
    Tasks: 1 (limit: 23666)
   Memory: 124.2M
   CGroup: /system.slice/lfd.service
           └─6970 lfd - sleeping

Step 5. Basic CSF commands

This is the last step of our tutorial about CSF and in this paragraph we will show you some basic CSF commands.

Enable CSF

csf -e

Whitelist IP address in CSF

csf -a 192.168.1.1

Block IP address in CSF

csf -d 192.168.1.2

Displays the current list of temporary allow and deny IP entries with their TTL and comments

csf -t

Restart CSF

csf -r

Disable CSF

csf -x

That’s it. You successfully installed and configured CSF on AlmaLinux OS. Also, you learned the most used CSF commands in no time. If you find any difficulties with this setup you can always contact our technical support and we will help you immediately. We are available 24/7. You just need to sign up for one of our NVMe VPS plans and submit a support ticket.

If you liked this about installing and configuring CSF on AlmaLinux, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below.

The post How to Install and Configure CSF on AlmaLinux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-and-configure-csf-on-almalinux/feed/ 0
How to install iRedMail on AlmaLinux https://linuxhostsupport.com/blog/how-to-install-iredmail-on-almalinux/ https://linuxhostsupport.com/blog/how-to-install-iredmail-on-almalinux/#respond Mon, 15 Aug 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1710 In this tutorial, we are going to install iRedMail on AlmaLinux and explain the installation process in step-by-step detail. iRedMail is an open-source email server software that is capable of supporting the latest IMAP, POP3, and SMTP protocols. In this blog post, we are going to install the iRedMail email server with the installation script. […]

The post How to install iRedMail on AlmaLinux appeared first on LinuxHostSupport.

]]>
In this tutorial, we are going to install iRedMail on AlmaLinux and explain the installation process in step-by-step detail.

iRedMail is an open-source email server software that is capable of supporting the latest IMAP, POP3, and SMTP protocols. In this blog post, we are going to install the iRedMail email server with the installation script. In the installation script are included Nginx as a web server, Postfix as a mail transfer agent, Dovecot as IMAP and POP3 server, SpamAssassin as a spam scanner, ClamAV as a virus scanner, OpenLDAP, iRedAPD and etc.

Installing iRedMail on AlmaLinux is a straightforward process and may take up to 10 minutes. Let’s get started!

Prerequisites

  • A server with AlmaLinux 20.04 as OS and a Minimum of 4GB of RAM
  • Valid hostname and domain pointed to the servers IP address
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

Before we start with the installation process it is necessary to update the system packages to the latest version available.

sudo dnf update -y && sudo dnf upgrade -y

Step 2. Download iRedmail

Before we made the installation script executable we need to download it in the “root” directory on our server. The latest stable release of iRedMail can be downloaded with the command below:

wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.6.0.tar.gz

After successful download, extract the file.

tar -xzvf 1.6.0.tar.gz

List the content of the root directory to check if the file is extracted properly.

ls -al

You should receive the following output:

[root@vps ~]# ls
1.6.0.tar.gz  iRedMail-1.6.0

Step 3. Execute the Installation Script

Go into the iRedMail-1.6.0 directory and make the script executable

cd iRedMail-1.6.0/

chmod +x iRedMail.sh

Once done, execute the installation script with the command below:

./iRedMail.sh

Once, the script is executed there will be a couple of windows that you will need to fill with information so you can completely install the iRedMail service.

On the first window, hit Yes to start the installation process.

On the next window, you just need to confirm the storage path by hitting Enter to proceed with the installation.

The next step is to choose Nginx as a web server since you need to access the iRedMail via domain name in the browser.

The next step is to choose the database server. We will choose MariaDB in this tutorial.

Once the database server is checked, the next step is to enter a strong root password.

In the next window, you have to specify your domain name yourdomain.com.

Once, the domain is set, you need to enter the password for the mail domain administrator.

In the next window, just hit the Enter button to proceed with the installation.

On the next 4 questions, just type Y and hit Enter to finish the installation.

Once, the installation is complete, you should receive the following output.

********************************************************************
* URLs of installed web applications:
*
* - Roundcube webmail: https://mail.yourdomain.com/mail/
* - netdata (monitor): https://mail.yourdomain.comk/netdata/
*
* - Web admin panel (iRedAdmin): https://mail.yourdomain.com/iredadmin/
*
* You can login to above links with below credential:
*
* - Username: postmaster@yourdomain.com
* - Password: YourStrongPasswordHere
*
*
********************************************************************
* Congratulations, mail server setup completed successfully. Please
* read below file for more information:
*
*   - /var/www/html/iRedMail-1.6.0/iRedMail.tips
*
* And it's sent to your mail account postmaster@yourdomain.com
*
********************* WARNING **************************************
*
* Please reboot your system to enable all mail services.
*
********************************************************************

You need to reboot the system, and then you can access your iRedMail Web admin panel at https://mail.yourdomain.com/iredadmin/

Once logged in, you will see the iRedMail admin dashboard as described in the picture below:

That’s it. You successfully installed and configured iRedMail mail server software on AlmaLinux OS.

If you do not know how to install iRedMail, you just need to contact our technical support, and they will do the rest. Of course, first, you need to sign up for one of our monthly or yearly NVMe VPS plans. Do not hesitate to contact us anytime. We are available 24/7!

If you liked this post on how to install iRedMail on AlmaLinux OS, 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 iRedMail on AlmaLinux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-iredmail-on-almalinux/feed/ 0
How to Install and Secure PhpMyAdmin on AlmaLinux https://linuxhostsupport.com/blog/how-to-install-and-secure-phpmyadmin-on-almalinux/ https://linuxhostsupport.com/blog/how-to-install-and-secure-phpmyadmin-on-almalinux/#respond Sat, 30 Jul 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1707 In this tutorial we are going to explain in step-by-step detail how to install and secure PhpMyAdmin on AlmaLinux. PhpMyAdmin is a free and open-source tool written in PHP used for managing MySQL databases via browser. It provides a very easy and user-friendly interface, that allows users to easily create databases, create users, tables columns […]

The post How to Install and Secure PhpMyAdmin on AlmaLinux appeared first on LinuxHostSupport.

]]>
In this tutorial we are going to explain in step-by-step detail how to install and secure PhpMyAdmin on AlmaLinux.

PhpMyAdmin is a free and open-source tool written in PHP used for managing MySQL databases via browser. It provides a very easy and user-friendly interface, that allows users to easily create databases, create users, tables columns and etc in no time. In this blog post, we are going to install PhpMyAdmin with the LAMP stack.

Installing and securing PhpMyAdmin on AlmaLinux is a straightforward process and may take up to 15 minutes. Let’s get started!

Prerequisites

  • A server with AlmaLinux 20.04 as OS
  • Valid domain pointed to the servers IP address
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

Before we install the LAMP stack we need to update the system packages to the latest version available.

sudo dnf update -y && sudo dnf upgrade -y

Step 2. Install Apache2 Web Server

To install the Apache2 execute the following command:

sudo dnf install httpd -y

To start and enable the apache service, execute the commands below:

sudo systemctl start httpd && sudo systemctl enable httpd

Check the status of the Apache service:

sudo systemctl status httpd

You should receive the following output:

[root@host ~]# sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           └─php-fpm.conf
   Active: active (running) since Sun 2022-07-03 11:11:13 CDT; 8min ago
     Docs: man:httpd.service(8)
 Main PID: 4665 (httpd)
   Status: "Total requests: 2; Idle/Busy workers 100/0;Requests/sec: 0.00409; Bytes served/sec:  20 B/sec"
    Tasks: 213 (limit: 23674)
   Memory: 38.0M
   CGroup: /system.slice/httpd.service
           ├─4665 /usr/sbin/httpd -DFOREGROUND
           ├─4670 /usr/sbin/httpd -DFOREGROUND
           ├─4671 /usr/sbin/httpd -DFOREGROUND
           ├─4672 /usr/sbin/httpd -DFOREGROUND
           └─4673 /usr/sbin/httpd -DFOREGROUND

Jul 03 11:11:12 host.test.vps systemd[1]: Starting The Apache HTTP Server...

Step 3. Install PHP8.0 with extensions

First we need to add the repository for PHP8.0 with the command below:

sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm

Update the system and list the available php modules

sudo dnf update

sudo dnf module list php

You should receive the following output:

Last metadata expiration check: 0:00:33 ago on Sun 03 Jul 2022 07:22:57 AM CDT.
AlmaLinux 8 - AppStream
Name                           Stream                               Profiles                                             Summary
php                            7.2 [d][e]                           common [d], devel, minimal                           PHP scripting language
php                            7.3                                  common [d], devel, minimal                           PHP scripting language
php                            7.4                                  common [d], devel, minimal                           PHP scripting language
php                            8.0                                  common [d], devel, minimal                           PHP scripting language

Remi's Modular repository for Enterprise Linux 8 - x86_64
Name                           Stream                               Profiles                                             Summary
php                            remi-7.2                             common [d], devel, minimal                           PHP scripting language
php                            remi-7.3                             common [d], devel, minimal                           PHP scripting language
php                            remi-7.4                             common [d], devel, minimal                           PHP scripting language
php                            remi-8.0                             common [d], devel, minimal                           PHP scripting language
php                            remi-8.1                             common [d], devel, minimal                           PHP scripting language

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

Select the PHP8.0 with the comands below:

sudo dnf module reset php

sudo dnf module enable php:remi-8.0

sudo dnf install php -y

After sucessfull installation you can check the version with php -v command and receive output similar like this:

[root@host ~]# php -v
PHP 8.0.20 (cli) (built: Jun  8 2022 00:33:06) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.20, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.20, Copyright (c), by Zend Technologies

Step 4. Install MySQL database server

To install MySQL database server execute the following commands:

sudo dnf install mysql-server mysql

Start and enable the mysqld.service with the following commands:

sudo systemctl start mysqld && sudo systemctl enable mysqld

Check the status of the mysqld.service

sudo systemctl status mysqld

You should receive the following output:

[root@host ~]# sudo systemctl status mysqld
● mysqld.service - MySQL 8.0 database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2022-07-03 07:53:36 CDT; 2s ago
 Main PID: 39835 (mysqld)
   Status: "Server is operational"
    Tasks: 38 (limit: 23674)
   Memory: 467.1M
   CGroup: /system.slice/mysqld.service
           └─39835 /usr/libexec/mysqld --basedir=/usr

Jul 03 07:53:23 host.test.vps systemd[1]: Starting MySQL 8.0 database server...

Step 5. Download and Install PhpMyAdmin

Go into the default Apache document root directory and download the PHPMyAdmin:

 cd /var/www/html

wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.zip

Once downloaded extract the zip file and rename it to phpmyadmin.

unzip phpMyAdmin-5.2.0-all-languages.zip

mv phpMyAdmin-5.2.0-all-languages/ phpmyadmin/

Set the right permissions:

chown -R apache:apache /var/www/html/

Now, you can access the phpMyAdmin at http://YOURSERVERIPADDRESS/phpmyadmin/ This way we are not able to secure the URL since it is an IP address and the SSL certificate can not be installed on the IP address. In the next steps, we will explain a bit more about this.

Step 6. Create Apache Virtual Host File

First we need to create Apache virtual host file so we can access the phpMyAdmin via a domain name.

touch /etc/httpd/sites-available/phpmyadmin.conf

Open the file with your favorite editor and paste the following lines of code.

<VirtualHost *:80>
    ServerName yourdomain.com
    DocumentRoot /var/www/html/phpmyadmin
    ErrorLog /var/log/httpd/phpmyadmin_error.log
</VirtualHost>

Save the file, close it and enable the Apache configuration.

ln -s /etc/httpd/sites-available/phpmyadmin.conf /etc/httpd/sites-enabled/

Check the Apache syntax with the command below:

httpd -t

If everything is OK, you should receive the following output:

[root@host html]# httpd -t
Syntax OK

Now, you can restart the Apache service and access your application in browser at http://yourdomain.com

Step 7. Secure the Website with Free Let’s Encrypt SSL certificate

First we need to install the mod_ssl module and the python certbot in order can generate the SSL certificate.

sudo dnf install epel-release mod_ssl -y

sudo dnf install python3-certbot-apache -y

Next we can install the Free Let’s Encrypt SSL certificate with the following command:

sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email admin@yourdomain.com -d yourdomain.com

After successful installation you should see the following output:

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/yourdomain.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/yourdomain.com/privkey.pem
This certificate expires on 2022-10-01.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for yourdomain.com to /etc/httpd/sites-available/phpmyadmin-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://yourdomain.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Now, you can access your website securely at https://yourdomain.com

Congratulations! You successfully installed PhpMyAdmin on AlmaLinux with the Let’s Encrypt SSL certificate. If you find it difficult to complete these steps feel free to contact us anytime you want. We are available 24/7.

If you liked this post on how to install and secure PhpMyAdmin on AlmaLinux, 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 and Secure PhpMyAdmin on AlmaLinux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-and-secure-phpmyadmin-on-almalinux/feed/ 0
Understanding The Linux File Permissions https://linuxhostsupport.com/blog/understanding-the-linux-file-permissions/ https://linuxhostsupport.com/blog/understanding-the-linux-file-permissions/#comments Fri, 15 Apr 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1655 In this tutorial we are going to explain the Linux file permissions in different Linux distributions such as Ubuntu, CentOS, Debian, and AlmaLinux. The Linux file permissions are very important to understand and use properly, due to security reasons and user access rights. The user access rights are controlled by the permissions, attributes, and ownership. […]

The post Understanding The Linux File Permissions appeared first on LinuxHostSupport.

]]>
In this tutorial we are going to explain the Linux file permissions in different Linux distributions such as Ubuntu, CentOS, Debian, and AlmaLinux. The Linux file permissions are very important to understand and use properly, due to security reasons and user access rights. The user access rights are controlled by the permissions, attributes, and ownership. This defines who will be the authorized users and which directories and files will be accessed by them.

In this blog post we will explain the permissions on Ubuntu 20.04 OS. You can choose by yourself which OS to use. Let’s get started!

Prerequisites

  • Fresh install of Ubuntu 20.04
  • User privileges: root or non-root user with sudo privileges

Update the System

If you have a fresh installation of Ubuntu 20.04 it is recommended to update the system to the latest packages available.

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

Understanding Permission Types

The three permission types of the files and folders are read, write, and execute. These permission types controls which user can read the file, write the file or execute the file.

  • Read: The read permission defines if the user can or cannot read the content of the file.
  • Write: The write permission defines if the user can or cannot modify the content of the file or folder.
  • Execute: The execute permission defines if the user can or cannot execute the file. The files with execute permissions are known as script files.

Understanding Permission Groups

The three permissions groups that have every Linux file or folder are owner, group and users. These three groups are asocciated to a file or folder.

  • Owner: The owner permissions are applied only to the owner of the file and folder, and are not related to the actions of the other users. The list of Linux users are stored in /etc/passwd file.
  • Group: The group permissions are applied only to the assigned group of the file and folder, and are not related to the actions of the users. The list of Linux groups are stored in /etc/group file.
  • Other: The other user’s permissions are applied to the other users of the file and folder.

Managing the Permissions

In this section we are going to explain with real examples the permission types and permission groups of a file or folder and the procedure of changing them. For example list the root directory on your server with the following command:

ls -al

You should get the following output:

root@vps:~# ls -al
total 56
drwx------  6 root root  4096 Mar  6 15:53 .
drwxr-xr-x 19 root root  4096 Feb  5 13:27 ..
-rw-------  1 root root    42 Mar  6 15:53 .bash_history
-rw-r--r--  1 root root  3106 Dec  5  2019 .bashrc
drwx------  3 root root  4096 May  4  2020 .cache
drwx------  4 root root  4096 May  4  2020 .config
drwx------  3 root root  4096 May  4  2020 .local
-rw-------  1 root root     0 May  6  2020 .mysql_history
-rw-r--r--  1 root root   161 Dec  5  2019 .profile
-rw-r--r--  1 root root    72 May  3  2020 .selected_editor
drwx------  2 root root  4096 Mar  6 15:27 .ssh

As you can see there is information about if it is a file or directory, about the types and permission groups. To fully understand this pay attention to the following output:

-rw-r--r-- 1 root root 3106 Mar  6  2022 filename
|[-][-][-]-  [---][---][---]
| |  |  | |    |    |    |-----------> 8. Size
| |  |  | |    |    +----------------> 7. Group
| |  |  | |    +---------------------> 6. Owner
| |  |  | +--------------------------> 5. Alternate Access Method
| |  |  +----------------------------> 4. Others Permissions
| |  +-------------------------------> 3. Group Permissions
| +----------------------------------> 2. Owner Permissions
+------------------------------------> 1. File Type

Each write, read, and execute permissions have the following number value:

r (read) = 4
w (write) = 2
x (execute) = 1
no permissions = 0

For example if the permission types of the file are -rw-r–r–, to get the number of this we are going to sum the values of the permissions for that group.

Owner: rw- = 4 + 2 + 0 = 6
Group: r-- = 4 + 0 + 0 = 4
Others: rw- = 4 + 0 + 0 = 4

To change the permission of this file, and set the permissions to 755 for example, execute the command below:

chmod 755 filename

After listing the file again you should receive the following output:

root@host:~# ls -al filename
-rwxr-xr-x 1 root root 3106 Mar  6  2022 filename

To check if the correct number is 755 we are going to check this as explained in the example above:

Owner: rwx = 4 + 2 + 1 = 7
Group: r-x = 4 + 0 + 1 = 5
Others: r-x = 4 + 0 + 1 = 5

At the momment the owner of the file is the root user, and the group is root as well. To change the owner and group execute the command below:

chown www-data:www-data filename

List the file again and pay attention on the output:

root@vps:~# ls -al filename
-rwxr-xr-x 1 www-data www-data 3106 Mar  6  2022 filename

You can see that the owner and the group are set to www-data. Of course, you can set different owner and group to the file as long as that user and group exist in your system.

That’s it. This blog post has explained the basics of Linux File Permission. Of course, if you find it difficult to manage the permissions of the files or folders on your Linux VPS server, you can always contact our epic technical support. They are available 24/7 and they will help you with your request.

If you liked this post about “Understanding the Linux File Permissions”, 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 Understanding The Linux File Permissions appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/understanding-the-linux-file-permissions/feed/ 2
How To Install Drupal 9 CMS on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-drupal-9-cms-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-drupal-9-cms-on-ubuntu-20-04/#comments Mon, 28 Feb 2022 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1639 Drupal is open-source software that has many features, like easy content authoring, reliable performance, and excellent security. With Drupal tools, you can build the versatile, structured content that dynamic web experiences need. As an open-source web content management system (CMS) written in PHP, it is a great alternative to another CSM like WordPress or Joomla. […]

The post How To Install Drupal 9 CMS on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
Drupal is open-source software that has many features, like easy content authoring, reliable performance, and excellent security. With Drupal tools, you can build the versatile, structured content that dynamic web experiences need. As an open-source web content management system (CMS) written in PHP, it is a great alternative to another CSM like WordPress or Joomla. In this tutorial, we will show you how to install Drupal 9 on Ubuntu 20.04 (Focal Fossa).

Prerequisites

  • Ubuntu 20.04
  • root SSH access or a regular user with sudo privileges

1. Log in via SSH and update the system

Log in to your Ubuntu 20.04 VPS with SSH as a root user or as a regular user with sudo privileges

ssh master@IP_Address -p Port_number

Remember to replace IP_Address and Port_Number with your server’s actual IP address and SSH port number respectively.

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

$ lsb_release -a

You should get this output:

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal

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

$ sudo apt update && sudo apt upgrade

2. Install and Configure Web server

Drupal 9 supports many webservers, like Apache, nginx, LiteSpeed, even Microsoft IIS. In this tutorial, we will show you how to install Drupal 9 using apache or nginx on your Ubuntu 20.04. Drupal will be installed in directory /var/www/html/drupal. For this purpose, we need to create the directory.

$ sudo mkdir /var/www/html/drupal

a. apache

If you want to use Apache, run this command to install it from the repository.

$ sudo apt install apache2

Once installed, Apache will run and we can start creating a virtual host.

$ sudo nano /etc/apache2/sites-available/drupal.conf

Paste the following in to /etc/apache2/sites-available/drupal.conf file.

<VirtualHost *:80>
     ServerName drupal.rosehosting.com
     ServerAlias drupal.rosehosting.com
     ServerAdmin admin@otodiginet.com
     DocumentRoot /var/www/html/drupal/

     CustomLog ${APACHE_LOG_DIR}/access.log combined
     ErrorLog ${APACHE_LOG_DIR}/error.log

      <Directory /var/www/html/drupal>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
            RewriteEngine on
            RewriteBase /
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      </Directory>
</VirtualHost>

Save the file then exit from nano editor. To enable the virtual host, let’s run this command:

$ sudo a2ensite drupal

As you can see in the Apache virtual host above, it contains RewriteRule. By default, the Apache mod rewrite in Ubuntu is not enabled. So, we need to enable the module and restart Apache.

$ sudo a2enmod rewrite
$ sudo systemctl restart apache2

b. nginx

If you want to use nginx instead of apache, run this command to install it.

$ sudo apt install nginx

Now, let’s create an nginx server block to proceed with Drupal 9 installation.

$ sudo nano /etc/nginx/sites-enabled/drupal.conf

Paste the following contents in to the file

server {
    listen 80;
    
    root /var/www/html/drupal;

    index index.php index.html index.htm;

    server_name drupal.rosehosting.com;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location = /favicon.ico { log_not_found off; access_log off; }
    location = /robots.txt { log_not_found off; access_log off; allow all; }
    location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
        expires max;
        log_not_found off;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

Save the file then exit.

3. Install Database Server

Drupal 9 requires MariaDB 10.3+ or MySQL/Percona 5.7.8+ or higher, PostgreSQL 10.0 or higher, SQLite 3.26 or higher, the database server is needed to store your Drupal data. In this step, we will install MariaDB from Ubuntu repository.

Run the following command to install the MariaDB server from the official Ubuntu repositories:

$ sudo apt install mariadb-server mariadb-client -y

Once installed, MariaDB will run and it’s already configured to run after reboot, by default.

Next, secure the MariaDB installation using the following command:

$ sudo mysql_secure_installation

This script will set the MariaDB root password, disable remote root login and remove anonymous users as shown below:

Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

4. Create a Database

Login to the MySQL cli as the root user and execute the following commands:

$ mysql -u root -p

You will be prompted for your MySQL root password, you create the password in the previous step. And, once logged in, run these commands.

mysql> CREATE DATABASE drupal9;
mysql> CREATE USER 'drupal9_user'@'IP_address' IDENTIFIED BY 'm0d1fyth15';
mysql> GRANT ALL PRIVILEGES ON drupal9.* TO 'drupal9_user'@'IP_address';
mysql> FLUSH PRIVILEGES;
mysql> \q

Make sure to replace the ‘IP_address‘ is the IP address of your Ubuntu 20.04 server where Drupal 9 will be installed, or you can also use ‘localhost’. Do not forget to replace the PASSWORD ‘m0d1fyth15’ with a stronger and unique one.

5. Install PHP

In this section, we will install PHP 7.4. Rung the command below to install PHP 7.4

$ sudo apt install php7.4 libapache2-mod-php7.4 php7.4-{common,mbstring,xmlrpc,soap,gd,xml,intl,mysql,cli,zip,curl,fpm} -y

If you choose to use Apache, run this command and restart Apache.

$ sudo a2enmod php7.4
$ sudo systemctl restart apache2

If you choose nginx, simply restart nginx after installing PHP 7.4

$ sudo systemctl restart nginx

6. Install Drupal 9

In this section, we will download and install Drupal 9. At the time of writing this blog post, Drupal 9.3.3 is the latest version, you can check it at their release page at https://www.drupal.org/project/drupal. According to their documentation, this Drupal version 9.3.x will receive security coverage until December 8, 2022.

$ cd /var/www/html
$ sudo wget https://ftp.drupal.org/files/projects/drupal-9.3.3.tar.gz

Once downloaded, we need to extract the compressed file.

$ sudo tar xzvf drupal-9.3.3.tar.gz -C /var/www/html/drupal --strip-components=1

Then, change the permissions.

$ sudo chown -R www-data. /var/www/html/drupal

Navigate to http://yourdrupaldomain.com and initiate the installation.

Choose your desired language then click on the save and continue button.

In this article, we choose ‘Standard’ then continue.
If everything is okay, you will be brought to this step. If not, you would want to fix the issues shown in the ‘Verify requirements’ step. Fill the database details in the provided blank fields then click on save and continue button and wait until the installation finishes.

Once completed, you will be brought to the last step to configure your Drupal website.

Fill the details then click on the save and continue button to finalize the installation. And that’s it, you will be automatically redirected to your Drupal website’s backend.

7. Install Free SSL Certificate

In this modern era, it is recommended to secure your website with an SSL certificate. This is not a mandatory step, but it provides secure connections for your Drupal instance.

First, install the Certbot client in your system to manage the SSL:

$ apt install python3-certbot-apache python3-certbot-nginx

Depends on what your webserver is, you can run one of these commands.

$ sudo certbot --apache
$ sudo certbot --nginx

Follow the steps when installing a free SSL certificate from Let’s Encrypt. You would see the output similar to this:

master@ubuntu20:~# sudo certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: a
There seem to be problems with that address. Enter email address (used for
urgent renewal and security notices)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: n

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Choose the domain/subdomain your are installing Drupal 9 for, and certbot will install the SSL certificate for it. You can also choose whether to redirect the HTTP traffic to HTTPS or not.

That’s it! You have successfully installed Drupal 9 on your Ubuntu 20.04 machine.

Of course, you don’t have to install Drupal 9 on your Ubuntu 20.04 server if you have a server with us, in which case you can simply ask our expert Linux hosting admins to set all of this up for you, quickly and easily. They are available 24×7 and will respond to your request immediately.

PS. If you liked this post, please share it with your friends on the social networks using the buttons below, or simply leave a comment down in the comments section. Thank you.

The post How To Install Drupal 9 CMS on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-drupal-9-cms-on-ubuntu-20-04/feed/ 4
Why Using A Python Virtual Environment Is A Good Choice? https://linuxhostsupport.com/blog/why-using-a-python-virtual-environment-is-a-good-choice/ https://linuxhostsupport.com/blog/why-using-a-python-virtual-environment-is-a-good-choice/#comments Tue, 15 Feb 2022 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1642 Imagine yourself walking into a grocery store for a specific item. However, to your surprise, there is absolutely no organization within the entire store—no way to distinguish between products; no way to tell what product is for what purpose; simply no way to find your item. You go to the counter and ask the grocer […]

The post Why Using A Python Virtual Environment Is A Good Choice? appeared first on LinuxHostSupport.

]]>
Imagine yourself walking into a grocery store for a specific item. However, to your surprise, there is absolutely no organization within the entire store—no way to distinguish between products; no way to tell what product is for what purpose; simply no way to find your item.

You go to the counter and ask the grocer where the specific product is, but all he tells you is to “search for it.”

Now, what do you do? The only option left for you is to find the item you so desperately want on your own by searching every product in the store.

This grocery store is your computer, your Python package bin. All those disorganized products lying on the shelf are the endless torrent of packages you have installed over the years for your random projects.

The next time you start a project or install some software, you will not understand if the version is up to date, if it collides with another package or python version, or if the package exists at all. Such disorganization can cause setbacks, and that not only disrupts your project but takes away the valuable moment that otherwise could have been used for something more productive.

So what is the solution? Python Virtual Environment.

Python Virtual Environments (virtualenvs) helps decouple and isolate versions of Python and their related pip versions. This authorizes end-users to install and manage their own set of software that is independent of those provided by the system.

One of the primary advantages of using Python is its active developer community and availability of many software packages on pypi.org.

What Is A Python Virtual Environment?

A Python Virtual Environment or virtualenvs is nothing but a directory having a specified structure. It consists of a subdirectory, also called bin_subdirectory, that is connected to a Python interpreter and other subdirectories that hold software installed within the virtual environment.

When imploring the Python interpreter by using the way to the bin subdirectory of virtualenv, the Python interpreter perceives the way to use the related software in the virtualenv (as contrasting to any software installed adjacent to the Python interpreter’s actual place). It is this perspective that virtual environments are virtual and not in the way you know it. They are not virtual like a simulated machine.

You can immediately use it when you set up a virtualenv by imploring Python and applying the complete route to the subdirectory_bin. ( for e.g., my_venv/bin/python3 my_program.py).

For ease, when you set up a virtual environment, it gives you an activated script that you can implore and which will allow you to set the subdirectory bin for your virtual environment initially on your route (simultaneously it upgrades your shell cue and informs you that the change is accomplished).

When your virtualenv is set in motion, you are no longer required to use the full trail to the Python interpreter ( for e.g., my_venv/bin/python3 my_program.py).

Important to remember: If you are imploring the Python script with the complete trail to the Python interpreter in the simulated domain, it will run in the simulated domain despite not being there in a collaborative session where you have used the activate command. This is particularly helpful for Bash scripts and cron jobs, where triggering the virtualenv is problematic.

Should You Always Use A Virtual Environment?

Yes, always.

With a virtual environment, you have complete control over the environment. You would know the package versions that are required to be updated and what versions are installed. Virtual environments give you a replicable and stable environment.

You have complete control over the versions of Python used, the installed packages, and their scheduled upgrades. In fact, the modern versions of the Python support virtual environments over the boundary. Having said that, it is not the only way to maintain a replicable environment. There are other options like using Conda in the home directory or project space that is also available on the CS system.

If you need to have a say on your updates to new packages of Python, all you need is to create your own Python interpreter and create a virtual world based on the interpreter. By this process, you can disengage the servers from the “System Python” update schedule.

There is, however, an exception to using a virtual environment. Suppose you have a simple program that only uses modules from the Python Standard Library (i.e., no third-party modules that would need a pip install). In such a case, you might contemplate not using a simulated environment.

Python has various modules and versions for different applications. A project may require a third-party library, which is installed. Another project also uses a similar directory for retrieval and storage but doesn’t require third-party software. So, the simulated environment can come into play and create a different secluded environment for both the projects, and each project can store and retrieve packages from their specific environments.

Let us consider another scenario where you are creating a web application using Django. Let’s say you are developing two projects, project A and project B.

If project A uses Django 2.2 and project B uses Django 3.2, they would be accumulated in the same directory with the same name, and then an error may occur. In such cases, virtual environments can be really helpful for you to maintain the dependencies of both environments.

Virtual environments aid in these problems by creating unique, isolated environments where all the packages and versions you install only apply to that particular environment. It is like a private island – but for code. Anything that happens on this island doesn’t affect your mainland, and anything that occurs on the island does not.

Once you are done staying on the island, come back to the mainland. In other words, you can come back to the original environment once you are done working on the projects.

Now, let us know more about the pros and cons of Python Virtual Environment:

Python Virtual Environment: Pros And Cons

Pros:

  • You can use any package of Python you want for a particular environment without having to worry about collisions.
  • You can arrange your packages much better and know exactly which packages you need to run your code in case someone else wants to run the code on their machine.
  • Your main Python versions directory does not get flooded with unnecessary Python packages.
  • Comes in stock with Python, and no extra tools are required.
  • Builds a primary virtualenv that works with almost all the tools: requirements.txt supports every domain manager using command pip.

Cons:

  • It acknowledges the software that is installed: builds a domain with the help of everything that had invoked Python to build it, so you are still in the loop of manually controlling the versions of Python.
  • No whistles and no bells but only the installable_ pip in the domain

Conclusion

Virtual environments are of great advantage when working on different projects. If your project is not package-dependent, there is no need for isolated versions and packages. Still, if your project requires even a few packages, there is nothing you can do without the help of virtual environments.

The post Why Using A Python Virtual Environment Is A Good Choice? appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/why-using-a-python-virtual-environment-is-a-good-choice/feed/ 2
How to Install Laravel on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-laravel-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-laravel-on-ubuntu-18-04/#comments Wed, 21 Apr 2021 16:50:11 +0000 https://linuxhostsupport.com/blog/?p=1378   1. Connect to your server To connect to your server via SSH as user root, use the following command: ssh root@IP_ADDRESS -p PORT_NUMBER and replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number. Once logged in, make sure that your server is up-to-date by running the following commands: apt-get […]

The post How to Install Laravel on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
 

1. Connect to your serverinstalling laravel on ubuntu 18.04

To connect to your server via SSH as user root, use the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

and replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number. Once logged in, make sure that your server is up-to-date by running the following commands:

apt-get update
apt-get upgrade

2. Install the MySQL Database server

MySQL is an open-source database management system. To install MySQL, run the following command:

$ apt-get install mysql-server

This will install MySQL 5.7 on your server. In order to improve the security of your MySQL server, we recommend that you run the mysql_secure_installation script by typing the following command:

mysql_secure_installation

This script will help you to perform important security tasks like setting up a root password, disable remote root login, remove anonymous users, etc.

3. Create a database for Laravel

Now, we will create our MySQL database for our Laravel site. Login to your MySQL server with the following command and enter your MySQL root password:

mysql -u root -p

In this section, we will create a new MySQL database laravel and assign user access to it to a new user admin_user with password Strong_Password

CREATE DATABASE laravel;
GRANT ALL PRIVILEGES ON laravel.* TO 'admin_user'@'localhost' IDENTIFIED BY 'Strong_Password';
FLUSH PRIVILEGES;
exit;

Don’t forget to replace ‘Strong_Password’ with an actual strong password.

4. Install PHP and required PHP modules

To install the PHP and all necessary modules, run:

sudo apt-get install php-cli php-mcrypt php-mbstring php-zip php-opcache php-gd php-xml

5. Install Composer

A composer is a dependency manager for PHP and of course Laravel, which you can install packages with. The composer will pull all the required libraries you need for your project.

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

6. Install Laravel

Install the latest version of Laravel, using the composer create-project command:

sudo composer create-project --prefer-dist laravel/laravel my_project

If the installation is successful, you will see the following lines:

Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Package manifest generated successfully.
> @php artisan key:generate
Application key [base64:NEu4D2s1Ai8HHZL3wPnrl+BVpSmcm7dMTStIBtMgSn0=] set successfully.

By default, Laravel is configured to use MySQL(MariaDB), but you need to give it the right information to connect to the database that you just set up. Next, go to the /var/www/Html/my_project/config directory, open the database.php file with your favorite text editor, for example:

nano database.php

And update the database settings, replacing them with your own details:

 'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'yourDBName'),
            'username' => env('DB_USERNAME', 'yourUserName'),
            'password' => env('DB_PASSWORD', 'yourPassword'),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],

7. Server your application with Artisan serve command

Once the installation is completed you can use the artisan serve command to serve your application:

php artisan serve

The output should be something like this:

Laravel development server started: <http://127.0.0.1:8000>

You can now open your browser and access your new Laravel installation at: http://127.0.0.1:8000

8. Install and configure Apache webserver

In this part of the tutorial, we will show you how to install and configure Apache to serve your Laravel application. Run the following command to install Apache webserver from the official Ubuntu repositories:

apt-get install apache2

Change the ownership of the Laravel directory to the webserver user:

chown -R www-data:www-data /path/to/laravel
chmod -R 755 my_project/storage/

Create a new Apache virtual host with the following content:

sudo nano /etc/apache2/sites-available/your_domain.com
<VirtualHost *:80>
ServerName your_domain.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/my_project/public

<Directory /var/www/html/my_project>
AllowOverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Activate the virtual host by creating a symbolic link :

sudo ln -s /etc/apache2/sites-available/your_domain.com /etc/apache2/sites-enabled/your_domain.com
 

Your Laravel installation is now complete.  You have successfully installed Laravel on your Ubuntu 18.04 VPS. Visit the domain name with a web browser you will see the Laravel default page.   That’s it. If you followed all of the instructions properly now you should be able to access your Laravel installation on your Ubuntu 18.04 server.

 

installing laravel on ubuntu 18.04If you are one of our web hosting customers, and use our optimized Laravel Hosting, you don’t have to install Laravel on Ubuntu 18.04, our expert Linux admins will set up and optimize your Laravel VPS, for you. They are available 24×7 and will take care of your request immediately. As a Laravel developer, you should be focusing on Laravel development and improving your code and leave the server work to us. PS. If you liked this post, on how to install Laravel on Ubuntu 18.04, please share it with your friends on the social networks using the buttons below or simply leave a comment in the comments section. Thanks.

The post How to Install Laravel on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-laravel-on-ubuntu-18-04/feed/ 3
How to List Users in Linux https://linuxhostsupport.com/blog/how-to-list-users-in-linux/ https://linuxhostsupport.com/blog/how-to-list-users-in-linux/#respond Wed, 18 Dec 2019 08:37:34 +0000 https://linuxhostsupport.com/blog/?p=1022 In this tutorial, we’ll be going over how to list the users that have been created on your Linux system. This applies for all distributions, and is very easy to do. The users on your system can be either normal “human” users or system users. The normal users are usually other people that can log […]

The post How to List Users in Linux appeared first on LinuxHostSupport.

]]>
In this tutorial, we’ll be going over how to list the users that have been created on your Linux system. This applies for all distributions, and is very easy to do.

The users on your system can be either normal “human” users or system users. The normal users are usually other people that can log in and interact with your server, while the system users are used to start non-interactive background services. You might even create users for certain software platforms to have a user that grants them access to certain files and directories. Let’s begin.

Step 1. Connect to your server

To connect to your server via SSH as the root user, use the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

and replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number. Of course, you can also replace root with the username of any user you’d like, as all users can view the list of users on the system.

Step 2. The /etc/passwd file

In Linux, there isn’t any specific command that can list all users in your system. However, there is still a way to extract this information from our system. One important file that stores user information in your system is the /etc/passwd file.

The /etc/passwd file is a text file that stores all of the required information about all of the users that exist on our system.
Each entry in this file can have up to seven fields (separated by the colon “:” symbol) and each field contains some important information about that user. Here is an example of one entry for a user called “linux-user” stored in /etc/passwd:

linux-user:x:1000:1000:Linux User:/home/linux-user:/bin/bash

And here is an explanation of each of the fields in this entry:

  1. Username – this is the name of the user, in our example “linux-user”
  2. Password: this field contains the encrypted password of the user, marked with “x”. The encrypted password is stored in the /etc/shadow file in our system and can only be accessed by the root user.
  3. User ID number (UID) – this field contains a unique number for each user. The number 0 is reserved for the root user
  4. Group ID number (GID) – this is the ID number of the group, which is stored in the /etc/group file
  5. User Info: this field contains all additional user information such as the user’s real name, phone numbers and other information.
  6. Home Directory: this field contains the path of the user’s home directory. In our example, the home directory of the “linux-user” user is /home/linux-user
  7. Login shell: this field contains the path of the user’s login shell, for example /bin/bash

3. List all users on your Linux system

Now that we know about the existence of the /etc/passwd file and the information it contains, we can simply use the cat command to print all the contents of this file. You can then look at the first field of each entry which shows the name of each user in your system:

cat /etc/passwd

Output example:

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
. . .
. . .
sshd:x:104:65534::/var/run/sshd:/usr/sbin/nologin
mysql:x:109:114:MySQL Server,,,:/nonexistent:/bin/false
linux-user:x:1000:1000:Linux User:/home/linux-user:/bin/bash

If you want to list only the first field for each user, which contains the actual username, you can use the cut or the awk command. For example:

cut -d: -f1 /etc/passwd

or

awk -F: '{ print $1}' /etc/passwd

Both commands will give you the following output:

root
daemon
bin
sys
sync
games
man
lp
mail
. . .
. . .
sshd
mysql:
linux-user

Another way to list all users in your Linux system is with using the getent command.

The getent command displays all entries from databases supported by the Name Service Switch libraries, which are configured in /etc/nsswitch.conf

This file also contains the passwd database, so you can now use the following command again where you will get the list of all entries included in the passwd database:

getent passwd

How to Find if a Specific User Exists in Your System

Instead of listing all users, you may also want to check if any specific user exists on your Linux server. To do this, you can combine one of the previous commands with the grep command. For example, if you want to check whether the “linux-user” user exists on your server, you can type the following command:

cat /etc/passwd | grep linux-user

If the user exists, the following output should be displayed on your screen:

linux-user:x:1000:1000:Linux User:/home/linux-user:/bin/bash

By this point, you now know how to see what users exist on your server, as well as search for a specific user on your server.


Of course, if you are using one of our Managed VPS Support services, you can simply ask our expert Linux admins to help you and give you a list of all users on your Linux VPS, along with any other system-related questions or requests. They are available 24×7 and will take care of your requests immediately.

PS. If you liked this post on how to list all users in Linux, please share it with your friends through social media by using the share shortcuts, or simply leave a comment below. Thanks.

The post How to List Users in Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-list-users-in-linux/feed/ 0
How to Install Nextcloud 12 on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-nextcloud-12-on-an-ubuntu-16-04-vps/ https://linuxhostsupport.com/blog/how-to-install-nextcloud-12-on-an-ubuntu-16-04-vps/#comments Wed, 02 Aug 2017 20:49:19 +0000 https://linuxhostsupport.com/blog/?p=158 Today we will show you how to install Nextcloud on  Ubuntu 16.04, using Apache web-server and MySQL database. Nextcloud is open source self-hosted file sync and share application forked from ownCloud. It has a lot of extra Calendar, Sync and Contacts features, apart from their file hosting features and it is a great free alternative to […]

The post How to Install Nextcloud 12 on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
Today we will show you how to install Nextcloud on  Ubuntu 16.04, using Apache web-server and MySQL database.

Nextcloud is open source self-hosted file sync and share application forked from ownCloud. It has a lot of extra Calendar, Sync and Contacts features, apart from their file hosting features and it is a great free alternative to some popular services such as Google Drive, Dropbox, Box, etc.

It is fairly easy to install Nextcloud on an Ubuntu 16.04 VPS. The installation process should take about 5-10 minutes if you follow the very easy steps described below.

At the time of writing this tutorial, Nextcloud 12.0.0 is the latest stable version available and it requires:

– Apache web server;
– PHP (5.6 or higher) along with the mbstring, curl, zip, xml, tidy, gd and mcrypt extensions. They are most generally active by default on a standard php installation.
– MySQL(version 5.5 or higher) installed on your Linux VPS;

 

1. Getting Started

First of all login to your Ubuntu 16.04 VPS via SSH as user root

ssh root@IP_address

At the very beginning, it is best to start a screen session by executing the following command

screen -U -S nextcloud

Update the system:

apt-get update && apt-get -y upgrade

Make sure to always keep your server up to date.

2. Install MariaDB 10.0

To install MariaDB, run the following command:

apt-get install -y mariadb-server

Next, we need to create a database for our Nextcloud installation.

mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE nextcloud;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'your-password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Do not forget to replace ‘your-password’ with a strong password.

3. Install Apache2 web server

[user]$ sudo apt-get install apache2

4. Install PHP and required PHP modules

To install the latest stable version of PHP version 7 and all necessary modules, run:

[user]$ sudo apt-get install php7.0 libapache2-mod-php7.0 php7.0-mbstring php7.0-curl php7.0-zip php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-bcmath php7.0-xml php7.0-json php7.0-tidy

5. Configure Apache Web Server

Enable the Apache2 rewrite module if it is not already done:

[user]$ sudo a2enmod rewrite

6. Restart Apache Web Server

In order to activate the new configuration, restart the Apache web server using the following command:

[user]$ sudo service apache2 restart

7. Download and Extract Nextcloud

Download and extract the latest version of Nextcloud on your server:

[user]$ sudo cd /opt && wget wget https://download.nextcloud.com/server/releases/nextcloud-12.0.0.zip
[user]$ sudo unzip nextcloud-12.0.0.zip
[user]$ sudo mv nextcloud/ /var/www/html/

8. Configure File Ownership

All files have to be readable by the web server, so we need to set a proper ownership

[user]$ sudo chown www-data:www-data -R /var/www/html/nextcloud/

9. Create Virtual Host in Apache

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘nextcloud.conf’ on your virtual server:

[user]$ sudo touch /etc/apache2/sites-available/nextcloud.conf
[user]$ sudo ln -s /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-enabled/nextcloud.conf
[user]$ sudo nano /etc/apache2/sites-available/nextcloud.conf

Then, add the following lines:

<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
DocumentRoot /var/www/html/nextcloud/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/html/nextcloud/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>

10. Restart Apache Web Server

Restart the Apache web server for the changes to take effect:

[user]$ sudo service apache2 restart

11. Complete the Nextcloud Installation via Web Browser

Open your favorite web browser, navigate to http://your-domain.com/ and if you configured everything correctly the Nextcloud installer should be starting. You should follow the easy instructions on the install screen inserting the necessary information as requested.

That is it. The Nextcloud installation on Ubuntu 16.04, is now complete.

Of course, you don’t have to install Nextcloud 12 on Ubuntu 16.04, if you use one of our Software Installation Services, in which case you can simply ask our expert Linux admins to install Nextcloud 12 on Ubuntu 16.04, for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on how to install Nextcloud 12 on Ubuntu 16.04,  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 Nextcloud 12 on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-nextcloud-12-on-an-ubuntu-16-04-vps/feed/ 4
What is Help Desk Support? https://linuxhostsupport.com/blog/what-is-help-desk-support/ https://linuxhostsupport.com/blog/what-is-help-desk-support/#respond Wed, 21 Jun 2017 14:11:07 +0000 https://linuxhostsupport.com/blog/?p=128 Help desk support, most commonly, is a way of providing IT support to end-users (customers). For Linux server management companies, help desk support often involves resolving issues related to a customer’s Linux server or a service running on that Linux server. To help you understand what help desk support is, we’ll answer a few frequently […]

The post What is Help Desk Support? appeared first on LinuxHostSupport.

]]>
Help desk support, most commonly, is a way of providing IT support to end-users (customers). For Linux server management companies, help desk support often involves resolving issues related to a customer’s Linux server or a service running on that Linux server. To help you understand what help desk support is, we’ll answer a few frequently asked questions related to help desk support.

How is help desk support implemented?

Depends on a particular business or service provider, but most often than not, help desk support is implemented via a “client area” where clients and customers can post tickets and request technical (help desk) support from the provider. Help desk support can also be provided via phone or in person, but the most common way of implementing helpdesk support, especially in IT, is via email (tickets) and online live chat.

Do I really need help desk support?

Yes! Even if you are experienced in the software/service you’re using, it’s still nice to have someone to fall back on when you get stuck. A professional technical support team can always come in handy when you’re running into issues you cannot solve.

If you’re new to the software/service you are using, then you definitely need help desk support.

How do I check if someone offers help desk support?

Most (if not all) companies with commercial software or commercial services offer 24/7 technical (helpdesk) support. You can always check their website for any support/helpdesk/client/contact areas.

Some companies offer professional (outsourced) help desk support on a per-incident basis. You can use those kinds of services if you use a service or an app that doesn’t have official technical support, or if they have an incompetent technical support team.

Example: we offer Linux server management services and Linux server support. If you own a Linux server and need help with it, you can use our support services and we’ll help you with your Linux server, regardless of where you’ve purchased the Linux server from.

What are the benefits of using helpdesk support?

There are quite a lot of benefits to it, but we’ll go over the main ones:

  • Support by professionals. Every helpdesk support team is experienced and trained in what they are offering support for, so you know you’ll always get professional help from people that know what they are doing.
  • Help when you need it. Most companies offer 24/7 support. However, some companies don’t offer 24/7 support and their wait times can be quite lengthy, so always choose providers that offer 24/7 support. If they don’t and you still decide to use them, you can always use outsourced support or get support by a third-party.
  • Saves you money. By using the company’s (or an outsourced) helpdesk support, you take away the need of having a dedicated technical support team for your company only. Finding the right employees and training them for the products/services you are using can be both costly and difficult to do.

Knowing all of that, it should be clear what help desk support is and other basics you need to know about help desk support.

If you want to learn, what server management is, read this.

 

The post What is Help Desk Support? appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/what-is-help-desk-support/feed/ 0
What is Server Management? https://linuxhostsupport.com/blog/what-is-server-management/ https://linuxhostsupport.com/blog/what-is-server-management/#comments Wed, 07 Jun 2017 13:49:24 +0000 https://linuxhostsupport.com/blog/?p=100 We’ll explain to you, What is Server Management? Like many other terms in the server management and managed services industry, server management is vaguely used and can mean different things when used by different server management service providers. Some companies may offer a set of managed support services in their server management plan, but a different […]

The post What is Server Management? appeared first on LinuxHostSupport.

]]>
We’ll explain to you, What is Server Management? Like many other terms in the server management and managed services industry, server management is vaguely used and can mean different things when used by different server management service providers.

Some companies may offer a set of managed support services in their server management plan, but a different company may offer a completely different set of services. Although there are some guidelines and definitions that still hold true for any managed service provider.

This article will guide you through what server management is, who needs it and why you should use it. After our intro, you should have a solid understanding of the basics.

Broad definition of server management

Server management can be defined as the tasks and services that are done on a server in order to manage it. This usually entails:

  • Monitoring of the server and apps running on the server. Checking their status, uptime, and monitoring for any new or recurring issues.
  • Updating the server and software installed on the server. Although most server management companies offer this as part of their services, some still don’t. Nevertheless, it’s still considered as part of the ‘server management’ process.
  • Setup and configuration. The actual server setup and configuration of software and services running on the server. Again, this may not be a part of the server management plan offered by some companies, but it most often is.
  • Other. This is where the issue in defining what server management actually is arises. Every provider offers totally different services, although they are still considered as part of the server management process, they are not the same among several different providers and thus cannot be considered as the “default” definition of server management.

As an example, you can check our Server Management Services.

Who needs and uses server management?

Everyone that owns a server needs server management. Some people do the server management themselves (often called “self-managed”), and some people get professional server management services.

The most common users of managed service providers are:

  • Companies.
  • Web Developers and Web Designers.
  • Beginners that own servers.
  • Anyone that likes to leave the server worries to someone else.

There are many benefits of using server management services (listed below) and anyone should and can use such services.

Why you should use server management services?

The reasons why you should use server management services are the same with the actual benefits of using them.

What is Server Management

Benefits of server management services

  • Server work done right, by experts. You should always leave the server work to professionals that do it on a daily basis and have the experience, skills, and know-how of managing servers. That way you get your peace of mind knowing that your server is managed properly by people who know what they are doing.
  • Fewer costs. Instead of hiring a full-time system administrator (which can be quite costly), you can get a server management plan and save hundreds (if not thousands) of dollars on a monthly basis. Some server providers offer a ‘managed service’ as an add-on to their servers, but it often is much more expensive than getting managed services from a 3-rd party provider.
  • Fewer worries. Why should you worry about updates and security of your server 24/7 when you can have experts taking care of your server? No need to stay updated on the latest security patches and releases, your server will be taken care of.
  • Quick(er) turnaround time. Depending on the provider itself and the experience of the sysadmins involved, the turnaround time for server issues and tasks is fairly quick. So instead of wasting hours on troubleshooting and research, you can have experts work on your server and fix any issues in a matter of minutes. This still depends on the severity and complexity of the issue itself, but when compared, having expert server managers working on your server is far quicker than doing it yourself.
  • 24/7 availability. Most server management companies are available 24/7 (at least we are) and this is closely related to the quick turnaround time. It’s 3 AM in the middle of the night on a Saturday? No problem. We are available and ready to help.

Knowing what server management is and the benefits of using it, you should seriously consider getting a monthly server management plan, and experience the benefits yourself.

 

The post What is Server Management? appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/what-is-server-management/feed/ 5
Open source sysadmin tools we use on a daily basis https://linuxhostsupport.com/blog/open-source-sysadmin-tools-we-use-on-a-daily-basis/ https://linuxhostsupport.com/blog/open-source-sysadmin-tools-we-use-on-a-daily-basis/#comments Fri, 24 Feb 2017 13:27:18 +0000 https://linuxhostsupport.com/blog/?p=19 Being a Linux system and network administrator requires a lot of time and dedication. Sysadmins usually have hundreds of tasks they need to do every day, some of which may be repetitive. This is where the sysadmin tools come in handy. There’s an open source application for just about anything. You can get a lot […]

The post Open source sysadmin tools we use on a daily basis appeared first on LinuxHostSupport.

]]>
Being a Linux system and network administrator requires a lot of time and dedication. Sysadmins usually have hundreds of tasks they need to do every day, some of which may be repetitive. This is where the sysadmin tools come in handy. There’s an open source application for just about anything. You can get a lot more work done if you’d automate repetitive tasks and manage your time properly. If you are in tech support, you’ll most likely use and support hundreds if not thousands of different software and applications. Managing all of them at the same time, or with even just a small number of them can be difficult if you don’t use the proper tools.

At LinuxHostSupport, we use a lot of open source tools to help our admins with their work, but we’ll focus on the best and those that will most likely be useful to other Linux admins too. We’ll list out some command line tools and open source software we use on a daily basis and the reason why we are using them. Note that we frequently try and test new tools, so our current setup may be different than the one written in this post. You may get an idea out of this. The way we use a certain software, script or application may not be the way it was intended to be used, but when you are a sysadmin you get creative and think out of the box.

Being responsible for so many servers is something that we as system administrators thrive on. However it sure knows to be stressful and among others things, it requires problem-solving skills, competence, and perseverance, the latter especially in situations where you are about to go berserk because you can’t seem to find a solution for a client’s unreachable website in the middle of a planned marketing campaign and sale.

During debugging there are many command line tools that can be used to narrow down the possible solutions for a problem. Of course, every system admin out there has his/her own set of preferred commands and tools of use and it is really a matter of personal choice. Having said that, in this post, we will share the tools that we mostly use on a daily basis when handling and troubleshooting system, network and DNS related problems.

The day to day tasks and responsibilities that every system admin has involve constantly monitoring the network and the systems that use the network, ensuring their stability and reliability in the process. We will use examples to explain a problem with a website, server or service and the tool that we use to debug and eventually solve the problem.

Command line tools

So let’s start with one of the basic commands for network troubleshooting, ping. Using the “ping” command is the best way to test connectivity between a source computer and a specified destination computer. Ping uses ICMP (Internet Control Message Protocol) to communicate to other devices. You can use ping in many ways, for example, if you want to check the IP address that LinuxHostSupport.com resolves to, you can use:

# ping linuxhostsupport.com

The output will show the IP address of the domain, the round trip time, the packets loss value and the approximate round trip time.

The traceroute command is a network troubleshooting utility which shows the number of hops taken to reach a destination while determining the packets traveling path. So if for example, you cannot open a certain website and you are sure that the website is online for others, you can use the traceroute command to check if there is any packet loss along the way.

For a website to be shown in your web browser, the DNS records for that domain have to be correct. The domain must be pointed to the server where the data for the website is hosted. So when troubleshooting an inaccessible website we use the dig command.

dig (domain information groper) is a network administration command-line tool for querying Domain Name System (DNS) name servers.

So, for example, to query a domain A record from the Google public DNS server, we will use:

# dig A www.example.com @8.8.8.8

The answer will provide us with information that will help us narrow down the possible reasons on why the website is offline. If for example the domain is not pointed correctly or at all, we will know that the problem is an inaccurate DNS record. Then we will take the required measures or inform the domain owner of the solution.

Another useful tool that most sysadmins use is: find. It is a Linux command that can be used to search for files or a specific text string in a file or files.

To search for a specific file the below command can be used:

# find ./rosehosting -name “linuxvps.txt”

or if you need to find hidden files:

# find ~ -type f -name ".*"

The find command can find usage in multiple scenarios and it helps sysadmins significantly speed up the search for a file, directory or string in files.

A VPS has its own dedicated resources. Monitoring the server resource usage can be accomplished using the top command which provides a dynamic real-time view of the running system. It displays system summary information with a list of processes or threads currently being managed by the kernel.

What happens if you type top in your command line interface? You will get a display similar as the one in the image below, of course with your server’s current resource usage and processes.

top command

When in need of checking a server network connections (both incoming and outgoing), routing tables, and a number of network interfaces, the netstat command can be used. You can use this command in many scenarios for different problems or inspections. Let’s say that we need to see all active connections and the TCP and UDP ports on which the server is listening. We will type:

# netstat -anlp

The output will show us all the ports that the server services listen on and will list all the active connections.

In certain cases where we needed to access a website from a terminal, we used elinks. It is a free text-based console web browser for Unix-like operating systems that renders both frames and tables and is highly customizable.

And last but not least tcpdump. It is a great packet analyzer that can be used to display TCP/IP and other packets being transmitted or received over a network. With tcpdump we analyze the packets’ content on a network interface with matched flags and boolean expressions.

These commands that we listed above, albeit great are not the only ones that we and sysadmins over the world use on a daily basis. Also, their usage is just a glimpse of the possibilities they offer and due to the nature of this brief informative post, we covered only the basics.

A lot of code editors

Code editors. There are so many out there! Vim, Nano, Brackets, Atom, Visual Studio Code… Every editor is highly customizable and has lots of plugins available. We use different code editors – we can’t really pick a favorite since everyone uses a different editor for different purposes. Nevertheless, a more powerful and flexible code editor is a must-have for every sysadmin, and you have a lot of open source code editors to choose from. There are even some great browser based code editors.

Nagios

Working with tons of servers requires careful monitoring of their services and reliability. A handy, no scratch that, a very handy monitoring software that we use on a daily basis is Nagios. Nagios is a robust, open source and very powerful monitoring system that monitors systems, networks and infrastructure. It offers monitoring and alerting services for servers, switches, applications and services. Nagios watches what you’ll set it to monitor and then alerts you when things go wrong until the problem is resolved after which again, alerts for a second time that the problem is gone.

Few of Nagios standout features are:

  • Simple installation;
  • Flexibility
  • Scalable;
  • Easy to use and navigate interface;
  • A plethora of plugins;
  • Alert system and event handlers that help with problem-solving;
  • Reporting system;
  • Available data graphing plugins;
  • Parallelized service checks;
  • Flat-text formatted configuration files;
  • Automatic log file rotation and much more…

Nagios is quite powerful and flexible, however, the learning curve can be high. The initial setup and configuration usually takes a lot of work, but once you get a hold of it and become familiar with how it works and what it can do for you, you’ll never stop using it.

Of course, there are some other great monitoring services such as Zabbix, Icinga, Cacti, Observium Sensu etc.

Ansible

Ansible is a simple but powerful automation tool written in python that automates provisioning, application deployment, and configuration management. With Ansible you do not need to deploy agents on the remote machines, all you need is ssh access to your servers. We are big fans of Ansible because of its simplicity, speed and easy learning curve.

Nextcloud

Sometimes you need to synchronize and share valuable files or maybe you just need your privacy. With Nextcloud, you can share files, calendars, contacts, mail and more on a self-hosted, private server. It’s highly configurable and you get to keep your privacy when you share data in your own cloud. We find great usage in Nextcloud and they are contsantly updating the software with lots cool new features.

 

What open source tools do you use? Leave a comment below, we’d love to hear about them. We may publish another similar post, as we use a lot of other apps and open source software.

PS. If you liked this post, please share it with your friends on the social networks using the buttons below or simply leave a comment. Thanks.

The post Open source sysadmin tools we use on a daily basis appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/open-source-sysadmin-tools-we-use-on-a-daily-basis/feed/ 2