Tutorials | LinuxHostSupport https://linuxhostsupport.com/blog/category/tutorials/ Linux Tutorials and Guides Tue, 09 Jul 2024 12:52:44 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 How to stop Receiving Spam Emails on Linux with SpamAssassin https://linuxhostsupport.com/blog/how-to-stop-receiving-spam-emails-on-linux-with-spamassassin/ https://linuxhostsupport.com/blog/how-to-stop-receiving-spam-emails-on-linux-with-spamassassin/#respond Thu, 15 Aug 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2153 In the ongoing struggle against unwanted communication there are many technologies and strategies on how to stop receiving spam emails. One highly effective way for Linux users is the open-source Apache SpamAssassin project, offering a highly-effective and free anti-spam platform. In this article, we’ll teach you exactly how to stop receiving spam emails on Linux […]

The post How to stop Receiving Spam Emails on Linux with SpamAssassin appeared first on LinuxHostSupport.

]]>
In the ongoing struggle against unwanted communication there are many technologies and strategies on how to stop receiving spam emails. One highly effective way for Linux users is the open-source Apache SpamAssassin project, offering a highly-effective and free anti-spam platform.

In this article, we’ll teach you exactly how to stop receiving spam emails on Linux with SpamAssassin.

What is SpamAssassin and how it works

Spamassassin is a tool that scores spam emails by comparing them against various tests. It uses a header (X-Spam-Status:) marked with a number ranging from 0-5, with a setting of 3.5 being safe enough to reduce false positives and the amount of SPAM that makes it through. A SPAM score is calculated from multiple characteristics, ranging from 0 to 5, and has been effective for years. Spamassassin is a helpful tool for filtering spam emails. In this tutorial, we’ll learn how to integrate this filter into our Postfix server.

Prerequisites

  • An up-to-date Linux system
  • Postfix installed on your system
  • Root access to your server

Installing SpamAssassin

The installation of SpamAssassin service is easy to do. We accomplish it with the following command:

sudo apt-get install spamassassin # Ubuntu
sudo yum install spamassassin # AlmaLinux

After installing the service, we must integrate it with the Postfix mail server. To accomplish that, we’ll follow the next topic.

Configuring Spamassassin with Postfix

The main configuration file from Spamassassin is generally located at /etc/spamassassin/local.cf. There, you’ll find the required_score part, which sets what is spam and what is not. You can keep it as 5 and uncomment the line if it’s commented:

required_score 5.0

If you need to whitelist someone’s domain, you can add the following directive to your local.cf file:

whitelist_from *@sender_domain.com

Also, we need to configure report_safe. This directive will do the handle of the marked spam messages.

report_safe 0 # The incoming SPAM messages will have the header modified with a directive pointing it's spam
report_safe 1 # The incoming messages tagged as SPAM will create a report and attach the original message to it
report_safe 2 # The incoming SPAM will be attached as a new report and sent as plain text

To identify spam messages on the mailbox, we need to remove the rewrite_header Subject comment line so it will identify the spam:

rewrite_header Subject SPAM

And it’s done the configuration. Now, we need to integrate Spamassassin and Postfix.

Integrating Postfix and SpamAssassin

The postfix configuration file is located at /etc/postfix/master.cf. The first change required to be done is related to the SMTP line, so the line would look like:

smtp inet n - - - - smtpd

Then, after our changes, with the integration of SpamAssassin, it would look like this:

smtp inet n - - - - smtpd -o content_filter=spamassassin

At the end of our file, we need to add the following content:

spamassassin
unix – n n – – pipe
flags=R
user=spamd
argv=/usr/bin/spamc
-e /usr/sbin/sendmail
-oi -f ${sender} ${recipient}

That’s it. SpamAssassin is configured on your system and integrated with Postfix. At this point, you can test the email deliverability of your service to see if it’s working as expected. If you’re struggling with this, feel free to contact our Incident Server Support team, and we’ll help you get everything sorted out.

The post How to stop Receiving Spam Emails on Linux with SpamAssassin appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-stop-receiving-spam-emails-on-linux-with-spamassassin/feed/ 0
How to Install Python on Debian 12 https://linuxhostsupport.com/blog/how-to-install-python-on-debian-12/ https://linuxhostsupport.com/blog/how-to-install-python-on-debian-12/#respond Tue, 30 Jul 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2138 Python is a versatile programming language that can run on almost any system architecture, from web development to machine learning, and can be used for applications in various fields. Besides its versatility, Python is also relatively easy for beginners to learn, making it one of the most popular programming languages. This tutorial will show you […]

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

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

Prerequisites

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

Conventions

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

Login to VPS and Update the System

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

ssh root@IP_Address -p Port_number

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

# lsb_release -a

The command should return an output similar to this:

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

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

# apt update -y

Install Python from Source

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

# apt show python3

The command will return an output like this:

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

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

Install Dependencies

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

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

Download and Install Python 3.12.3

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

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

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

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

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

Finally, we can install it.

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

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

Install Python using pyenv

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

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

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

# nano ~/.bashrc

and add these lines to it.

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

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

# source ~/.bashrc

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

# pyenv install -l

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

# pyenv install 3.10

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

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

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

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

# pyenv global 3.10.14

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

# python3 --version

It will return an output like this:

Python 3.10.14

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

# pyenv local 3.10.14

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

# python -m venv [VENV-NAME]

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

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

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

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

]]>
https://linuxhostsupport.com/blog/how-to-install-python-on-debian-12/feed/ 0
How to fix “err_ssl_protocol_error” https://linuxhostsupport.com/blog/how-to-fix-err_ssl_protocol_error/ https://linuxhostsupport.com/blog/how-to-fix-err_ssl_protocol_error/#respond Sun, 30 Jun 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2103 In this tutorial, we’ll help you recognize and fix the err_ssl_protocol_error in Linux OS. An err_ssl_protocol_error message indicates that a website cannot be accessed securely over HTTPS. HTTPS is a secure protocol based on HTTP but with improved and high security. The websites that are accessible over HTTPS have valid SSL certificates. Even if you […]

The post How to fix “err_ssl_protocol_error” appeared first on LinuxHostSupport.

]]>
In this tutorial, we’ll help you recognize and fix the err_ssl_protocol_error in Linux OS.

An err_ssl_protocol_error message indicates that a website cannot be accessed securely over HTTPS. HTTPS is a secure protocol based on HTTP but with improved and high security. The websites that are accessible over HTTPS have valid SSL certificates. Even if you install a valid SSL certificate, you may still get the err_ssl_protocol_error.

In the next paragraphs, we will give an explanation and possible solutions for fixing the error SSL protocol.

Reload the Web server

After you renew the SSL certificate, restart the Web server. This is due to the latest changes to take effectivity. This can often fix the issue because the Web server has not restarted since the last installation or certificate renewal. Note that if you are a website owner you can easily do this. Otherwise, you would have to contact your hosting provider.

Verify the SSL certificate

If you have a free Let’s Encrypt SSL certificate, that’s about to expire, we recommend that you renew it. If you paid for one, make sure that you successfully pasted the certificate code or files into the right directory. Check the lines in your Web server configuration to see if the certificate is properly loaded.

Check the DNS

If you own the domain and have access to the DNS zone of the domain, you can revert any changes. Changes you made recently, or allow some time for the DNS changes to propagate through the Internet. If you are aware that DNS changes need time, wait a couple of hours and then access the website again.

Disable CDN

If you are using a content delivery network, the first step is to temporarily disable it. If there is no issue, and the website is loading, then you need to clear the CDN cache. Should the issue persists, then you can reenable the CDN and proceed with the investigation.

Clear the Web browser cache

From the client aspect, in most cases, the website is cached in the browser. It is a good practice for us to clear the web browser cache on time. If you do not want to clear the web browser cache, then access the website with a different web browser. Alternatively, access the website in incognito mode. Do note that clearing the web browser cache and cookies will log you out from everywhere. This means that you will have to log in to every site again.

Disable your VPN

If you are using a VPN you can disable it temporarily, to see if the issue persists. If there is no issue then you can stop using the VPN and try to find a new one.

Disable Browser Extensions

If you are using some new browser extensions that you installed recently, disable them. See if they were causing the website to be inaccessible. If everything is the same, enable them again and proceed with the investigation.

Update your Browser

Running older versions of web browsers can cause ERR_SSL_PROTOCOL_ERROR. Updating the browser to the latest version available can make the website accessible again.

System Updates

We recommend that you update your OS to the latest version available. We do this through the GUI of the operating system.

Contact the Hosting Provider

If you are the website owner, and cannot resolve the issue, contact your hosting provider. Your hosting provider is best suited to help you resolve any CDN issue.

If you are a client and unable to solve the issue, contact the website owner. The issue may be on the server level rather than locally on your computer.

You’ve fixed the err_ssl_protocol_error

These were some basic steps to solve the ERR_SSL_PROTOCOL_ERROR error. If you have an active service with us, you can always contact our technical support. We will help you with any aspect of your website. We are available 24/7.

If you liked this post on how to fix the err_ssl_protocol_error, share it with your friends or comment below.

The post How to fix “err_ssl_protocol_error” appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-fix-err_ssl_protocol_error/feed/ 0
How to Install Node.js and NPM on Ubuntu 24.04 https://linuxhostsupport.com/blog/how-to-install-node-js-and-npm-on-ubuntu-24-04/ https://linuxhostsupport.com/blog/how-to-install-node-js-and-npm-on-ubuntu-24-04/#respond Thu, 30 May 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2086 NodeJS is an open-source JavaScript runtime environment, one of the most popular tools among web developers. Developers typically use NodeJS to improve the functionality of web applications or create local development environments. This tutorial will guide you on how to install Node.JS and NPM on Ubuntu 24.04 using the default repository and NodeSource. You will […]

The post How to Install Node.js and NPM on Ubuntu 24.04 appeared first on LinuxHostSupport.

]]>
NodeJS is an open-source JavaScript runtime environment, one of the most popular tools among web developers. Developers typically use NodeJS to improve the functionality of web applications or create local development environments. This tutorial will guide you on how to install Node.JS and NPM on Ubuntu 24.04 using the default repository and NodeSource. You will also learn how to install a specific version of NodeJS using NVM.

Prerequisites

  • An Ubuntu 24.04 VPS
  • SSH root access or user with sudo privileges

Conventions

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

Step 1. Login to the server

First, log in to your Ubuntu 24.04 server through SSH as the root user:

ssh master@IP_Address -p Port_number

You must replace ‘IP_Address‘ and ‘Port_number‘ with your server’s IP address and SSH port number. Additionally, replace ‘master’ with the username of the system user with sudo privileges.

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 Noble Numbat
Release: 24.04
Codename: noble

Step 2. Install Dependencies

To install NodeJS on our system, we need to install some dependencies. Let’s run the command below to install them.

$ sudo apt install curl apt-transport-https ca-certificates gnupg

Step 3. Install NodeJS and NPM from APT

The easiest way to install NodeJS and NPM on an Ubuntu 24.04 system is from the default APT repository. You will get NodeJS version 18 and NPM version 9 using this installation method. The installation is simple and straightforward. Let’s execute the command below to install NodeJS and NPM.

$ sudo apt install nodejs npm -y

Once installed, you can run this command to check the version.

$ nodejs -v; npm -v
master@ubuntu24:~$ nodejs -v; npm -v
v18.19.1
9.2.0

Step 4. Install NodeJS and NPM from NodeSource

We can install NodeJS from the Ubuntu default repository, but we will get an older version of NodeJS if we use this method. Alternatively, we will install NodeJS and npm through NodeJS repository to get the more recent version of it. If compared to Ubuntu’s default repository, NodeSource offer more versions to choose.

$ curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -

Once completed, we must download the package information from the newly added source above.

$ sudo apt update

Next, run the following command to install NodeJS and NPM.

$ sudo apt install nodejs

That’s it. NodeJS and NPM are installed. You can check the installed version by executing this one-liner:

$ node -v; npm -v

Now go to https://nodejs.org/en/download/ and see what is the LTS version. You have just installed the same version as shown there, and you will see an output like this after running the command above:

master@ubuntu24:~$ node -v; npm -v
v20.11.1
10.2.4

Again, this installation method is suitable if you want to get the LTS or a specific version. For example, if you want version 18, you can execute this command instead.

$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -

Replace 18 with any version you want if you want another version.

Step 5. Install NodeJS and NPM using NVM

Another way to install NodeJS on Ubuntu is by using the Node Version Manager (NVM). NVM is a bash script used to manage several versions of NodeJS on your system. This installation method allows you to install and maintain different independent versions of NodeJS simultaneously.

Run this command below to download the script.

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Then, we need to source the script.

$ source ~/.bashrc

After executing the command, you can list the available version of NodeJS to install with this command:

$ nvm list-remote

The command will return a message containing a long list of NodeJS version to choose.

To install version 20.11.1, run this command

$ nvm install 20.11.1

As explained earlier, you can have multiple version of NodeJS, you can install another version using the same command with the different version in the command.

To switch between the installed version, you can run this command:

$ nvm use 18.19.1

Replace 18.19.1 with the version you want to switch to. Make sure the version is already installed.

Congratulation! You have successfully learned how to install Node.JS and NPM on your Ubuntu 24.04 VPS. For more information about NodeJS and NPM, please refer to the NodeJS website.

If you are still unsure, you don’t have to install NodeJS and NPM On Ubuntu 24.04 yourself. Our Linux admins will set up and configure a NodeJS and NPM VPS for you on our monthly management plans or per incident server support plans.

PS. If you liked this post on how to install NodeJS and NPM On Ubuntu 24.04, please share it with your friends on social networks using the buttons on the left or leave a reply below. Thanks.

The post How to Install Node.js and NPM on Ubuntu 24.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-node-js-and-npm-on-ubuntu-24-04/feed/ 0
How to Install PHP 8.3 on Ubuntu 24.04 https://linuxhostsupport.com/blog/how-to-install-php-8-3-on-ubuntu-24-04/ https://linuxhostsupport.com/blog/how-to-install-php-8-3-on-ubuntu-24-04/#comments Tue, 30 Apr 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2078 This tutorial will teach you how to install PHP 8.3 on Ubuntu 24.04. PHP is a scripting language used for development purposes. It was an abbreviation for Personal Home Page, but now it stands for the recursive initialism known as PHP Hypertext Preprocessor. PHP is used for creating dynamic web pages, and according to the […]

The post How to Install PHP 8.3 on Ubuntu 24.04 appeared first on LinuxHostSupport.

]]>
This tutorial will teach you how to install PHP 8.3 on Ubuntu 24.04. PHP is a scripting language used for development purposes. It was an abbreviation for Personal Home Page, but now it stands for the recursive initialism known as PHP Hypertext Preprocessor. PHP is used for creating dynamic web pages, and according to the reports in 2024, PHP is used by 76% of all websites whose programming language can be determined. Most popular CMS systems like WordPress, Drupal, or Joomla are written in PHP. The latest stable version of PHP is PHP 8.3.

Installing PHP 8.3 and its extensions is straightforward and may take a few minutes. Let’s get started!

Prerequisites to install PHP 8.3 on Ubuntu 24.04

  • A server running Ubuntu 24.04 or any Linux OS
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the system

We assume that you have a fresh installation of Ubuntu 24.04, and we need to update the system before we start installing PHP 8.3. To do that, execute the following commands:

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

Step 2. Install PHP 8.3

Once the system is updated, we can install the latest stable version of PHP8.3. This version is, by default, enabled in the Ubuntu 24.04 repository, and we do not need to add any keys and repositories. The installation command is straightforward:

sudo apt install php8.3 -y

After successful installation, you can check the version of the PHP:

php -v

You should get the following output:

root@host:~# php -v
PHP 8.3.0-1ubuntu1 (cli) (built: Jan 19 2024 14:00:34) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.0, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.0-1ubuntu1, Copyright (c), by Zend Technologies

Step 3. Install PHP 8.3 extensions

Installation of the PHP itself will not run the websites smoothly. We need additional modules, such as PHP, to work with MySQL, with images, for HTTP requests, XML data, etc. In the next command, we will install a couple of PHP extensions that are very important for one website:

sudo apt install libapache2-mod-php php8.3-common php8.3-cli php8.3-mbstring php8.3-bcmath php8.3-fpm php8.3-mysql php8.3-zip php8.3-gd php8.3-curl php8.3-xml -y

After the installation, we can check the installed PHP modules with the command below:

php -m

We will get a long list of modules:

root@host:~# php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
	.
	.
	.
	.
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib	

Step 4. Test PHP

Now, in this last step, we will make a test PHP file in our web server document root to test whether or not the PHP is working. But before that, we need to install the Apache Web server:

sudo apt install apache2 -y

After installation, start and enable the service:

sudo systemctl start apache2 && sudo systemctl enable apache2

If everything is ok, check the status of the service:

sudo systemctl status apache2

You should get output similar to this:

root@host:# sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-03-14 07:33:03 CDT; 8min ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 92315 (apache2)
      Tasks: 7 (limit: 4624)
     Memory: 16.1M (peak: 16.2M)
        CPU: 170ms
     CGroup: /system.slice/apache2.service

Next, go into your Apache document root:

cd /var/www/html

Create info.php file:

touch info.php

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

<?php
phpinfo();
?>

Save the file, close it, and restart the Apache service.

sudo systemctl restart apache2

Now you can access the file in the browser by vising the following URL: http:YourServerIPaddress:/info.php

Learn how to Install PHP 8.3 on Ubuntu 24.04

That’s it. You successfully learned how to install PHP 8.3 on Ubuntu 24.04. Of course, you do not have to do this on your own. Our admins can help you with any aspect of the PHP installation on your server. Feel free to contact us. We are available 24/7.

PS. If you liked this post on how to install PHP 8.3 on Ubuntu 24.04, please share it with your friends on social networks or leave a comment in the comments section. Thank you.

The post How to Install PHP 8.3 on Ubuntu 24.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-php-8-3-on-ubuntu-24-04/feed/ 1
How to Fix MySQL Can’t Connect to Server Issues https://linuxhostsupport.com/blog/fix-mysql-cant-connect-to-server-issues/ https://linuxhostsupport.com/blog/fix-mysql-cant-connect-to-server-issues/#respond Mon, 15 Apr 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2070 Last month, we showed you how to resolve the “can’t connect to local server” error, though this won’t help if you’re using a remote MySQL server. As such, we’ve created this guide on “how to fix MySQL can’t connect to server issues”. MySQL is a popular open-source RDBMS, short for Relational Database Management System, widely […]

The post How to Fix MySQL Can’t Connect to Server Issues appeared first on LinuxHostSupport.

]]>
Last month, we showed you how to resolve the “can’t connect to local server” error, though this won’t help if you’re using a remote MySQL server. As such, we’ve created this guide on “how to fix MySQL can’t connect to server issues”.

MySQL is a popular open-source RDBMS, short for Relational Database Management System, widely used for web applications and other data-driven projects. It’s part of the LAMP/LEMP stack, and many popular websites and applications use it as a database system for storing data. However, users occasionally encounter issues where they can’t connect to the MySQL server, which can disrupt normally functioning applications. In this guide on how to fix MySQL can’t connect to server issues, we will explore common reasons for this problem and provide step-by-step solutions to help you resolve MySQL connection issues.

Check MySQL Server Status

Before diving into more complex troubleshooting, start by checking the status of your MySQL server. Ensure that the MySQL service is running and that there are no critical errors or warnings in the server logs. You can use the following command to check the MySQL service status:

# systemctl status mysql

You will receive similar output If the service is not running:

# systemctl status mysql
○ mariadb.service - MariaDB 10.6.12 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor prese>
     Active: inactive (dead) since Fri 2024-01-12 23:41:21 UTC; 1s ago

Start the MySQL service using:

# systemctl start mysql

Verify MySQL Port and Network Configuration

The Default MySQL port for connections is 3306. Ensure that the MySQL server is configured to listen on the correct port and that there are no firewall or network issues preventing connections. Check the MySQL configuration file (usually located at /etc/mysql/my.cnf or /etc/my.cnf) for the following lines:

bind-address = 127.0.0.1
port = 3306

Ensure that the bind-address allows connections from the necessary IP addresses or is set to 0.0.0.0 to allow connections from any IP address. To check connectivity to the MySQL server on port 3306 you can also use the netcat command. You can do that by running the command:

nc -zv 192.168.2.20 3306

Instead of 192.168.2.20, you should use the IP address of the MySQL server. If the connection is successful, you should get similar output:

Connection to 192.168.2.20 3306 port [tcp/mysql] succeeded!

If the connection fails, you will see an output like this:

nc: connect to 192.168.2.20 port 3306 (tcp) failed: Connection refused

Then, you should log in to the MySQL server and check which port is MySQL listening on.

MySQL User Privileges

Incorrect user privileges may prevent successful connections to the MySQL server. Verify that the user attempting to connect has the necessary privileges. You can use the following MySQL command to grant privileges:

GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost' IDENTIFIED BY 'password';

Replace database_name, username, and password with your actual database name, username, and password. Then you can run the command:

FLUSH PRIVILEGES;

Then simply exit the MySQL shell and if the problem was with the MySQL user privileges you should be able to connect now.

Check for Network Issues

Network issues can often be a cause of connection problems. Ensure there are no network interruptions, and the server is accessible from the client machine. Ping the server to check for connectivity:

ping your_mysql_server_ip

If there are issues, check the network configuration, firewall settings, and any security groups or access control lists (ACLs) that may be blocking connections.

Examine MySQL Error Logs

MySQL logs provide valuable information about errors and warnings. Examine the MySQL error logs to identify any issues causing the connection problem. The error logs are typically located in the /var/log/mysql directory (check your MySQL configuration for the exact location) and are named error.log. You can find more information here that might help you identify the issue.

Resolving MySQL connection issues involves systematically identifying and addressing potential problems. By checking your server status, verifying port and network configurations, confirming user privileges, investigating network issues, and examining error logs, you can troubleshoot and fix MySQL can’t connect to server problems effectively. If you cannot solve this issue, you can always contact our Support Team, which will help you solve the problem without worrying too much about making the right changes.

The post How to Fix MySQL Can’t Connect to Server Issues appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/fix-mysql-cant-connect-to-server-issues/feed/ 0
How to Fix MySQL “Can’t connect to local server” https://linuxhostsupport.com/blog/how-to-fix-mysql-cant-connect-to-local-server/ https://linuxhostsupport.com/blog/how-to-fix-mysql-cant-connect-to-local-server/#respond Sat, 30 Mar 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2061 MySQL is an open-source relational database management system used for storing data. It is written in C and C++, offering various features that are very useful for developers and other users familiar with it. Often, it’s very useful to block off access to your MySQL server to prevent unauthorized access. Sometimes, you may lock yourself […]

The post How to Fix MySQL “Can’t connect to local server” appeared first on LinuxHostSupport.

]]>
MySQL is an open-source relational database management system used for storing data. It is written in C and C++, offering various features that are very useful for developers and other users familiar with it. Often, it’s very useful to block off access to your MySQL server to prevent unauthorized access. Sometimes, you may lock yourself out. In this blog post we will show you how to fix the MySQL connectivity issues when accessing MySQL as a local server. This blog post will teach you how to fix the dreaded “can’t connect to local server” issue. Let’s get started!

Prerequisites

  • A server with a Linux-based distribution (we used Ubuntu 22.04)
  • User privileges: root or non-root user with sudo privileges

MySQL Can’t connect to local server

The error message “can’t connect to local MySQL server through socket” can appear due to various reasons. One possibility is that the server cannot establish a connection to the MySQL server using its default socket due to an incorrect path to the socket file. Other reasons include incorrect permissions, misconfiguration in the MySQL setup, or the MySQL service is crashing unexpectedly due to a broken database, not enough RAM on the server, etc.

The socket is an endpoint where two processes communicate with each other. When we say the MySQL socket, we are talking about the mysqld.sock file located at /var/run/mysqld/mysqld.sock. Let’s go over the possible solutions for this connecting issue with the local MySQL server.

Let’s go over each possibility – we’re confident your MySQL server will be accessible locally once you try all of these solutions.

Check Your MySQL Service

Sometimes the MySQL service can stop unexpectedly due to various reasons. It may be due to insufficient disk space, not enough RAM, or the server has been rebooted and the MySQL service was not enabled to start on boot previously.

So, when we try to log in to the MySQL console with the following command:

mysql -u root -p

The connection cannot be established, and we will receive the following output:

root@host:~# mysql -u root -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

First, we need to check if the MySQL service is up and running with the following command:

systemctl status mysql

If the service is not running, you should receive the following output:

root@host:~# systemctl status mysql
○ mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: inactive (dead)  since Mon 2024-01-08 18:19:37 CST; 13min ago
    Process: 30718 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 30749 ExecStart=/usr/sbin/mysqld (code=exited, status=0/SUCCESS)
   Main PID: 30749 (code=exited, status=0/SUCCESS)
     Status: "Server shutdown complete"
        CPU: 1.981s

We just need to start and enable the service with the command below:

sudo systemctl start mysql && sudo systemctl enable mysql

After checking the status again, you should receive the following output:

root@host:~# systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2024-01-08 18:32:21 CST; 8min ago
   Main PID: 30950 (mysqld)
     Status: "Server is operational"
      Tasks: 37 (limit: 4558)
     Memory: 365.3M
        CPU: 5.241s
     CGroup: /system.slice/mysql.service
             └─30950 /usr/sbin/mysqld

Try to log into your server now – it should be working again. If you are still seeing the same error, move onto the next potential solution.

MySQL Socket Permissions

Let’s say that we started and enabled the MySQL service, but we are still experiencing the error message:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Now we need to check if the socket file exists and is in the right directory with the correct permissions. Execute the command below:

ls -al /var/run/mysqld/

If you get this output:

root@host:~# ls -al /var/run/mysqld/
drwxr-xr-x  2 root root 120 Jan 8 19:12 .
drwxr-xr-x 32 root root 960 Jan 8 19:12 ..
srwxrwxrwx  1 root root   0 Jan 8 19:12 mysqld.sock
-rw-------  1 root root   6 Jan 8 19:12 mysqld.sock.lock

This output shows us that the permissions are incorrect – the root user owns the files. In this case, we need to set the right permissions:

chown -R mysql:mysql /var/run/mysqld/
chmod 755 /var/run/mysqld/

Once the permissions are set, restart the MySQL service and try to connect again to the MySQL console.

MySQL Configuration File

If you are still not able to connect to the MySQL console, or in other words your MySQL client can’t connect to a local server, then you should check the MySQL configuration file usually located at /etc/mysql/mysql.conf.d/mysqld.cnf – other locations for this include /etc/mysql/my.cnf, or even /etc/my.cnf. Find where your configuration file is and open it using your preferred text editor.

Look for the socket variable and make sure to put the full path of the socket file. If there is no socket variable, add it to your file like so:

socket = /var/run/mysqld/mysqld.sock

Make sure the permissions for that folder are set correctly as well. Save the file, close it and restart the MySQL service. Your MySQL client should be able to connect to your local server.

If none of this is solving the issue and if you have a managed Linux support plan with us, you can ask our support team to help you with your MySQL service. We are available 24/7 and are experts in system configuration, including with MySQL. We will be able to help you with the configuration of MySQL as well as any other issues you’re having with your server.

The post How to Fix MySQL “Can’t connect to local server” appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-fix-mysql-cant-connect-to-local-server/feed/ 0
How to Fix Themes Not Installing on WordPress https://linuxhostsupport.com/blog/how-to-fix-themes-not-installing-on-wordpress/ https://linuxhostsupport.com/blog/how-to-fix-themes-not-installing-on-wordpress/#respond Fri, 15 Mar 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2055 Finding the right theme for your WordPress website can take some time. Once you found the right WordPress theme, installing the WordPress theme is often easy and straightforward. However, sometimes you may face some problems or errors and the WordPress theme can’t be installed. You don’t want to look for another theme again and this […]

The post How to Fix Themes Not Installing on WordPress appeared first on LinuxHostSupport.

]]>
Finding the right theme for your WordPress website can take some time. Once you found the right WordPress theme, installing the WordPress theme is often easy and straightforward.

However, sometimes you may face some problems or errors and the WordPress theme can’t be installed. You don’t want to look for another theme again and this theme was perfect for your website. You are in luck – join us in this guide to help you fix the WordPress theme not installing problem on your website.

There are a few different ways that this problem can be solved, so please try and check each one. Odds are something here will fix your problem.

Your uploaded theme file exceeds the maximum file size

Let’s say you downloaded the theme that you want to install, and you navigate to Appearance -> Theme -> Add New Theme and you upload your theme.

Then you receive the following error message:

The uploaded file exceeds the upload_max_filesize directive in php.ini

Based on the error message, your PHP configuration resticts file uploads to a size that is smaller than the theme you tried to upload. Just like the error suggests, to fix the problem you’ll need to increase the upload_max_filesize value. Once that’s done, you can upload the theme, and it’ll likely work.

How to increase max file upload size for PHP in cPanel

If you have WHM & cPanel, you can log in to your cPanel account and click on “MultiPHP INI Editor” and select the WordPress domain in the Select Location drop-down menu. Then you can increase the “upload_max_filesize” value to be higher than the size of the WordPress theme that you are uploading. For example, if your theme is 50 megabytes in size, we recommend setting it to something like 75 megabytes.

How to increase max file upload size for PHP using php.ini

In case you don’t have WHM & cPanel, you should change the upload_max_filesize value in the php.ini file. You can find the php.ini file by creating a new file phpinfo.php in the DocumentRoot of your WordPress website with the following content inside.

<?php

phpinfo( );

?>

Then go ahead and save this file and navigate to https://your-domain.com/phpinfo.php in your favorite browser and you can find the location of the php.ini file in the section “Loaded Configuration File“.

Then open the php.ini file in the location where it is found and change upload_max_filesize from 25M for example to a larger number – one that is larger than the theme you want to upload. Save the file and exit. Restart your web server.

Also, make sure to delete the phpinfo.php file from your web server as revealing information about your environment invites attackers to find ways into your server through vulnerabilities.

Your PHP memory limit is too low

Another error that you may face is exhausting the memory with the following error message in your PHP log:

Fatal error: Allowed memory size of X bytes exhausted.

Same as in the previous example, you should increase the PHP memory limit from cPanel or by finding the php.ini file on your server and increasing the value for the “memory_limit” variable.

You can change the memory limit from cPanel by logging in to your cPanel account and navigating to the “MultiPHP INI Editor” and selecting the WordPress domain in the Select Location drop-down menu, then you can change the “memory_limit” value.

If you are not using cPanel you can find the php.ini file by creating a phpinfo.php file that will show you the php.ini location on your server. Then adjust your memory_limit variable from the default 128M to a larger number, such as 256M or 512M. Make sure to restart your web server.

“Installation Failed: Could Not Create Directory” Error

Two scenarios may cause this error. Your server has run out of disk space, or your cPanel or DirectAdmin account has reached the disk quota. In some extreme cases, if your server has too many files, you may reach the inodes limit on your server. Inodes are used to identify unique files and folders – it’s possible to run out of numbers even without running out of disk space.

To fix this error you should delete some old or unused files to free up some space/inodes, or upgrade your hosting plan.

Lack of permissions or ownership by the web server

Another problem that you can face is your directory or files might have incorrect permissions or ownership.

You can change the file and directory permissions of the WordPress directory using FTP or SFTP through your FTP client, such as FileZilla. This is a free application for Windows, macOS and Linux that lets you remotely connect to your server.

You can select the WordPress DocumentRoot, righ-click on it and select File permissions…

Then you can set 755 in the numeric value field > select recurse into subdirectories > apply to directories only and click ok.

Again you can repeat the same procedure right-click on the DocumentRoot, select File permissions… and set 644 in the numeric value field > select recurse into subdirectories > apply to files only and click ok.

To change the file permissions from your terminal you can navigate inside the WordPress website directory and run the following commands.

find . -type f -exec chmod 644 {} +
find . -type d -exec chmod 755 {} +

This will set the correct permissions for your WordPress files and directories.

You may also need to change the ownership of the files and directories to your web server’s user. Depending on what Linux distribution and web server you’re using, this user is named differently. It could be www-data, nginx, or apache to name a few.

To set the ownership of your WordPress installation, let’s say your WordPress is installed at the directory /var/www/html/wordpress/. To change the ownership of the entire WordPress installation to your web server user (in our example it is www-data), you can do that like so:

chown -R www-data:www-data /var/www/html/wordpress

With that, your web server should now be able to access all WordPress files and folders properly.

Incompatible plugins

Sometimes plugin compatibility may be the issue when you are installing a new theme. It may cause a conflict and you won’t be able to install the new theme. This is especially possible if your theme depends on some plugins to function properly. You can test this by installing some WordPress plugin compatibility checker or disabling all the plugins one by one to check which plugin is causing the issue.

Some of the themes may have requirements that you can check before installing. This may include incompatibility with certain plugins, which PHP versions and WordPress versions can be used.

Parse or Syntax Error with your theme

Another problem that you might encounter when installing a new WordPress theme is when you try to install some custom theme in WordPress, and you receive a syntax error. It’ll usually say something about “parse error” and “syntax error”. In this case, there’s a code issue within the theme itself. You should contact the theme developer or check the theme code for any syntax errors in the code.

What about child themes?

Installing child themes works in the same way as installing parent themes. You just need to ensure you keep the parent theme of your child theme installed. If you see any errors with the child theme but not with the parent theme, it’s possible that it is a permissions issue, in which case you can scroll up and try to fix your permissions again.

Conclusion

By trying each of these solutions, you shouldn’t have any issues with themes not installing on WordPress. If you still have trouble, however, get in touch with our managed server support team and we’ll make sure your themes can be installed, or we’ll at the very least tell you exactly why it’s not possible to install your theme.

The post How to Fix Themes Not Installing on WordPress appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-fix-themes-not-installing-on-wordpress/feed/ 0
How to Check and Change the Time Zone on Linux https://linuxhostsupport.com/blog/how-to-check-and-change-the-time-zone-on-linux/ https://linuxhostsupport.com/blog/how-to-check-and-change-the-time-zone-on-linux/#respond Thu, 15 Feb 2024 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=2038 Time zones are very important for the Linux system because they can affect how the system operates, as well as affecting data displayed on your website for example. In this blog post, we will explain how to check and change the time zone on your Linux server. Setting the time and date is also important […]

The post How to Check and Change the Time Zone on Linux appeared first on LinuxHostSupport.

]]>
Time zones are very important for the Linux system because they can affect how the system operates, as well as affecting data displayed on your website for example. In this blog post, we will explain how to check and change the time zone on your Linux server. Setting the time and date is also important as it involves setting the correct time zone. These settings can be easily checked and changed according to your needs.

Changing the timezone on a Linux server is a very straightforward process. Let’s get things done!

Prerequisites

  • A server running a recent version of Linux
  • User privileges: root or non-root user with sudo privileges

Update the System

Before we make any changes to our Linux system, we should always update the packages to the latest version available. To do that, execute the following command:

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

If there’s a new kernel update, you’ll need to restart to load the new kernel.

Check the Time Zone

All Linux servers have some kind of time zone that is already set. To check the time zone, we need to use the timedatecl command. The timedatectl command in Linux is used for displaying the current time on your server. It displays the system time, the hardware clock, and the time zone configured on your system. There is additional info as output from this command about the status of the systemd-timesyncd.service and clock synchronization.

Let’s execute the timedatectl command and see the exact output:

root@host:~# timedatectl
               Local time: Sun 2024-01-14 15:57:57 CST
           Universal time: Sun 2024-01-14 21:57:57 UTC
                 RTC time: Sun 2024-01-14 21:57:57
                Time zone: America/Chicago (CST, -0600)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

The first line displays the local time, the second line is the Universal time, and the third line is the hardware clock (RTC, or Real Time Clock). Then the timezone is displayed, and as you can see on our system it’s set to America/Chicago CST (Central Standard Time). After that is the info about the synchronization, the network time protocol service, and the hardware clock in the local time zone, which in this case is disabled.

We can check the time zone if we execute the date command:

root@host:~# date
Sun Jan 14 16:12:14 CST 2024

There is also another way to check the time zone, and that way is by listing the following file:

ls -l /etc/localtime

You should get the following outptut:

root@host:~# ls -al /etc/localtime
lrwxrwxrwx 1 root root 35 Jan  14 16:14 /etc/localtime -> /usr/share/zoneinfo/America/Chicago

As you can see, the timedatectl command is easier to use and the output of that command includes more details compared to the other methods.

Change the Time Zone on Linux

In the previous step, we explained different ways for checking the time zone. Now let’s cover how to change the current time zone on Linux.

Before changing the time zone, we need to list the available time zones with the following command:

timedatectl list-timezones

You will get a long list of time zones, as listed below:

Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
	.
	.
America/Anchorage
America/Anguilla
America/Antigua
America/Araguaina
America/Argentina/Buenos_Aires
America/Argentina/Catamarca
America/Argentina/ComodRivadavia
America/Argentina/Cordoba
America/Argentina/Ushuaia
	.
	.
Europe/Monaco
Europe/Moscow
Europe/Nicosia
Europe/Oslo
Europe/Paris
Europe/Podgorica
Europe/Prague
Europe/Riga
Europe/Rome
Europe/Samara
Europe/San_Marino

To change the current time zone to Europe/Monaco for example, you need to execute the following command:

timedatectl set-timezone Europe/Monaco

After executing this command, you can check the time zone to see the changes:

root@host:~# timedatectl
               Local time: Sun 2024-01-15 22:28:29 CET
           Universal time: Sun 2024-01-15 21:28:29 UTC
                 RTC time: Sun 2024-01-15 21:28:29
                Time zone: Europe/Monaco (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

As you can see the time zone was successfully changed.

Another way to change the time zone is using the tzselect command:

root@host:~# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, "coord", or "TZ".
1) Africa
2) Americas
3) Antarctica
4) Asia
5) Atlantic Ocean
6) Australia
7) Europe
8) Indian Ocean
9) Pacific Ocean
10) coord - I want to use geographical coordinates.
11) TZ - I want to specify the timezone using the Posix TZ format.
#? 

Now, you can select the continent, ocean, and coordinates, or specify the time zone using the Posix TZ format. Let’s choose number 1 for the Africa continent. You will get a list of all countries in Africa.

Please select a country whose clocks agree with yours.
 1) Algeria		  13) Côte d'Ivoire	    25) Iceland		      37) Namibia		49) Sudan
 2) Angola		  14) Djibouti		    26) Kenya		      38) Niger			50) Tanzania
 3) Benin		  15) Egypt		    27) Lesotho		      39) Nigeria		51) Togo
 4) Botswana		  16) Equatorial Guinea	    28) Liberia		      40) Rwanda		52) Tunisia
 5) Burkina Faso	  17) Eritrea		    29) Libya		      41) Sao Tome & Principe	53) Uganda
 6) Burundi		  18) Eswatini (Swaziland)  30) Madagascar	      42) Senegal		54) Western Sahara
 7) Cameroon		  19) Ethiopia		    31) Malawi		      43) Sierra Leone		55) Zambia
 8) Central African Rep.  20) Gabon		    32) Mali		      44) Somalia		56) Zimbabwe
 9) Chad		  21) Gambia		    33) Mauritania	      45) South Africa
10) Comoros		  22) Ghana		    34) Mayotte		      46) South Sudan
11) Congo (Dem. Rep.)	  23) Guinea		    35) Morocco		      47) Spain
12) Congo (Rep.)	  24) Guinea-Bissau	    36) Mozambique	      48) St Helena
#? 

We will choose number 45 for example to change the time zone to South Africa.

The following information has been given:

	South Africa

Therefore TZ='Africa/Johannesburg' will be used.
Selected time is now:	Mon Jan 15 13:00:40 SAST 2024.
Universal Time is now:	Mon Jan 15 11:00:40 UTC 2024.
Is the above information OK?
1) Yes
2) No
#? 

After that, we can confirm by typing 1 and hitting the Enter button. You will get the following screen:

You can make this change permanent for yourself by appending the line
	TZ='Africa/Johannesburg'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Africa/Johannesburg 

You should definitely add that line to your .profile file so that your time zone is remembered when you next login:

echo "TZ='Africa/Johannesburg'; export TZ" >> ~/.profile

Congratulations! You successfully changed your time zone using two different ways.

Of course, you don’t have to spend your time on this and if you have a managed Linux support plan with us. We will help you with any aspect of your server time zones, including any app-specific time zone settings. You can simply ask our support team – they are available 24/7 and will be able to help you with your time zone as well as any additional requirements that you may have.

The post How to Check and Change the Time Zone on Linux appeared first on LinuxHostSupport.

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

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

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

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

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

Prerequisites

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

Login and Update the server

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

ssh root@IP_Address -p Port_number

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

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

apt update && apt upgrade

Add third party APT repository

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

apt-cache policy php

Output:

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

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

php -v

Output:

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

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

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

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

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

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

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

And finally, update the repositories and install PHP 8.

apt update && apt install php8.0

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

php -v

Output:

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

Install PHP 8 extensions

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

apt search php8.0-*

Output:

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

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

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

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

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

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

apt -y install php8.0-mbstring

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

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

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

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

]]>
https://linuxhostsupport.com/blog/how-to-install-php-8-on-debian/feed/ 0
How to Install XWiki on AlmaLinux 9 https://linuxhostsupport.com/blog/how-to-install-xwiki-on-almalinux-9/ https://linuxhostsupport.com/blog/how-to-install-xwiki-on-almalinux-9/#respond Sat, 30 Dec 2023 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1993 XWiki is a free and open-source platform written in Java used for storing structured data and running the server-side code that creates the wiki interface. In this tutorial, we are going to explain how to install XWiki on AlmaLinux 9. XWiki offers a variety of features such as structured content, PDF export, Version control, plugins, […]

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

]]>
XWiki is a free and open-source platform written in Java used for storing structured data and running the server-side code that creates the wiki interface. In this tutorial, we are going to explain how to install XWiki on AlmaLinux 9.

XWiki offers a variety of features such as structured content, PDF export, Version control, plugins, API programming, and many more. XWiki stores the data into the MySQL database server, and alongside Tomcat we will install the MariaDB database server.

Installing XWiki with all of its requirements will take up to 20 minutes. Let’s get started!

Prerequisites

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

Step 1. Update the System

Before we start with the installation of XWiki, we need to update the system packages to their latest versions available:

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

Step 2. Install Java

To install Java, execute the following command:

dnf install java

Once Java is installed, you can check the version with the command below:

java --version

You should get the following output:

[root@host ~]# java --version
openjdk 11.0.21 2023-10-17 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.21.0.9-1) (build 11.0.21+9-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.21.0.9-1) (build 11.0.21+9-LTS, mixed mode, sharing)

Step 3. Install Tomcat

To install Tomcat, execute the following commands one by one:

groupadd tomcat

useradd -g tomcat -d /opt/tomcat tomcat

su - tomcat

wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.96/bin/apache-tomcat-8.5.96.tar.gz -O tomcat8.tar.gz

tar -xzvf tomcat8.tar.gz --strip-components=1

exit

Next, we need to create a service file for Tomcat:

touch /etc/systemd/system/tomcat8.service

Once the file is created, open it with your preferred text editor and paste the following lines of code:

[Unit]
Description=Tomcat 8
After=syslog.target network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -XX:MaxPermSize=192m -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID

[Install]
WantedBy=multi-user.target

Save the file and close it. Once done, reload the SystemD daemon. start the service, and configure it to start on boot:

systemctl daemon-reload

systemctl start tomcat8

systemctl enable tomcat8

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

systemctl status tomcat8

You should get the following output:

[root@host ~]# systemctl status tomcat8
● tomcat8.service
     Loaded: loaded (/etc/systemd/system/tomcat8.service; disabled; preset: disabled)
     Active: active (running) since Sun 2023-11-19 14:25:10 CST; 2min 21s ago
    Process: 7503 ExecStart=/opt/tomcat/bin/startup.sh (code=exited, status=0/SUCCESS)
   Main PID: 7510 (java)
      Tasks: 28 (limit: 23116)
     Memory: 155.7M
        CPU: 8.996s
     CGroup: /system.slice/tomcat8.service
             └─7510 /usr/lib/jvm/jre/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Djava.util.logging.manager>

Nov 19 14:25:10 host.test.vps systemd[1]: Starting tomcat8.service...
Nov 19 14:25:10 host.test.vps startup.sh[7503]: Tomcat started.
Nov 19 14:25:10 host.test.vps systemd[1]: Started tomcat8.service.

Step 4. Install MariaDB database server

To install the MariaDB database server, execute the following command:

dnf install mariadb-server -y

After installation, start and enable the service:

sudo systemctl start mariadb && sudo systemctl enable mariadb

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

sudo systemctl status mariadb

You should get the following output:

[root@host ~]# sudo systemctl status mariadb
● mariadb.service - MariaDB 10.5 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: disabled)
     Active: active (running) since Sun 2023-11-19 14:33:59 CST; 49s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 8446 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 16 (limit: 23116)
     Memory: 75.5M
        CPU: 670ms
     CGroup: /system.slice/mariadb.service
             └─8446 /usr/libexec/mariadbd --basedir=/usr

Step 5. Create a MariaDB database and User

Now, we need to create a database and user for our XWiki installation. To do that, login to the MariaDB console with the mysql command and execute the following queries:

MariaDB [(none)]> CREATE DATABASE xwiki default character set utf8mb4 collate utf8mb4_bin;
MariaDB [(none)]> CREATE USER 'xwiki'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';
MariaDB [(none)]> GRANT all privileges on *.* to xwiki@localhost;
MariaDB [(none)]> EXIT;

Make sure to replace YourStrongPasswordHere with a unique, strong password. Remember it, because we’ll need it later.

Step 6. Download XWiki

Finally, we are at the most important step of the installation. We need to download the XWiki installation, place it into the Tomcat webapps folder, and configure the MariaDB database Java connector.

cd /opt/tomcat/webapps

wget https://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/platform/xwiki-platform-distribution-war/15.8/xwiki-platform-distribution-war-15.8.war -O xwiki.war

Next we need to download the MariaDB Java connector and move it into the lib folder of our XWiki application:

wget https://dlm.mariadb.com/3478935/Connectors/java/connector-java-3.3.0/mariadb-java-client-3.3.0.jar

mv mariadb-java-client-3.3.0.jar /opt/tomcat/webapps/xwiki/WEB-INF/lib/

To configure MariaDB, to be the main database server for XWiki, open the following file:

nano /opt/tomcat/webapps/xwiki/WEB-INF/hibernate.cfg.xml

Comment the HSQLDB configuration and uncomment the section for MariaDB configuration:

Save the file and close it.

Now, you can access your XWiki installation at http://YourServerIPAddress:8080/xwiki

Step 7. Finish XWiki Installation

On the first screen, click on the Continue button

In this step, set the administrator username, a strong password and email.

On the third screen, click on the Continue button:

Next choose the wiki to be empty and hit on the Continue button:

On the last window click on the Continue button as well:

Congratulations! You successfully installed XWiki on AlmaLinux 9 with the MariaDB java connector:

Of course, you don’t have to spend your time installing XWiki on AlmaLinux 9 if you have a managed Linux server support plan with us. If you do, you can simply ask our support team to install XWiki on AlmaLinux 9 for you. They are available 24/7 and will be able to help you with the installation of XWiki as well as any additional requirements that you may have.

PS. If you liked this post, please share it with your friends on social networks, or simply leave a reply below if this guide worked for you. Thanks.

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

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

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

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

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

Prerequisites

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

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

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

ssh root@IP_Address -p Port_number

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

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

# lsb_release -a

The command should return an output similar to this:

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

Step 2. Install Dependencies

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

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

Step 3. Add the Jellyfin Repository

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

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

Then, we’ll create our Jellyfin source list.

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

Insert the following into the file.

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

Save the file then exit from the editor.

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

# apt update

Step 4. Install Jellyfin

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

# apt install jellyfin -y

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

# systemctl status Jellyfin

The command should return an output similar to this:

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

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

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

Step 5. Install and Configure Nginx

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

# apt install nginx

Once installed, we can create a new configuration file.

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

Insert the following into the file.

upstream jellyfin {
 server 127.0.0.1:8096;
}

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

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

    resolver 127.0.0.1 valid=30;

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


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

        proxy_buffering off;
    }

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

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

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

# systemctl restart nginx

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

Choose your language then click on the Next button.

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

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

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

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

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

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

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

Congratulations! You have successfully installed Jellyfin on Debian 12.

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

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

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

]]>
https://linuxhostsupport.com/blog/how-to-install-jellyfin-media-server-on-debian-12/feed/ 0
How to Install Adminer on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-install-adminer-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-install-adminer-on-ubuntu-22-04/#respond Thu, 30 Nov 2023 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1948 In this tutorial, we are going to guide you on how to install Adminer on Ubuntu 22.04. Adminer, formerly phpMinAdmin is a software tool for managing the content of databases. Adminer is written in PHP and supports various database systems such as MySQL, PostgreSQL, MariaDB, SQLite, Elasticsearch, Oracle, etc. In this blog post, we will […]

The post How to Install Adminer on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we are going to guide you on how to install Adminer on Ubuntu 22.04.

Adminer, formerly phpMinAdmin is a software tool for managing the content of databases. Adminer is written in PHP and supports various database systems such as MySQL, PostgreSQL, MariaDB, SQLite, Elasticsearch, Oracle, etc. In this blog post, we will install Adminer with the LAMP stack.

Installing Adminer on Ubuntu 22.04 with LAMP stack is a straightforward process that may take up to 15 minutes. Let’s get things going!

Prerequisites

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

Step 1. Update the System

Every fresh install of the OS needs its system packages to be updated to the latest versions available.

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

Step 2. Install Apache Web Server

First, we will install the Apache Web server. Execute the following command to install it:

sudo apt-get install apache2 -y

Once, installed start and enable the service.

sudo systemctl enable apache2 && sudo systemctl start apache2

Check if the service is up and running:

sudo systemctl status apache2

You should receive the following output:

oot@host:~# sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-10-03 16:21:21 CDT; 35s ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 3128 (apache2)
      Tasks: 6 (limit: 4558)
     Memory: 9.9M
        CPU: 183ms
     CGroup: /system.slice/apache2.service

Step 3. Install PHP 8.1 with Dependencies

Next up will be installing PHP 8.1 with all of the required extensions for running Adminer. To install it all in one go, execute the following command:

sudo apt-get install php8.1 php8.1-cli php8.1-common php8.1-imap php8.1-redis php8.1-snmp php8.1-xml php8.1-zip php8.1-mbstring php8.1-curl php8.1-mysqli libapache2-mod-php php8.1-fpm -y

Step 4. Install MariaDB database server

Lastly, the LAMP stack isn’t complete without a database server. For the database server, we will install MariaDB.

sudo apt install mariadb-server -y

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.6.12 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-10-03 16:23:52 CDT; 22s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 4455 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 15 (limit: 4558)
     Memory: 61.3M
        CPU: 1.056s
     CGroup: /system.slice/mariadb.service
             └─4455 /usr/sbin/mariadbd

Step 5. Secure MariaDB database service

MariaDB by default is not safe to use in a production environment. That’s why we will secure the MariaDB database service and set a root password. To do this, execute the following command:

mysql_secure_installation

You need to pass these steps with the following options:

Switch to unix_socket authentication [Y/n] Y

Change the root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

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

With all of our required software and dependencies installed, let’s start the actual installation.

Step 6. Install Adminer

To install Adminer, execute the following command:

sudo apt install adminer -y

After successful installation, we need to enable PHP-FPM and enable the Adminer Apache configuration with the following commands:

sudo a2enconf php*-fpm

sudo a2enconf adminer

After this, restart the Apache web server.

systemctl reload apache2

Now you can access Adminer at http:YourServerIPAddress/adminer:

Logging in using the root password you set earlier will get you to the following screen:

You’re in! You successfully installed Adminer on Ubuntu 22.04 with the LAMP stack.

If you do not want to configure it on your own, you can sign up for one of our Linux server support plans and submit a support ticket. Our admins are available 24/7 and will start work on your request immediately. Always trust our epic support.

If you liked this post on how to install Adminer on Ubuntu 22.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 Adminer on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-adminer-on-ubuntu-22-04/feed/ 0
How to Install Bugzilla on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-install-bugzilla-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-install-bugzilla-on-ubuntu-22-04/#respond Wed, 15 Nov 2023 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1938 Bugzilla is an open-source software for tracking bugs developed by Mozilla’s developers. It is written in Perl and supports various database systems such as MySQL, PostgreSQL, Oracle, and SQLite. Bugzilla’s system requirements include a compatible database management system, a suitable release of Perl 5, an assortment of Perl modules, a compatible web server, and a […]

The post How to Install Bugzilla on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
Bugzilla is an open-source software for tracking bugs developed by Mozilla’s developers. It is written in Perl and supports various database systems such as MySQL, PostgreSQL, Oracle, and SQLite.

Bugzilla’s system requirements include a compatible database management system, a suitable release of Perl 5, an assortment of Perl modules, a compatible web server, and a qualified mail transfer agent.

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

Prerequisites

  • A server with Ubuntu 22.04 as the OS
  • At VPS with at least 4 GB of RAM available
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

Since we have a fresh installation of Ubuntu 22.04, we need to update the packages to the latest versions available:

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

Step 2. Install Perl

Bugzilla is written in Perl, so we need to install it along with of its dependencies.

sudo apt install build-essential libappconfig-perl libdate-calc-perl libtemplate-perl libmime-tools-perl build-essential libdatetime-timezone-perl libdatetime-perl libemail-sender-perl libemail-mime-perl libemail-mime-perl libdbi-perl libdbd-mysql-perl libcgi-pm-perl libmath-random-isaac-perl libmath-random-isaac-xs-perl libapache2-mod-perl2 libapache2-mod-perl2-dev libchart-perl libxml-perl libxml-twig-perl perlmagick libgd-graph-perl libtemplate-plugin-gd-perl libsoap-lite-perl libhtml-scrubber-perl libjson-rpc-perl libdaemon-generic-perl libtheschwartz-perl libtest-taint-perl libauthen-radius-perl libfile-slurp-perl libencode-detect-perl libmodule-build-perl libnet-ldap-perl libfile-which-perl libauthen-sasl-perl libfile-mimeinfo-perl libhtml-formattext-withlinks-perl libgd-dev libmysqlclient-dev graphviz sphinx-common rst2pdf libemail-address-perl libemail-reply-perl -y

After successful installation, check the installed Perl version:

perl --version

You should get output similar to this:

root@host:~# perl --version

This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux-gnu-thread-multi
(with 58 registered patches, see perl -V for more detail)

Step 3. Install MariaDB Database

To install the MariaDB database server, execute the command below.

sudo apt install mariadb-server -y

Start the MariaDB service and enable it to run at system startup with the following commands:

sudo systemctl start mariadb && sudo systemctl enable mariadb

Check the status of the MariaDB service like so:

sudo systemctl status mariadb

You should receive the following output:

root@host:~# sudo systemctl status mariadb
● mariadb.service - MariaDB 10.6.12 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-09-21 06:50:23 CDT; 18min ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 88311 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 7 (limit: 4558)
     Memory: 59.4M
        CPU: 1.625s
     CGroup: /system.slice/mariadb.service
             └─88311 /usr/sbin/mariadbd

Step 4. Create Bugzilla database and user

To create the BugZilla database and user, log into the MariaDB command line as the root user:

mysql -u root -p

Then press [Enter] if you have not set a root password for MariaDB. Once logged in, execute the following commands on the MariaDB command line:

 CREATE USER 'bugzilla'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';
 CREATE DATABASE bugzilla;
 GRANT ALL PRIVILEGES ON bugzilla.* TO 'bugzilla'@'localhost';
 FLUSH PRIVILEGES;
 EXIT;

With that done, you should now have a database and user ready for Bugzilla.

Step 5. Install Apache2 Webserver

We are going to use Apache as a web server in this tutorial. To install it, execute the command below:

sudo apt install apache2 -y

After successful installation, start and enable the service:

sudo systemctl start apache2 && sudo systemctl enable apache2

To check if everything is OK, execute the following command for the status of the Apache2 service:

sudo systemctl status apache2

You should receive the following output:

root@host:~# sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-09-21 06:52:26 CDT; 25min ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 93179 (/usr/sbin/apach)
      Tasks: 6 (limit: 4558)
     Memory: 13.3M
        CPU: 308ms
     CGroup: /system.slice/apache2.service

Step 6. Install Bugzilla

Download the latest stable version of Bugzilla into the Apache document root.

cd /var/www/html
wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.6.tar.gz

Once downloaded, extract the bugzilla directory.

tar -xvf bugzilla-5.0.6.tar.gz -C /var/www/html/

mv bugzilla-5.0.6 bugzilla 

Once this is done, go into the “bugzilla” directory and run the checksetup script to check your system’s setup.

cd /var/www/html/bugzilla/

./checksetup.pl

If there are missing modules, you need to execute the following command:

/usr/bin/perl install-module.pl --all

Now, if you execute the ./checksetup.pl it will return the following output:

There was an error connecting to MySQL:

    Access denied for user 'bugs'@'localhost' (using password: NO)

This is normal and expected because we haven’t set up the configuration file yet. Open the file /var/www/html/bugzilla/localconfig with your preferred text editor and edit it to look like this:

$webservergroup = 'www-data';
$db_driver = 'mysql';
$db_host = 'localhost';
$db_name = 'bugzilla';
$db_user = 'bugzilla';
$db_pass = 'YourStrongPasswordHere';
$db_port = 0;

Save the file and close it. After these settings are done run the ./checksetup.pl again.

./checksetup.pl

It should return back with no errors.

Next is to define your administrator’s email, username and password once the database connection is successful.

Enter the e-mail address of the administrator: admin@yourdomain.com
Enter the real name of the administrator: admin
Enter a password for the administrator account:
Please retype the password to verify:
admin@yourdomain.com is now set up as an administrator.
Creating initial dummy product 'TestProduct'...

Now that you have installed Bugzilla, you should visit the 'Parameters'
page (linked in the footer of the Administrator account) to ensure it
is set up as you wish - this includes setting the 'urlbase' option to
the correct URL.
checksetup.pl complete.

Step 7. Create a Virtual Host configuration file

To access the Bugzilla Web interface, you need to create a virtual host configuration file where you can define your domain, document root, and some script parameters.

First, create the configuration file with the following command:

touch /etc/apache2/sites-available/bugzilla.conf

Open the file, and paste the following lines of code:

<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html/bugzilla/

<Directory /var/www/html/bugzilla/>
AddHandler cgi-script .cgi
Options +Indexes +ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit FileInfo Indexes Options AuthConfig
</Directory>

ErrorLog /var/log/apache2/yourdomain.com.error_log
CustomLog /var/log/apache2/yourdomain.com.access_log common
</VirtualHost>

Make sure to replace yourdomain.com with the actual domain name you plan on using.

Enable the Apache2 configuration file and other modules:

sudo a2ensite bugzilla.conf

sudo a2enmod headers env rewrite expires cgi

Check the syntax of the Apache2 configuration.

apachectl -t

You should receive the following output:

root@host:~# apachectl -t
Syntax OK

If you receive this output, you can safely restart the Apache service.

sudo systemctl restart apache2

With all of this finally configured, you can now access the Bugzilla Web interface at http://YourDomain.com.

Congratulations! You successfully installed and configured Bugzilla on Ubuntu 22.04. Of course, if you use one of our Linux server support services, you do not have to do this on your own – you can always contact our technical support and they will do the rest for you. We are available 24/7.

If you liked this post on how to install Bugzilla on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks.

The post How to Install Bugzilla on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-bugzilla-on-ubuntu-22-04/feed/ 0
How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04/#comments Mon, 30 Oct 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1905 In this tutorial we are going to explain how to reset MySQL or MariaDB Root password on Ubuntu 22.04. MySQL is an open-source SQL database management system distributed and supported by Oracle Corporation. It is a relational database management system that provides fast, reliable, scalable, and easy usage. MySQL works in client/server or embedded systems. […]

The post How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
In this tutorial we are going to explain how to reset MySQL or MariaDB Root password on Ubuntu 22.04.

MySQL is an open-source SQL database management system distributed and supported by Oracle Corporation. It is a relational database management system that provides fast, reliable, scalable, and easy usage. MySQL works in client/server or embedded systems.

MariaDB is also a popular open-source relational database management system made by the original MySQL developers. In this tutorial, we are going to install the MariaDB database system and will explain how to reset the root password. Since it is made by MySQL developers, the same commands are applied for both systems.

Installing MariaDB or MySQL and resetting the root password is a straightforward process that may take up to 15 minutes. Let’s get started!

Prerequisites

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

Step 1. Update the System

Every fresh installation of Ubuntu 22.04 needs to be updated. That’s why we need to update the package to the latest versions available.

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

Step 2. Install MariaDB database service.

To install the MariaDB database server, execute the command below.

sudo apt install mariadb-server -y

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.6.12 database server 
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) 
Active: active (running) since Thu 2023-09-07 09:28:14 CDT; 17s ago 
Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ 
Main PID: 2722 (mariadbd) 
Status: "Taking your SQL requests now..." 
Tasks: 16 (limit: 4558) 
Memory: 61.2M 
CPU: 528ms 
CGroup: /system.slice/mariadb.service └─2722 /usr/sbin/mariadbd

Step 3. Secure MariaDB database service

Next we will secure the MariaDB database service and will set a root password. To do that execute the following command:

mysql_secure_installation

You need to pass these steps with the following options:

Switch to unix_socket authentication [Y/n] Y 
Change the root password? [Y/n] Y 
New password: 
Re-enter new password: 
Password updated successfully! 
Reloading privilege tables.. 
... Success! 
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

After installation login to the MySQL console will not ask for a password and will let you without any password, even though we set it in the previous step.

To set MySQL to ask you for a password execute the following command:

ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('YourStrongPasswordHere');

Now, if you try to log in only with this command: mysql you will get this message:

root@host:~# mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

You need to use the following command and enter your password:

root@host:~# mysql -u root -p 
Enter password: 
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 64 Server version: 10.6.12-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04 

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 
MariaDB [(none)]>

Step 4. Reset MariaDB Root password

In the previous step we set the root password for the MariaDB root user to be YourStrongPasswordHere. We know our root password but in some cases, the admins or developers manage to lose it and need to log in to the MySQL server.

So, to set a new root password we must follow the next steps:

First stop the MariaDB service with the following command:

systemctl stop mariadb

After stopping the service check the status:

systemctl status mariadb

You should get the following output:

root@host:~# systemctl status mariadb 
○ mariadb.service - MariaDB 10.6.12 database server 
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) 
Active: inactive (dead) since Thu 2023-09-07 10:13:33 CDT; 36s ago 
Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ 
Process: 2722 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS) 
Main PID: 2722 (code=exited, status=0/SUCCESS) 
Status: "MariaDB server is down" 
CPU: 1.760s

Now, when the service is stopped we need to start it without permission checking and without networking to prevent other users from connecting in the meantime:

sudo mysqld_safe --skip-grant-tables --skip-networking &

The ampersand will allow us to use the terminal. Now, execute the following command:

mysql -u root

This will connect us without a password. Flush the privileges first and then change the password with the commands below:

FLUSH PRIVILEGES; 
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('NewStrongPasswordHere'); EXIT;

Now, the password is changed from YourStrongPasswordHere TO NewStrongPasswordHere.

Next we need to kill the process id manually for the mysql service. To find it execute the following command:

ps aux | grep mysqld_safe

You will get output similar to this: root@host:~#

ps aux | grep mysqld_safe 
root 3292 0.0 0.1 14100 5596 pts/0 S 05:18 0:00 sudo mysqld_safe --skip-grant-tables --skip-networking 
root 3293 0.0 0.0 14100 880 pts/1 Ss+ 05:18 0:00 sudo mysqld_safe --skip-grant-tables --skip-networking 
root 3294 0.0 0.0 2888 1732 pts/1 S 05:18 0:00 /bin/sh /usr/bin/mysqld_safe --skip-grant-tables --skip-networking 
root 3427 0.0 0.0 9208 2288 pts/0 S+ 05:28 0:00 grep mysqld_saf

In our case, the process id is 3292. To kill this process execute the following command:

kill -9 3292

Now, we can start the MariaDB service normally:

sudo systemctl start mariadb

Now, you can use the NewStrongPasswordHere.

Congratulations! You just learned how to reset MySQL or MariaDB Root password on Ubuntu 22.04. Of course, you do not have to do this if you find any difficulties. You can contact our technical support by submitting a support ticket or live chat. We are available 24/7

If you liked this post on how to reset your MySQL or MariaDB root password on Ubuntu 22.04, please share it with your friends on the social networks or simply leave a reply below. Thanks.

The post How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04/feed/ 1
How to Install Go on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-install-go-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-install-go-on-ubuntu-22-04/#comments Sun, 15 Oct 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1899 Golang, also known as Go, is a modern programming language developed by Google in 2007 to improve its programming productivity. Go is open-source, and it is getting more and more popular and used in many applications such as Docker, Kubernetes, and static generators like Hugo. This language is well-designed to be used by professionals for […]

The post How to Install Go on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
Golang, also known as Go, is a modern programming language developed by Google in 2007 to improve its programming productivity.

Go is open-source, and it is getting more and more popular and used in many applications such as Docker, Kubernetes, and static generators like Hugo.

This language is well-designed to be used by professionals for application development. Go is easy to create and maintain, making it an ideal programming language for building efficient software. Go is reliable, easy to build, and has efficient software that scales fast. In this tutorial, we will show you how to install Go on Ubuntu 22.04.

Prerequisites

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

Step 1. Log in to the server

First, log in to your Ubuntu 22.04 server through 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 IP address and SSH port number, respectively. Additionally, replace “root” with the username of the system user with sudo privileges.

You can check whether you have the proper Ubuntu 22.04 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 22.04 LTS
Release: 22.04
Codename: jammy

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

# apt update -y

Step 2. Install Go

There are several methods of installing Go on Ubuntu 22.04. The first option is to install Go from the default Ubuntu 22.04 repository. The second option is to download the Go binary provided by their developer. And the third option is to install it from the source.

To install it from the default Ubuntu repository, we can simply execute this command to install Go.

# apt install golang-go

At the time of this writing, you will get Go version 1.18.1 after installing it from the Ubuntu repository; we can check it by running the command below.

# go version

The second method is to install Go by using the binary package. If you want the more recent version of Go and install it the easier way, we can download the binary distribution from the Go website. You can check and get the download link from their website at https://go.dev/dl/; let’s download Go now.

# wget https://go.dev/dl/go1.21.0.linux-amd64.tar.gz -O go.tar.gz

Once downloaded, we need to extract the file.

# tar -C /usr/local -xzvf go.tar.gz

The command above will extract the files and you should see the directory /usr/local/go/. So, at this moment, you can access the go executable at /usr/local/go/bin/go.

Next, we need to tell our system where to find the Go binary file. To do this, we need to set the PATH environment variable. We need to add a path to the ~/.profile or ~/.bashrc file for the current user.

# nano ~/.profile

Then, append these lines to the file:

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

Don’t forget to save the file and then load the new PATH variables into the current shell by running the following command.

# source ~/.profile

At this point, you can simply type ‘go’ every time you need to call /usr/local/bin/go. For example, let’s check the Go version:

# go version

The version of Go installed on your Ubuntu system will be displayed on the terminal. It will show you an output like this:

go version go1.21.0 linux/amd64

Step 3. Use Go

Once Go is downloaded and configured, it is time to test it. In this case, we will run a simple code written in the Go language to check if the environment is working on our Ubuntu 22.04 system. Let’s create a file.

# nano sample.go

Then, insert the following into the file.

package main
import "fmt"
func main() {
fmt.Printf("Hello World\n")
}

Save the file, then exit. Next, execute this command to run the script.

# go run sample.go

The command will return an output like this:

That’s it. You have successfully installed Go on your Ubuntu 22.04 system.

Of course, you don’t need to install Go on Ubuntu 22.04 VPS if you are using one of our Ubuntu VPS plans, which you can ask Linux experts to install Go on Ubuntu 22.04 system for you. Our administrators are available 24/7 and will start working on your request immediately; always trust our epic support.

PS. If you liked this article on how to install Go on Ubuntu 22.04, share it with your friends on social media or leave a comment in the comment section.

The post How to Install Go on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-go-on-ubuntu-22-04/feed/ 1
How to Install Contao on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-install-contao-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-install-contao-on-ubuntu-22-04/#comments Sat, 30 Sep 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1873 Contao is a robust open-source content management system that is user-friendly, instinctive, and adaptable, and it enables you to develop websites in various languages and designs. Contao can also be incorporated into a standard Symfony application. In this guide, we will demonstrate how to set up Contao on Ubuntu 22.04. Prerequisites Step 1. Log in […]

The post How to Install Contao on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
Contao is a robust open-source content management system that is user-friendly, instinctive, and adaptable, and it enables you to develop websites in various languages and designs.

Contao can also be incorporated into a standard Symfony application. In this guide, we will demonstrate how to set up Contao on Ubuntu 22.04.

Prerequisites

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

Step 1. Log in via SSH

Let’s log in to your Ubuntu 22.04 VPS with SSH as a root user or as a regular user with sudo privileges.

ssh root@IP_Address -p Port_number

If you cannot log in as root, remember to replace “root” with a user that has sudo privileges. Additionally, replace “IP_Address” and “Port_Number” with your server’s respective IP address and SSH port.

You can check whether you have the correct 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 22.04.1 LTS
Release: 22.04
Codename: jammy

Step 2. Install and Configure Apache

Contao was initially created for the well-known LAMP stack, but it can operate on any web server that offers an up-to-date edition of PHP and MySQL. In this step, we are going to install Apache as the webserver. Let’s install Apache now.

# apt install apache2

On Ubuntu machines, Apache will automatically start upon installation. To verify this, you can execute the command below.

# systemctl status apache2

You will see the status there, apache is functioning.

Contao requires mod_rewrite, and the rewrite module is not enabled by default, let’s enable it now.

# a2enmod rewrite

After enabling a module, we need to restart apache to activate the new configuration.

# systemctl restart apache2

Now, let’s create two directories for our Contao installation.

# mkdir -p /var/www/html/yourdomain.com/{web,contao-manager}

Then, let’s give them the appropriate permission.

# chown -R www-data. /var/www/html/yourdomain.com/

The next step is to create an apache virtual host.

# nano /etc/apache2/sites-available/yourdomain.com.conf

Then add the following in to the file

<VirtualHost *:80>

ServerAdmin admin@yourdomain.com
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /var/www/html/yourdomain.com/web

ErrorLog ${APACHE_LOG_DIR}/yourdomain.com_error.log
CustomLog ${APACHE_LOG_DIR}/domain2.com_access.log combined

<Directory  /var/www/html/yourdomain.com/web>
AllowOverride All
Require all granted
</Directory>

</VirtualHost>

Save the file, then exit. Make sure to replace yourdomain.com with your actual domain name or subdomain name pointing to your server.

Once the virtual host is added, we need to activate it.

# a2ensite yourdomain.com

Then, restart or reload apache

# systemctl restart apache2

Step 3. Install MariaDB Server

Contao supports MySQL server version 8.0+ or equivalent MariaDB server. In this step, we are going to install the MariaDB server from the default Ubuntu repository. To install the MariaDB server, execute this command below:

# apt install mariadb-server

That’s it, the MariaDB server should be up and running now.

Step 4. Create a Database

After installing the MariaDB server on an Ubuntu system, the MariaDB server will run automatically. Therefore, we can now create a new database and database user for our Contao website. Let’s log in to MySQL shell as root users and create a database for our Contao website.

# mysql

Once logged in to MySQL shell, we can run the following commands.

mysql> CREATE DATABASE contao;
mysql> GRANT ALL on contao.* to contao@localhost identified by 'm0d1fyth15';
mysql> FLUSH PRIVILEGES;
mysql> \q

Make sure to create a more complicated database password, and replace m0d1fyth15 in the command above with a more secure one.

The next step is optional but highly recommended. We need to create a password for our MySQL root user. Let’s invoke this command to proceed.

Step 5. Install Composer

Contao utilizes Composer, a tool for managing dependencies, as the officially endorsed approach for installation. Let’s execute the following command below to download the Composer installer using wget command:

# wget -O composer-setup.php https://getcomposer.org/installer

Once downloaded, we need to execute the following command to install and setup composer on our Ubuntu machine:

# php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Verify the installation and check the installed build version of Composer:

# composer -V

The command above will return an output like this.

Composer version 2.5.8 2023-06-09 17:13:21

Step 6. Install PHP

Contao requires at least PHP 7.4, and specifically for Contao 5, PHP Version 8.1.0 or higher is required. On the Ubuntu 22.04 system, PHP 8.1 is the lowest version we can install. Let’s install PHP and its extensions from the Ubuntu repository.

# apt install php-{xml,pear,intl,common,json,curl,mbstring,mysql,gd,imagick,zip,opcache} libapache2-mod-php

Step 7. Install Contao

There are two methods to install Contao on your server, using Contao Manager and using the command line. In this tutorial, we will show you how to install Contao using Contao Manager.

First, let’s enter /var/www/html/domain1.com/web

# cd /var/www/html/domain1.com/web
# sudo -u www-data wget https://download.contao.org/contao-manager/stable/contao-manager.phar -O contao-manager.phar.php

Navigate to http://yourdomain.com/contao-manager.phar.php

Click on Create Account button

Click on the Setup button to install Contao

Click on Get Started button

Click Continue

Select distribution, we are going to install version 5.1; click Install

Please wait while the Contao Manager is running task operations in the background.

Once completed, you will be presented with a database configuration page.

Please fill the forms with the database details we created in the previous step in this tutorial. , make sure to choose MariaDB in the Server Version dropdown menu. Click the Save button to save the config.

Click on Check database

Now, click on the Execute button to create database tables, and once completed, click on the Confirm & Close button.

You will be brought to this page

Click on Continue to create a new account

Click on Add Account

That’s it! You have installed Contao on Ubuntu 22.04. You can click on Login to Contao to start using Contao

Login using the account credentials you created a moment ago.

You are logged in now, and you can start customizing your Contao website.

Congratulations! You have successfully installed Contao on Ubuntu 22.04.

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

If you liked this post about how to install Contao on Ubuntu 22.04, please share it with your friends on social networks or simply leave a comment in the comments section. Thanks.

The post How to Install Contao on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-contao-on-ubuntu-22-04/feed/ 2
How to Install Akaunting on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-install-akaunting-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-install-akaunting-on-ubuntu-22-04/#respond Fri, 15 Sep 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1864 Akaunting is a free and open-source software written in PHP using the Laravel framework and modern technologies such as VueJS, Tailwind, RESTful API and etc. The information is stored in MySQL database service, and for web servers, we can use Nginx, Apache, or LiteSpeed. In this blog post, we will install Akaunting with the LAMP […]

The post How to Install Akaunting on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
Akaunting is a free and open-source software written in PHP using the Laravel framework and modern technologies such as VueJS, Tailwind, RESTful API and etc.

The information is stored in MySQL database service, and for web servers, we can use Nginx, Apache, or LiteSpeed. In this blog post, we will install Akaunting with the LAMP stack.

Installing Akaunting with LAMP stack on Ubuntu 22.04 is a straightforward process that may take up to 15 minutes. Let’s get started!

Prerequisites

  • A server with Ubuntu 22.04 as OS
  • User privileges: root or non-root user with sudo privileges
  • A valid domain with pointed A record to the server IP address

Step 1. Update the System

Before we start with the installation of the LAMP stack and Akaunting, we will update the system packages to their latest versions available.

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

Step 2. Install LAMP Stack

First, we will install the Apache Web server.

sudo apt-get install apache2 -y

Once installed, start and enable the service.

sudo systemctl enable apache2 && sudo systemctl start apache2

Check if the service is up and running:

sudo systemctl status apache2

You should receive the following output:

oot@host:~# sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-08-05 05:16:02 CDT; 1s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 70629 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 70633 (apache2)
      Tasks: 6 (limit: 4557)
     Memory: 13.6M
        CPU: 140ms
     CGroup: /system.slice/apache2.service

Next, we will install PHP8.1 with its extensions:

sudo apt-get install php8.1 php8.1-cli php8.1-common php8.1-imap php8.1-redis php8.1-snmp php8.1-xml php8.1-zip php8.1-mbstring php8.1-curl php8.1-mysqli php8.1-intl php8.1-bcmath php8.1-gd libapache2-mod-php -y

To check the installed PHP version execute the php -v command:

root@host:~# php -v
Created directory: /var/lib/snmp/cert_indexes
PHP 8.1.2-1ubuntu2.13 (cli) (built: Jun 28 2023 14:01:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.13, Copyright (c), by Zend Technologies

The last of the LAMP stack is the MariaDB database service:

sudo apt-get install mariadb-server -y

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:

● mariadb.service - MariaDB 10.6.12 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-08-05 05:19:21 CDT; 15s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 75849 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 15 (limit: 4557)
     Memory: 61.3M
        CPU: 786ms
     CGroup: /system.slice/mariadb.service
             └─75849 /usr/sbin/mariadbd

Step 3. Create an Akaunting database and user

Next, we need to create an Akaunting database, the Akaunting user, and grant the permissions for that user to the database.

 CREATE USER 'akaunting'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';
 CREATE DATABASE akaunting;
 GRANT ALL PRIVILEGES ON akaunting.* TO 'akaunting'@'localhost';
 FLUSH PRIVILEGES;
 EXIT;

Step 4. Download and install Akaunting

Before we install Akaunting, we first need to download it in the default Apache document root:

cd /var/www/html

wget -O Akaunting.zip https://akaunting.com/download.php?version=latest

unzip Akaunting.zip

rm Akaunting.zip

Set the right permissions to files and folders.

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

cd /var/www/html

find . -type d -exec chmod 755 {} \;

find . -type f -exec chmod 644 {} \;

Step 5. Create Apache Virtual Host File

Go into the Apache directory and create a configuration file for the Akaunting.

cd /etc/apache2/sites-available/

touch akaunting.conf

Open the file, paste the following lines of code, save the file and close it.

<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html

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

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

</VirtualHost>

Enable the Apache configuration for Akaunting and rewrite the module.

sudo a2enmod rewrite

sudo a2ensite akaunting.conf

Check the syntax:

apachectl -t

You should receive the following output:

root@vps:~# apachectl -t
Syntax OK

If the syntax is OK, restart the Apache service.

systemctl reload apache2

Once the Apache service is restarted, you can finish the Akaunting installation at http://yourdomain.com

Step 6. Finish the Installation

On the first screen, choose your language and click on the Next button.

On the next screen, enter the database credentials you created in one of the previous steps:

Then create your company email and login credentials:

Once done, log in to the Akaunting dashboard.

Once logged in, you can click on Skip this step:

Add your currency and click on the Next button:

On the next window, click on the Skip this step, and you will be automatically redirected to the Akaunting Dashboard.

That was all. You successfully installed and configured Akaunting on Ubuntu 22.04 with the LAMP stack.

If you do not want to configure it on your own, you can sign up for one of our NVMe VPS plans and submit a support ticket. Our admins are available 24/7 and will start to work on your request immediately. Always trust our epic support.

If you liked this post on how to install Akaunting on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks.

The post How to Install Akaunting on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-akaunting-on-ubuntu-22-04/feed/ 0
How to Install Anaconda on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-install-anaconda-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-install-anaconda-on-ubuntu-22-04/#respond Tue, 15 Aug 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1854 Anaconda is an open-source environment and package manager, also a distribution of the Python programming language specifically designed for data science and machine learning tasks. One of the main advantages of Anaconda is its extensive library support. It includes popular libraries such as NumPy, Pandas, SciPy, Matplotlib, scikit-learn, and many others. These libraries are widely […]

The post How to Install Anaconda on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
Anaconda is an open-source environment and package manager, also a distribution of the Python programming language specifically designed for data science and machine learning tasks.

One of the main advantages of Anaconda is its extensive library support. It includes popular libraries such as NumPy, Pandas, SciPy, Matplotlib, scikit-learn, and many others.

These libraries are widely used for numerical computing, data manipulation, visualization, machine learning, and other data-related tasks. Another key feature of Anaconda is its support for creating isolated environments. Environments allow you to create separate Python environments with specific versions of Python and libraries, ensuring project reproducibility and avoiding conflicts between different packages and versions. This feature is particularly useful when working on multiple projects with different requirements.

Prerequisites

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

Step 1. Download the Anaconda installer

To download Anaconda from the anaconda repo, you can use the following command:

$ wget https://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-x86_64.sh

Please note, at the time of writing this article, the 2023.03-1 was the latest anaconda version available; you can check for the latest version at the anaconda repo.

Now you can rename the installation script to a shorter name, for example, anaconda.sh:

$ mv Anaconda3-2023.03-1-Linux-x86_64.sh anaconda.sh

To check the integrity of this installer file, you can use the following command for hash verification with SHA-256 checksum:

$ sha256sum anaconda.sh

95102d7c732411f1458a20bdf47e4c1b0b6c8a21a2edfe4052ca370aaae57bab anaconda.sh

The installer file is verified; now, you are ready to run the installer.

Step 2. Install Anaconda

To start the anaconda installation, run the command below in the directory where you downloaded the installer:

$ bash anaconda.sh

You will receive this output with several questions, which you should confirm and choose the location where you want to install Anaconda.

Welcome to Anaconda3 20223.03

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue

You can press ENTER to continue the installation, next you will have go through the license and approve the license terms with yes:

The next step is to specify the location for the anaconda3 installation, you enter a new location or use the default one.

Anaconda3 will now be installed into this location:
/home/user/anaconda3

Press ENTER to confirm the location

Press CTRL-C to abort the installation

Or specify a different location below

[/home/user/anaconda3] >>>

Once the installation is completed, you can use the following command to activate the installation:

$ source ~/.bashrc

Step 3. Using Anaconda

Anaconda has its own package manager called “conda,” which allows users to install, update, and manage packages and dependencies easily. Conda helps to ensure that all the required libraries and dependencies for a particular project are installed correctly and compatible, thus simplifying the setup process.
To list installed packages, you can type:

$ conda list

To install new Python packages, use conda install and the name of the package:

(base) user@server:$ conda install numpy

You should receive the following output:


Collecting package metadata (current_repodata.json): done
Solving environment: done

Package Plan

environment location: /home/ec2-user/anaconda3

added / updated specs:
- numpy

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
intel-openmp-2023.1.0      |   hdb19cb5_46305        17.1 MB
mkl-2023.1.0               |   h6d00ec8_46342       171.5 MB
mkl-service-2.4.0          |  py310h5eee18b_1          54 KB
mkl_fft-1.3.6              |  py310h1128e8f_1         207 KB
mkl_random-1.2.2           |  py310h1128e8f_1         284 KB
numpy-1.24.3               |  py310h5f9d8c6_1          11 KB
numpy-base-1.24.3          |  py310hb5e798b_1         6.2 MB
tbb-2021.8.0               |       hdb19cb5_0         1.6 MB
------------------------------------------------------------
                                       Total:       197.1 MB

The following NEW packages will be INSTALLED:

blas pkgs/main/linux-64::blas-1.0-mkl
intel-openmp pkgs/main/linux-64::intel-openmp-2023.1.0-hdb19cb5_46305
mkl pkgs/main/linux-64::mkl-2023.1.0-h6d00ec8_46342
mkl-service pkgs/main/linux-64::mkl-service-2.4.0-py310h5eee18b_1
mkl_fft pkgs/main/linux-64::mkl_fft-1.3.6-py310h1128e8f_1
mkl_random pkgs/main/linux-64::mkl_random-1.2.2-py310h1128e8f_1
numpy pkgs/main/linux-64::numpy-1.24.3-py310h5f9d8c6_1
numpy-base pkgs/main/linux-64::numpy-base-1.24.3-py310hb5e798b_1
tbb pkgs/main/linux-64::tbb-2021.8.0-hdb19cb5_0

Proceed ([y]/n)? y

This will install the new conda package. You can also use the pip command to install some python packages or check the already installed python packages with pip list.

You can easily create Anaconda Environments using the following command:

$ conda create --name new-env

To specify which version you want python to be in this conda environment, you can use the command:

$ conda create -n env38 python=3.8

Once the environment has been created, you can activate it with the command:

$ conda activate env38

If you now check the Python version, you will notice that it is the Python 3.8 version, the one you specified previously.

$ python3 --version
Python 3.8.16

You can exit this environment with the command:

$ conda deactivate

Congratulations! You successfully installed Anaconda on Ubuntu 22.04. If you have any difficulties with the installation process, you can contact our technical support, and they will install and configure Anaconda for you. We are available 24/7. All you need to do is sign up for one of our NVMe VPS plans and submit a support ticket.

The post How to Install Anaconda on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-anaconda-on-ubuntu-22-04/feed/ 0
How to Install and Switch Python Versions on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-install-and-switch-python-versions-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-install-and-switch-python-versions-on-ubuntu-22-04/#comments Sun, 30 Jul 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1840 In this tutorial, we are going to explain in step-by-step detail how to install multiple Python versions on Ubuntu 22.04 Python is a high-level, general-purpose programming language compatible with different operating systems such as MacOS, Windows, Linux and etc. In this blog post, we will focus on installing Python in the Linux distributions. Also, sometimes […]

The post How to Install and Switch Python Versions on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we are going to explain in step-by-step detail how to install multiple Python versions on Ubuntu 22.04

Python is a high-level, general-purpose programming language compatible with different operating systems such as MacOS, Windows, Linux and etc.

In this blog post, we will focus on installing Python in the Linux distributions. Also, sometimes on one Linux server, it is necessary to be installed multiple Python versions. This tutorial will teach you about installation and changing between different versions.

Installing multiple Python versions on Ubuntu 22.04 is a very easy and straightforward process that may take up to 15 minutes. Let’s get things done!

Prerequisites

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

Update the System

Every fresh installation of the operating system needs the packages to be updated to the latest versions available.

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

Step 1. Install Python 3.10

We will start with the latest version available in the default repository of Ubuntu 22.04. To install python3.10 execute the following command:

sudo apt install python3.10 -y

To check the installed version, execute the command python3.10 -V. You should receive the following output:

root@host:~# python3.10 -V
Python 3.10.6

Step 2. Install Python 3.8

The second Python version on our list will be Python 3.8. To install it, execute the following command:

sudo apt install python3.8 -y

To check the installed version, execute the command python3.8 -V. You should receive the following output:

root@host:~# python3.8 -V
Python 3.8.16

Step 3. Install Python 3.6

The third Python version will be the Python 3.6 version. Let’s execute the following command:

sudo apt install python3.6 -y

As you noticed, the installation process failed with the following message:

root@host:~# sudo apt install python3.6 -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python3.6
E: Couldn't find any package by glob 'python3.6'

This means that Python3.6 is not in the default repository of Ubuntu 22.04. We will need to download the build from the source. To do that, execute the following command:

cd /opt

wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz

tar xfv Python-3.6.9.tgz

cd /Python-3.6.9

Before we proceed with installation, we need to install the prerequisites for the older Python versions:

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev libgdbm-dev libnss3-dev libedit-dev libc6-dev

After all these preparations, we can finally build and install it with the following commands:

./configure --enable-optimizations

sudo make altinstall

To check the installed version, execute the command python3.6 -V. You should receive the following output:

root@host:/opt/Python-3.6.9# python3.6 -V
Python 3.6.9

Step 4. Install Python 3.5

The last version of Python in this blog post will be the Python3.5 version. We will download and install the same way as the Python3.6

cd /opt

wget https://www.python.org/ftp/python/3.5.10/Python-3.5.10.tgz

tar xfv Python-3.5.10.tgz

cd Python-3.5.10/

./configure --enable-optimizations

sudo make altinstall

To check the installed version, execute the command python3.5 -V. You should receive the following output:

root@host:/opt/Python-3.5.10# python3.5 -V
Python 3.5.10

Step 5. Switch between Python versions

In the last step of this tutorial, we are going to explain how you can switch between different Python versions. First, you need to know that the newer Python versions installed from the default repository are located in the /usr/bin directory on the server, while the older versions built from the source are located in /usr/local/bin directory.

We need to create symbolic links for every installed Python version, including the path of the installed Python version. Execute the following commands one by one:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
sudo update-alternatives --install /usr/local/bin/python python /usr/local/bin/python3.6 3
sudo update-alternatives --install /usr/local/bin/python python /usr/local/bin/python3.5 4

Your command line should look like this:

root@host:/# sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
update-alternatives: using /usr/bin/python3.10 to provide /usr/bin/python (python) in auto mode
root@host:/opt/Python-3.6.9# sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
update-alternatives: using /usr/bin/python3.8 to provide /usr/bin/python (python) in auto mode
root@host:/opt/Python-3.6.9# sudo update-alternatives --install /usr/local/bin/python python /usr/local/bin/python3.6 3
update-alternatives: renaming python link from /usr/bin/python to /usr/local/bin/python
update-alternatives: using /usr/local/bin/python3.6 to provide /usr/local/bin/python (python) in auto mode
root@host:/opt/Python-3.6.9# sudo update-alternatives --install /usr/local/bin/python python /usr/local/bin/python3.5 4
update-alternatives: using /usr/local/bin/python3.5 to provide /usr/local/bin/python (python) in auto mode

To list and choose which Python version should be active, execute the following command:

sudo update-alternatives --config python

The output should look like this:

root@host:/# sudo update-alternatives --config python
There are 4 choices for the alternative python (providing /usr/local/bin/python).

  Selection    Path                      Priority   Status
------------------------------------------------------------
* 0            /usr/local/bin/python3.5   4         auto mode
  1            /usr/bin/python3.10        1         manual mode
  2            /usr/bin/python3.8         2         manual mode
  3            /usr/local/bin/python3.5   4         manual mode
  4            /usr/local/bin/python3.6   3         manual mode

You can enter any number and use that Python version. For example, we choose the Python3.10 by entering the number 1

Execute the command sudo update-alternatives –config python again, and you will notice the changed version:

root@host:/# sudo update-alternatives --config python
There are 4 choices for the alternative python (providing /usr/local/bin/python).

  Selection    Path                      Priority   Status
------------------------------------------------------------
  0            /usr/local/bin/python3.5   4         auto mode
* 1            /usr/bin/python3.10        1         manual mode
  2            /usr/bin/python3.8         2         manual mode
  3            /usr/local/bin/python3.5   4         manual mode
  4            /usr/local/bin/python3.6   3         manual mode

Congratulations! You successfully installed multiple Python versions on your system and learned how to switch them. Of course, you do not have to do this by yourself. You can contact our technical support, and the admins will help you with any aspect of the installation and configuration of Python versions. We are available 24/7.

If you liked this post on how to Install and Switch Python Versions in Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks.

The post How to Install and Switch Python Versions on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-and-switch-python-versions-on-ubuntu-22-04/feed/ 7
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 Icinga 2 on Ubuntu https://linuxhostsupport.com/blog/how-to-install-icinga-2-on-ubuntu/ https://linuxhostsupport.com/blog/how-to-install-icinga-2-on-ubuntu/#comments Fri, 30 Jun 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1799 In this tutorial, we are going to explain in step-by-step detail how to install Icinga 2 on Ubuntu 22.04 Icinga is a free and open-source monitoring tool used for sending alerts when failures occur on the servers. Icinga is written in C++ and PHP and stores the information in the MySQL database. It offers many […]

The post How to Install Icinga 2 on Ubuntu appeared first on LinuxHostSupport.

]]>
In this tutorial, we are going to explain in step-by-step detail how to install Icinga 2 on Ubuntu 22.04

Icinga is a free and open-source monitoring tool used for sending alerts when failures occur on the servers. Icinga is written in C++ and PHP and stores the information in the MySQL database. It offers many features, such as modern user interface database connectors for MySQL, PostgreSQL, Oracle, REST API, etc. In this blog post, we will install Icinga 2 with the LAMP stack.

Installing Icinga 2 with LAMP stack is a process that may take up to 30 minutes. Let’s get started!

Prerequisites

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

Step 1. Update the System

Before we start to install the software, we need to update the system packages to the latest versions available.

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

Step 2. Install LAMP stack

First of the LAMP stack is the Apache Web server. To install it execute the following command:

sudo apt install apache2 -y

Once installed, start and enable the service.

sudo systemctl enable apache2 && sudo systemctl start apache2

Check if the service is up and running:

sudo systemctl status apache2

You should receive the following output:

root@host:~# sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-04-22 18:00:43 CDT; 17min ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 792 (apache2)
      Tasks: 7 (limit: 4571)
     Memory: 22.5M
        CPU: 246ms
     CGroup: /system.slice/apache2.service

Next is PHP, along with its extensions. To install the PHP8.1 along with extensions, execute the following command:

sudo apt-get install php8.1 php8.1-cli php8.1-common php8.1-imap php8.1-redis php8.1-snmp php8.1-xml php8.1-zip php8.1-mbstring php8.1-curl libapache2-mod-php

The last of the LAMP stack is the MariaDB database server. To install it execute the command below.

sudo apt install mariadb-server -y

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.6.12 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-04-22 18:19:53 CDT; 9s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 5829 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 16 (limit: 4571)
     Memory: 61.4M
        CPU: 514ms
     CGroup: /system.slice/mariadb.service
             └─5829 /usr/sbin/mariadbd

Step 3. Install Icinga 2

First, we will add the GPG key, and will create a repository:

wget -O - https://packages.icinga.com/icinga.key | gpg --dearmor -o /usr/share/keyrings/icinga-archive-keyring.gpg

. /etc/os-release; if [ ! -z ${UBUNTU_CODENAME+x} ]; then DIST="${UBUNTU_CODENAME}"; else DIST="$(lsb_release -c| awk '{print $2}')"; fi; \
 echo "deb [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/ubuntu icinga-${DIST} main" > \
 /etc/apt/sources.list.d/${DIST}-icinga.list
 echo "deb-src [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/ubuntu icinga-${DIST} main" >> \
 /etc/apt/sources.list.d/${DIST}-icinga.list

Update the system and install Icinga2

sudo apt update -y

sudo apt install icinga2 -y

After installation, start and enable the icinga2 service.

sudo systemctl start icinga2 && sudo systemctl enable icinga2

Check the status of Icinga 2:

sudo systemctl status icinga2

You should get the following output:

root@host:~# sudo systemctl status icinga2
● icinga2.service - Icinga host/service/network monitoring system
     Loaded: loaded (/lib/systemd/system/icinga2.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/icinga2.service.d
             └─limits.conf
     Active: active (running) since Sat 2023-04-22 19:06:11 CDT; 4min 35s ago
   Main PID: 11632 (icinga2)
     Status: "Startup finished."
      Tasks: 16
     Memory: 14.3M
        CPU: 435ms
     CGroup: /system.slice/icinga2.service

Step 4. Install the Icinga2 IDO Module

To install the Icinga2 IDO module, execute the following command:

sudo apt install icinga2-ido-mysql -y

While installing, choose Yes on both windows. It is about Icinga2 using MySQL.

After this, we need to create an icinga2-ido-mysql database with the following commands:

CREATE DATABASE icinga_ido_db;
GRANT ALL ON icinga_ido_db.* TO 'icinga_ido_db'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';
FLUSH PRIVILEGES;
EXIT;

Once the database is created, import the Icinga2 IDO schema with the following command:

sudo mysql -u root -p icinga_ido_db < /usr/share/icinga2-ido-mysql/schema/mysql.sql

Once the schema is imported, the next is to enable the Icinga2 IDO module:

nano /etc/icinga2/features-available/ido-mysql.conf

Paste the following lines of code:

/**
 * The db_ido_mysql library implements IDO functionality
 * for MySQL.
 */

library "db_ido_mysql"

object IdoMysqlConnection "ido-mysql" {
  user = "icinga_ido_db",
  password = "YourStrongPasswordHere",
  host = "localhost",
  database = "icinga_ido_db"
}

Save the file, close it and enable the Icinga2-ido-mysql with the following command:

sudo icinga2 feature enable ido-mysql

After this restart the Icinga2 service:

systemctl restart icinga2

Step 5. Install and Setup IcingaWeb2

To install Icinga Web execute the following commands:

sudo apt install icingaweb2 icingacli -y

Next is to create a second database for the Icinga web:

CREATE DATABASE icingaweb2;
GRANT ALL ON icingaweb2.* TO 'icingaweb2'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';
FLUSH PRIVILEGES;
EXIT;

Next, we need to create an Icinga token:

root@host:~# sudo icingacli setup token create
The newly generated setup token is: dd3a1a8b218be0db

That was all with installing Icinga via the command line. The last step is about finishing the Icinga installation.

Step 6. Finish Icinga Installation

To finish the Icinga installation, you need to access it at http://YourServerIPaddress/icingaweb2/setup.

Enter the token, and follow the pictures if you want to finish the installation:

Set Administrative user and password:

The last is to set up Icinga2 IDO credentials you set before in Step 4.

Congratulations! You successfully installed and configured Icinga2 on Ubuntu 22.04. If you find any difficulties with installing Icinga 2, you can always contact our technical support. All you have to do is 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 installing Icinga2 on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below.

The post How to Install Icinga 2 on Ubuntu appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-icinga-2-on-ubuntu/feed/ 3
How to Install ProcessWire CMS on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-install-processwire-cms-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-install-processwire-cms-on-ubuntu-22-04/#respond Thu, 15 Jun 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1797 In this tutorial, we will show you how to install ProcessWire CMS on Ubuntu 22.04 OS. ProcessWire is a free, open-source content management system written in PHP. It offers many features such as jQuery-styled API, scaling, templates, multi languages, drag-and-drop page lists, and many more that are largely used for developing websites and applications. ProcessWire […]

The post How to Install ProcessWire CMS on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to install ProcessWire CMS on Ubuntu 22.04 OS.

ProcessWire is a free, open-source content management system written in PHP. It offers many features such as jQuery-styled API, scaling, templates, multi languages, drag-and-drop page lists, and many more that are largely used for developing websites and applications. ProcessWire stores the data in the MySQL database server, and in this installation, we will install the ProcessWire CMS with the LAMP stack.

Installing ProcessWire CMS on Ubuntu 22.04 with LAMP stack is a straightforward process that may take up to 15 minutes. Let’s get things done!

Prerequisites

  • A server with Ubuntu 22.04 OS
  • A valid domain with pointed A record to the server IP address
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

It is recommended to have a fresh installation of Ubuntu 22.04 for this setup. After every fresh installation of the OS, we need to update the system packages to the latest versions available.

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

Step 2. Install Apache Web Server

To install the Apache Web server execute the following command:

sudo apt install apache2

Once installed, start and enable the service.

sudo systemctl enable apache2 && sudo systemctl start apache2

Check if the service is up and running:

sudo systemctl status apache2

You should receive the following output:

root@host:~# sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-05-04 11:02:35 CDT; 4min 53s ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 446641 (apache2)
      Tasks: 6 (limit: 4571)
     Memory: 16.8M
        CPU: 558ms
     CGroup: /system.slice/apache2.service

Step 3. Install PHP8 with dependencies

To install the PHP8.1 along with extensions, execute the following command:

sudo apt-get install php8.1 php8.1-cli php8.1-common php8.1-imap php8.1-redis php8.1-snmp php8.1-xml php8.1-zip php8.1-mbstring php8.1-curl libapache2-mod-php

To check the installed PHP version, execute the following command:

php -v

You should receive the following output:

root@host:~# php -v
PHP 8.1.2-1ubuntu2.11 (cli) (built: Feb 22 2023 22:56:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.11, Copyright (c), by Zend Technologies

Step 4. Install the MariaDB database server

To install the MariaDB database server, execute the command below.

sudo apt install 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.6.12 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-05-04 11:06:40 CDT; 5min ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 458296 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 458297 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 458299 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl >
    Process: 458481 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 458485 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
   Main PID: 458336 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 11 (limit: 4571)

Step 5. Create ProcessWire database and user

Next, we need to create a ProcessWire database, the ProcessWire user, and grant the permissions for that user to the database.

 CREATE USER 'processwire'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';
 CREATE DATABASE processwire;
 GRANT ALL PRIVILEGES ON processwire.* TO 'processwire'@'localhost';
 FLUSH PRIVILEGES;
 EXIT;

Step 6. Download and Install ProcessWire

Before we install ProcessWire, we first need to download it in the default Apache document root:

cd /var/www/html

wget https://github.com/processwire/processwire/archive/master.zip

unzip master.zip

mv processwire-master/ processwire/

Set the right permissions to files and folders.

chown -R www-data:www-data processwire/

find . -type d -exec chmod 755 {} \;

find . -type f -exec chmod 644 {} \;

Step 7. Create Apache Virtual Host File

Go into the Apache directory and create a configuration file for the ProcessWire CMS.

cd /etc/apache2/sites-available/

touch processwire.conf

Open the file, paste the following lines of code, save the file and close it.

<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html/processwire

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

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

</VirtualHost>

Enable the Apache configuration for ProcessWire and rewrite module.

sudo a2enmod rewrite

sudo a2ensite processwire.conf

Check the syntax:

apachectl -t

You should receive the following output:

root@vps:~# apachectl -t
Syntax OK

If the syntax is OK, restart the Apache service.

systemctl reload apache2

Once the Apache service is restarted, you can finish the ProcessWire installation at http://yourdomain.com

Step 8. Finish ProcessWire installation

On the first window, click Get Started

On the next window, choose Blank

The third window is for configuration check:

Next, is to fill in the database credentials you set in Step 5

After successful database credentials, hit Continue, and you should see the following screen:

Scroll down and enter your admin credentials for future use:

Once done, the installation process will finish, and you will be able to login to the Admin dashboard

That was all. You successfully installed and configured ProcessWire CMS on Ubuntu 22.04 with the LAMP stack.

If you do not want to configure it on your own, you can sign up for one of our NVMe VPS plans and submit a support ticket. Our admins are available 24/7 and will start work on your request immediately. Always trust our epic support.

If you liked this post on installing ProcessWire CMS on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks.

The post How to Install ProcessWire CMS on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-processwire-cms-on-ubuntu-22-04/feed/ 0
How to Install Jenkins on AlmaLinux 9 https://linuxhostsupport.com/blog/how-to-install-jenkins-on-almalinux-9/ https://linuxhostsupport.com/blog/how-to-install-jenkins-on-almalinux-9/#respond Tue, 30 May 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1788 In this blog post, we will explain how to install Jenkins on AlmaLinux 9 OS. Jenkins is an open-sourced automation software used to automate the process of the developers. It is used for building, testing, and deploying the apps with the process of continuous integration and continuous delivery. Jenkins is written in Java programming language, […]

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

]]>
In this blog post, we will explain how to install Jenkins on AlmaLinux 9 OS.

Jenkins is an open-sourced automation software used to automate the process of the developers. It is used for building, testing, and deploying the apps with the process of continuous integration and continuous delivery. Jenkins is written in Java programming language, running in Java servlet containers such as Apache Tomcat. In this blog post, we will install Jenkins with Apache as a reverse proxy so that you can access it via domain.

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

Prerequisites

  • A server with AlmaLinux 9 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 start with the installation of Jenkins, we will update the system packages to the latest version available.

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

Step 2. Install Java

To install Java execute the following command::

sudo dnf install java-11-openjdk java-11-openjdk-devel -y

To check the installed Java version, execute the following command:

java -version

You should receive the following output:

[root@host ~]# java -version
openjdk version "11.0.18" 2023-01-17 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.18.0.10-2.el9_1) (build 11.0.18+10-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.18.0.10-2.el9_1) (build 11.0.18+10-LTS, mixed mode, sharing)

Step 3. Install Jenkins

We need to add the Jenkins repo and the GPG key because they are not added by default in the AlmaLinux 9. To do that execute the following commands:

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

Once the repo and key are added, update the system.

sudo dnf update -y

After the update, we can install Jenkins with the following command:

sudo dnf install jenkins -y

To start and enable the Jenkins service to execute the following commands:

sudo systemctl start jenkins && sudo systemctl enable jenkins

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

sudo systemctl status jenkins

You should get the following output:

[root@host ~]# sudo systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; vendor preset: disabled)
     Active: active (running) since Tue 2023-03-14 02:53:37 CDT; 14s ago
   Main PID: 38472 (java)
      Tasks: 53 (limit: 24796)
     Memory: 1.2G
        CPU: 1min 41.195s
     CGroup: /system.slice/jenkins.service
             └─38472 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080

Jenkins is running on port 8080, and you can access it at http://YourIPAddress:8080 to finish the installation.

Step 4. Finish Jenkins Installation

After accessing http://YourIPAddress:8080, you will see this screen without entering a password:

As described in the picture, the initial password can be found by executing the following command on your server:

cat /var/lib/jenkins/secrets/initialAdminPassword

Enter it and hit on the Continue button.

In this window, you can choose to install the suggested plugins or select plugins on your own. We will choose to install the suggested plugins.

The installation will start, and you will need to allow some time to finish.

Once the installation is finished next you need to set up the administrator username, password and email:

The Jenkins URL will be displayed in the next window. Click on Save and Finish.

Now, Jenkins is ready for use. Click on the Start using Jenkins button.

The homepage of Jenkins will be displayed.

Congratulations! You successfully installed Jenkins on AlmaLinux 9. If you find this setup difficult, feel free to contact our technical support via live chat or ticket. We are available 24/7

If you liked this post on how to install Jenkins on AlmaLinux 9, please share it with your friends on social networks or simply leave a reply below. Thanks.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-jenkins-on-almalinux-9/feed/ 0
How to Install and Configure Elasticsearch on AlmaLinux https://linuxhostsupport.com/blog/how-to-install-and-configure-elasticsearch-on-almalinux/ https://linuxhostsupport.com/blog/how-to-install-and-configure-elasticsearch-on-almalinux/#comments Mon, 15 May 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1790 Elasticsearch is an open-source search engine built on the Apache Lucene library. Elasticsearch was initially released in 2010 and has become the most popular search engine application ever since. People use Elasticsearch for log analytics, full-text search, operational use cases, etc. Magento, as a well-known e-commerce application also uses Elasticsearch as its search engine. In […]

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

]]>
Elasticsearch is an open-source search engine built on the Apache Lucene library. Elasticsearch was initially released in 2010 and has become the most popular search engine application ever since. People use Elasticsearch for log analytics, full-text search, operational use cases, etc.

Magento, as a well-known e-commerce application also uses Elasticsearch as its search engine. In this tutorial, we will show you how to install and configure Elasticsearch on AlmaLinux.

Prerequisites

  • An AlmaLinux VPS with at least 8GB of RAM
  • root SSH access or a regular user with sudo privileges

Step 1: Log in to your server via SSH

First, you will need to log in to your AlmaLinux 8 VPS via SSH as the root user:

ssh root@IP_Address -p Port_number

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

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

# cat /etc/almalinux-release

It will return an output like this.

AlmaLinux release 9.1 (Lime Lynx)

In this article, we are using ‘root’ to execute the shell commands. If you want to use your regular user with sudo privileges to run the commands, make sure to append ‘sudo’ in front of the commands.

Step 2: Update the system

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

# yum update
# yum upgrade

Step 3. Install Java

Elasticsearch is based on Java, so we need to install it first. We can simply run this command below to install it from the default repository.

# yum install java-11-openjdk java-11-openjdk-devel

Let’s check java version

# java --version

It will show you an output similar to this:

openjdk 11.0.18 2023-01-17 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.18.0.10-2.el9_1) (build 11.0.18+10-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.18.0.10-2.el9_1) (build 11.0.18+10-LTS, mixed mode, sharing)

Step 4. Add repository

In this step, we are going to add the Elasticsearch repository and then install it from the repository. But, there is an issue with importing the Elastic key on AlmaLinux 9, and it is expected for a workaround, you can invoke this command:

# update-crypto-policies --set LEGACY

then reboot the server

Next, create a file called elasticsearch.repo in the /etc/yum.repos.d/ directory

# nano /etc/yum.repos.d/elasticsearch.repo

Paste the following content into that file

[elasticsearch]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

Save the file, then exit from the editor. Next, let’s update the packages to the latest available version.

# yum update
# yum makecache

Step 5. Install Elasticsearch

Elasticsearch is a memory-intensive application. It requires at least 8GB of RAM to run properly. And in this step, we are going to install it using the repository we added earlier in the previous step. Let’s proceed with the installation.

# yum install elasticsearch

Once installed, the elasticsearch service is not automatically running; let’s execute this command below to run Elasticsearch and enable the service.

# systemctl enable --now elasticsearch

That’s it; Elasticsearch should be up and running now we can verify it by running this command.

# systemctl status elasticsearch

The command will show you an output like this:

[root@almalinux ~]# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2023-03-10 17:30:37 WIB; 54s ago
Docs: https://www.elastic.co
Main PID: 1813 (java)
Tasks: 90 (limit: 10907)
Memory: 1.2G
CPU: 57.850s
CGroup: /system.slice/elasticsearch.service
├─1813 /usr/share/elasticsearch/jdk/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=/usr/share/elasticsearch/bin/elasticsearch -Dcli.libs=lib/too>
├─1872 /usr/share/elasticsearch/jdk/bin/java -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -Djava.security.manager=allow -XX:+AlwaysPreTouch>
└─1893 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller

Mar 10 17:30:08 almalinux.rosehosting.com systemd[1]: Starting Elasticsearch...
Mar 10 17:30:37 almalinux.rosehosting.com systemd[1]: Started Elasticsearch.

Step 6. Configure Elasticsearch

Elasticsearch has three main configuration files, and you can find them in /etc/elasticsearch directory.

  • elasticsearch.yml for configuring Elasticsearch itself
  • jvm.options for configuring Elasticsearch JVM settings
  • log4j2.properties for configuring Elasticsearch logging

In this step, we are going to modify the elasticsearch.yml file, and the configuration file uses YAML format.

For example, we can edit the listening IP address. By default, Elasticsearch is only accessible on localhost. We can set a different address to expose our Elasticsearch node on the network:

# nano /etc/elasticsearch/elasticsearch.yml

Find this line

#network.host: 192.168.0.1

Uncomment it and modify the IP address. Let’s change it to 0.0.0.0.

network.host: 0.0.0.0

We can also modify the port, it is port 9200 by default, and we can change it to any port we like.

#http.port: 9200

Uncomment and modify the port like this:

http.port: 9222

Save the file, then exit from the editor. Next, restart elasticsearch service.

# systemctl restart elasticsearch

Please note that Elasticsearch uses two ports to listen to external TCP traffic. Port 9200 is used for all API calls over HTTP. This includes search and aggregations and anything else that uses an HTTP request. Port 9300 is a custom binary protocol used for communications between nodes in a cluster.

Congratulations! You have successfully installed Elasticsearch on AlmaLinux 9.

If you are one of our web hosting customers and use our managed Linux Hosting, you don’t have to follow this tutorial and install Elasticsearch on AlmaLinux 9 yourself, our Linux admins will set up and configure an Elasticsearch VPS for you. They are available 24×7 and will take care of your request immediately, and all you need to do is to submit a ticket. We can also help you configure the more complex setup, like configuring Elasticsearch on your Magento website.

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

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

]]>
https://linuxhostsupport.com/blog/how-to-install-and-configure-elasticsearch-on-almalinux/feed/ 2
How to Install GitLab on AlmaLinux 9 https://linuxhostsupport.com/blog/how-to-install-gitlab-on-almalinux-9/ https://linuxhostsupport.com/blog/how-to-install-gitlab-on-almalinux-9/#respond Sun, 30 Apr 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1774 In this tutorial we are going to show you in step-by-step detail how to install Gitlab on AlmaLinux 9 OS. GitLab is open-source software written in Ruby, Go and JavaScript operated by GitLab Inc. GitLab offers a wide range of features such as CI/CD (Continous Integration, Continous Delivery) which makes the work of developers and […]

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

]]>
In this tutorial we are going to show you in step-by-step detail how to install Gitlab on AlmaLinux 9 OS.

GitLab is open-source software written in Ruby, Go and JavaScript operated by GitLab Inc. GitLab offers a wide range of features such as CI/CD (Continous Integration, Continous Delivery) which makes the work of developers and administrators straightforward and simple.

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

Prerequisites

  • A VPS with at least 4GB of RAM (Our NVMe 4 VPS plan)
  • Fresh install of AlmaLinux 9 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

Update the system packages to their latest version available before installing anything on a fresh server.

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

Step 2. Install GitLab Dependencies

To install GitLab required package dependencies execute the following command:

sudo dnf install curl python3-policycoreutils git policycoreutils libxcrypt-compat gnupg2 git-core zlib zlib-devel gcc-c++ patch readline readline-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl tar sqlite-devel ruby ruby-devel -y

Step 3. Add GitLab Repository

First we will add the GitLab repo since it is not added by default in the AlmaLinux 9. Open the file /etc/yum.repos.d/gitlab_gitlab-ce.repo with your favorite editor and paste the following lines of code:

[gitlab_gitlab-ce]
name=gitlab_gitlab-ce
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
       https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[gitlab_gitlab-ce-source]

name=gitlab_gitlab-ce-source baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/SRPMS repo_gpgcheck=1 gpgcheck=1 enabled=1 gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300

Save the file, close it and update the system

sudo dnf update -y

Step 4. Install GitLab

Now, when the repo is added we can install GitLab with the following command:

sudo dnf install gitlab-ce -y

After successfull installation start the GitLab service:

sudo gitlab-ctl start

You should receive the following output:

[root@host]# sudo gitlab-ctl stop
ok: down: alertmanager: 0s, normally up, want up
ok: down: gitaly: 0s, normally up
ok: down: gitlab-exporter: 0s, normally up
ok: down: gitlab-kas: 0s, normally up
ok: down: gitlab-workhorse: 0s, normally up
ok: down: logrotate: 1s, normally up
ok: down: nginx: 0s, normally up
ok: down: node-exporter: 1s, normally up
ok: down: postgres-exporter: 0s, normally up
ok: down: postgresql: 0s, normally up
ok: down: prometheus: 1s, normally up
ok: down: puma: 0s, normally up
ok: down: redis: 1s, normally up
ok: down: redis-exporter: 0s, normally up
ok: down: sidekiq: 0s, normally up
[root@host gems]# sudo gitlab-ctl start
ok: run: alertmanager: (pid 53445) 0s
ok: run: gitaly: (pid 53452) 0s
ok: run: gitlab-exporter: (pid 53469) 1s
ok: run: gitlab-kas: (pid 53473) 0s
ok: run: gitlab-workhorse: (pid 53490) 1s
ok: run: logrotate: (pid 53499) 0s
ok: run: nginx: (pid 53512) 0s
ok: run: node-exporter: (pid 53514) 1s
ok: run: postgres-exporter: (pid 53520) 0s
ok: run: postgresql: (pid 53534) 1s
ok: run: prometheus: (pid 53543) 0s
ok: run: puma: (pid 53559) 1s
ok: run: redis: (pid 53567) 0s
ok: run: redis-exporter: (pid 53573) 0s
ok: run: sidekiq: (pid 53587) 1s

To check the status of GitLab service execute the following command:

sudo gitlab-ctl status

You should receive the following output:

[root@host]# sudo gitlab-ctl status
down: alertmanager: 1s, normally up, want up; run: log: (pid 14903) 3685s
run: gitaly: (pid 53452) 33s; run: log: (pid 14315) 3889s
run: gitlab-exporter: (pid 53469) 33s; run: log: (pid 14808) 3703s
run: gitlab-kas: (pid 53473) 32s; run: log: (pid 14582) 3864s
run: gitlab-workhorse: (pid 53490) 32s; run: log: (pid 14731) 3724s
run: logrotate: (pid 53499) 31s; run: log: (pid 14247) 3905s
run: nginx: (pid 53893) 1s; run: log: (pid 14743) 3718s
run: node-exporter: (pid 53514) 31s; run: log: (pid 14785) 3710s
run: postgres-exporter: (pid 53520) 30s; run: log: (pid 14956) 3680s
run: postgresql: (pid 53534) 30s; run: log: (pid 14457) 3873s
run: prometheus: (pid 53543) 29s; run: log: (pid 14865) 3692s
run: puma: (pid 53559) 29s; run: log: (pid 14666) 3736s
run: redis: (pid 53567) 28s; run: log: (pid 14283) 3896s
run: redis-exporter: (pid 53573) 28s; run: log: (pid 14838) 3697s
run: sidekiq: (pid 53587) 28s; run: log: (pid 14683) 3732s

To check the GitLab ports execute the following command:

netstat -tunlp | grep gitlab

You should receive the following output:

[root@host]# netstat -tunlp | grep gitlab
tcp6       0      0 ::1:8153                :::*                    LISTEN      53473/gitlab-kas
tcp6       0      0 ::1:8155                :::*                    LISTEN      53473/gitlab-kas
tcp6       0      0 ::1:8154                :::*                    LISTEN      53473/gitlab-kas
tcp6       0      0 ::1:8151                :::*                    LISTEN      53473/gitlab-kas
tcp6       0      0 ::1:8150                :::*                    LISTEN      53473/gitlab-kas
tcp6       0      0 ::1:9229                :::*                    LISTEN      53490/gitlab-workho

Step 5. Access GitLab with Domain

To access the GitLab in the browser via domain name, you need to configure it in the following file: /etc/gitlab/gitlab.rb.

Open it with your favore browser and edit the following lines by entering your domain name and setting your strong root password:

external_url 'http://YourDomainHere'

gitlab_rails['initial_root_password'] = 'YourStrongPasswordHere'

Save the file, close it and execute the following command:

gitlab-ctl reconfigure

After reconfiguring the application you can access GitLab at http://YourDomain using the root as username and your strong password you set above.

Congratulations! You successfully installed and configured GitLab on AlmaLinux 9 OS. If you have any difficulties completing this setup, feel free to contact our technical support and they will help you in no time. We are available 24/7. All you need to do is to sign up for one of our NVMe VPS plans and submit a support ticket.

If you liked this post on how to install GitLab on AlmaLinux 9, please share it with your friends on the social networks or simply leave a reply below. Thanks.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-gitlab-on-almalinux-9/feed/ 0
How To Install Apache Spark on AlmaLinux 9 https://linuxhostsupport.com/blog/how-to-install-apache-spark-on-almalinux-9/ https://linuxhostsupport.com/blog/how-to-install-apache-spark-on-almalinux-9/#respond Sat, 15 Apr 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1777 In this tutorial, we are going to explain in step-by-step detail how to install Apache Spark on AlmaLinux 9 OS. Apache Spark is an open-source unified analytics engine used for data processing large amounts of data. This software stores data in memory and performs the operations very fast using SQL query languages. Apache Spark is […]

The post How To Install Apache Spark on AlmaLinux 9 appeared first on LinuxHostSupport.

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

Apache Spark is an open-source unified analytics engine used for data processing large amounts of data. This software stores data in memory and performs the operations very fast using SQL query languages. Apache Spark is written in Scala language and is compatible with multiple operating systems such as macOS, Windows, and Linux of course.

Installing Apache Spark and running it as a service is a straightforward process and may take up to 10 minutes. Let’s get things done.

Prerequisites

  • Fresh installation of AlmaLinux 9 as OS
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

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

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

Step 2. Install Java

The application programming interface is written in Java so we need to install Java with the following command:

sudo dnf install java-11-openjdk -y

After the installation you can check the installed Java version with the following command:

java -version

You should get the following output:

[root@vps ~]# java -version
openjdk version "11.0.18" 2023-01-17 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.18.0.10-2.el9_1) (build 11.0.18+10-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.18.0.10-2.el9_1) (build 11.0.18+10-LTS, mixed mode, sharing)

Step 3. Install Apache Spark

We can not install Apache Spark with the command since it is not included in the default repository of AlmaLinux 9. We need to download it manually and extract it in a directory on the server. To do that execute the following commands:

cd /home

curl -O https://www.apache.org/dyn/closer.lua/spark/spark-3.3.2/spark-3.3.2-bin-hadoop3.tgz

gunzip -c spark-3.2.3-bin-hadoop3.2.tgz | tar xvf -

rm spark-3.2.3-bin-hadoop3.2.tgz

mv spark-3.2.3-bin-hadoop3.2/ spark/ 

Step 4. Create System User

We need to create a system user for Apache Spark. To do that execute the following command:

 useradd useradd sparkuser

Once, created you need to set the right permissions of the Apache Spark document root:

chown -R sparkuser:sparkuser /home/spark

Step 5. Create Service files

Now, we need to create two separate services for Apache Spark. Those services are master and slave services required for Apache Spark to work efficiently. We will start with the master service:

Create the master service file first:

touch /etc/systemd/system/spark-master.service

Open the file with your favorite editor and paste the following lines of codes:

[Unit]
Description=Apache Spark Master
After=network.target

[Service]
Type=forking
User=sparkuser
Group=sparkuser
ExecStart=/home/spark/sbin/start-master.sh
ExecStop=/home/spark/sbin/stop-master.sh

[Install]
WantedBy=multi-user.target

Now, create the slave service file.

touch /etc/systemd/system/spark-slave.service

Open the file with your favorite editor and paste the following lines of codes:

[Unit]
Description=Apache Spark Slave
After=network.target

[Service]
Type=forking
User=sparkuser
Group=sparkuser
ExecStart=/home/spark/sbin/start-slave.sh spark://127.0.0.1:7077
ExecStop=/home/spark/sbin/stop-slave.sh

[Install]
WantedBy=multi-user.target

Once, the files are created reload the daemon and start the services:

sudo systemctl daemon-reload

sudo systemctl start spark-master

sudo systemctl start spark-slave

To check the status of the master service execute the following command:

sudo systemctl status spark-master

You should receive the following output:

[root@host spark]# sudo systemctl status spark-master
● spark-master.service - Apache Spark Master
     Loaded: loaded (/etc/systemd/system/spark-master.service; disabled; vendor preset: disabled)
     Active: active (running) since Sat 2023-02-25 05:45:47 CST; 48s ago
    Process: 1274 ExecStart=/home/spark/sbin/start-master.sh (code=exited, status=0/SUCCESS)
   Main PID: 1286 (java)
      Tasks: 34 (limit: 24796)
     Memory: 242.9M
        CPU: 11.958s
     CGroup: /system.slice/spark-master.service
             └─1286 /usr/lib/jvm/java-11-openjdk-11.0.18.0.10-2.el9_1.x86_64/bin/java -cp "/home/spark/conf/:/home/spark/jars/*" -Xmx1g org.apache.spark.deploy.master.

To check the status of the slave service execute the following command:

sudo systemctl status spark-slave

You should receive the following output:

[root@host spark]# sudo systemctl status spark-slave
● spark-slave.service - Apache Spark Slave
     Loaded: loaded (/etc/systemd/system/spark-slave.service; disabled; vendor preset: disabled)
     Active: active (running) since Sat 2023-02-25 05:45:54 CST; 2min 31s ago
    Process: 1350 ExecStart=/home/spark/sbin/start-slave.sh spark://127.0.0.1:7077 (code=exited, status=0/SUCCESS)
   Main PID: 1363 (java)
      Tasks: 33 (limit: 24796)
     Memory: 178.2M
        CPU: 11.086s
     CGroup: /system.slice/spark-slave.service
             └─1363 /usr/lib/jvm/java-11-openjdk-11.0.18.0.10-2.el9_1.x86_64/bin/java -cp "/home/spark/conf/:/home/spark/jars/*" -Xmx1g org.apache.spark.deploy.worker.

That’s it. Now you can access the Apache Spark service on the following URL: http://YourServerIPAddress:8080.

Congratulations! You successfully installed and configured the Apache Spark service on AlmaLinux 9. If you find any difficulties installing this software and service, you can contact our support. All you need to do is to sign up for one of our NVMe VPS plans and submit a support ticket. We are available 24/7.

The post How To Install Apache Spark on AlmaLinux 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-apache-spark-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
How To Install Plausible Analytics on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-install-plausible-analytics-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-install-plausible-analytics-on-ubuntu-22-04/#respond Tue, 28 Feb 2023 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1764 Plausible Analytics is a free and open-source, self-hosted web analytics application that helps you to track your website visitors. It is a simple analytics alternative to Google Analytics. In this tutorial, we will install Plausible in a docker container and then install Apache as a reverse proxy for Plausible Analytics. Prerequisites Step 1. Log in […]

The post How To Install Plausible Analytics on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
Plausible Analytics is a free and open-source, self-hosted web analytics application that helps you to track your website visitors. It is a simple analytics alternative to Google Analytics.

In this tutorial, we will install Plausible in a docker container and then install Apache as a reverse proxy for Plausible Analytics.

Prerequisites

  • An Ubuntu 22.04 VPS
  • Full SSH root access or a user with sudo privileges is required

Step 1. Log in to the server and update

Login to your Ubuntu 22.04 VPS via SSH. In this article, we will use ‘root’ to run the shell commands.

If you want to use your regular system user with sudo privileges to run the commands, make sure to append ‘sudo’ in front of the commands.

# ssh root@IP_Address -p Port_Number

You need to replace “IP_Address” and “Port_number” with your server’s IP address and SSH port number.

We can run these commands to ensure that all installed packages are up to date.

# apt update
# apt upgrade

Step 2. Install Docker CE and Docker Compose

By default, the latest Docker CE package is not available in the Ubuntu 22.04 default repository, so you will need to add the Docker CE official repository to your server.

Use the following command to install the dependencies or pre-requisite packages.

# apt-get install git apt-transport-https ca-certificates curl software-properties-common -y

Then, add the GPG key and repository with the following commands:

# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker-archive-keyring.gpg
# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Now you can install Docker and Docker Compose with the following command:

# apt update
# apt-get install docker-ce docker-compose

Verify the Docker version with the following command:

# docker --version

Output:

Docker version 20.10.21, build baeda1f

Step 3. Download Plausible

Next, you need to clone the Plausible repository from the GitHub repository. To do this, go to the /opt directory with the following command:

# cd /opt

Then, you can download it with the following command:

# git clone https://github.com/plausible/hosting plausible

Now move into the new directory that you have created:

# cd plausible

Generate a secrete password with the following command:

# openssl rand 64 | base64 -w 0 ; echo

This command will create 64 random characters:

VSqCkxxFh0lQAcKgM+NmLzya28kbAr++FBL8b6qUxtAi9AeGScacv+fSGfYBqHiAVevv3H70qIJML1MabF+Klg==

Copy them, then open the Plausible configuration file with your favorite text editor:

# nano plausible-conf.env

The file contains five variables that you’ll need to fill in:

ADMIN_USER_EMAIL=admin@your-domain.com
ADMIN_USER_NAME=admin
ADMIN_USER_PWD=Str0ng_Passw0rd
BASE_URL=https://plausible.your-domain.com
SECRET_KEY_BASE=VSqCkxxFh0lQAcKgM+NmLzya28kbAr++FBL8b6qUxtAi9AeGScacv+fSGfYBqHiAVevv3H70qIJML1MabF+Klg==

Note:  The password you define here must be at least 6 characters.

Now you need to update the docker-compose.yml file. Open the file with the following command:

# nano docker-compose.yml

Find the Plausible section in the file and search for the ports, and update it to the following:

ports:
- 127.0.0.1:8000:8000

Then use the following command to download, configure, and launch the containers:

# docker-compose up --detach

This ensures that Plausible only listens on the localhost interface and is not publicly available.

Plausible Analytics has been installed and is now running on port 8000.

Step 4. Install Apache Web Server and Create Apache Virtual Host File

To install the Apache web server execute the command below:

# apt install apache2

Once installed, start and enable the service.

# systemctl enable apache2 && systemctl start apache2

Check if the service is up and running:

# systemctl status apache2

Enable the proxy and proxy_http modules in Apache using the following commands:

# a2enmod proxy
# a2enmod proxy_http

To access Plausible Analytics via domain name, we need to create Apache Virtual Host file.

First, create the configuration file with the following command:

# nano /etc/apache2/sites-available/plausible.conf

Open the file, and paste the following lines of code:

<VirtualHost *:80>
     ServerAdmin admin@your_domain.com
     ServerName plausible.your-domain.com

     ErrorLog ${APACHE_LOG_DIR}/plausible.your-domain_error.log
     CustomLog ${APACHE_LOG_DIR}/plausible.your-domain_access.log combined

        ProxyPreserveHost On
        ProxyPass / http://127.0.0.1:8000/
        ProxyPassReverse / http://127.0.0.1:8000/

</VirtualHost>

Enable the Apache2 configuration file and other modules:

# a2ensite plausible.conf

Check the syntax of the Apache2 configuration.

# apachectl -t

You should receive the following output:

root@host:~# apachectl -t
Syntax OK

If you receive this output, you can safely restart the Apache service.

# systemctl restart apache2

Step 5. Install an SSL Certificate

This step will show you how to install an SSL certificate for your Plausible website using the free one from Let’s Encrypt.

Install the required packages by running the following command:

# apt install python3-certbot-apache

Then run this command to install a new SSL certificate for your domain name:

# certbot --apache -d plausible.your-domain.com

Please select ‘2’ and choose to redirect HTTP traffic to HTTPS. It will update your Plausible Apache virtual host file to redirect all HTTP traffic to HTTPS.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

You should now be able to access your Plausible Analytics at https://plausible.your-domain.com

Plausible Analytics

If you are one of our web hosting clients and use our managed Ubuntu Hosting, you don’t have to follow this tutorial and install Plausible Analytics on your Ubuntu 22.04 server yourself. You can simply ask our expert Linux hosting admins to set all of these 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 social networks using the buttons below, or simply leave a comment in the comments section. Thank you.

The post How To Install Plausible Analytics on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-plausible-analytics-on-ubuntu-22-04/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
5 Ways to Empty or Delete a Large File in Linux https://linuxhostsupport.com/blog/5-ways-to-empty-or-delete-a-large-file-in-linux/ https://linuxhostsupport.com/blog/5-ways-to-empty-or-delete-a-large-file-in-linux/#respond Mon, 30 Jan 2023 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1755 In this article, we will go over five different ways to empty/delete a large file in Linux. You might have a file that’s gigabytes in size that you want to get rid of quickly, or you want to automate emptying a file for each iteration. Whatever the case may be, you’ll be able to easily […]

The post 5 Ways to Empty or Delete a Large File in Linux appeared first on LinuxHostSupport.

]]>
In this article, we will go over five different ways to empty/delete a large file in Linux.

You might have a file that’s gigabytes in size that you want to get rid of quickly, or you want to automate emptying a file for each iteration. Whatever the case may be, you’ll be able to easily delete or empty a file with help from this article.

We’ll be running these commands on an Ubuntu 22.04 VPS, but pretty much all of these commands should work on any modern distribution.

Prerequisites

  • A Linux VPS or a dedicated server of your choosing
  • Write access to the file or root/sudo privileges

1. Using /dev/null to empty the contents of a file

What is /dev/null?

The software device file (found in the /dev/ directory) called “null” is a file with two very simple purposes. It discards or deletes any data written to it or returns EOF (short for “end-of-file”) if you try to read its contents. In this case, we are going to read from /dev/null.

You can use the cat command (which is short for concatenate) to read the contents of /dev/null, followed by a redirection operator to redirect the output into the file we want to empty.

cat /dev/null > yourFile.ext

What this does is output the contents of /dev/null and then redirect that content into your file. The contents of your file are essentially starting with “End of file,” making it empty.

What does > do?

This redirection operator takes whatever data would’ve been printed to the console and allows you to place it into any file. Using only one > replaces the contents of the file with the data you are redirecting, and using two of them >> appends the data to the end of the file. Since we want to empty our file, we only use one > to replace the contents.

Here is a screenshot as an example.

You can see the text that says “10G” (short for ten gigabytes) changes to, say 0 (zero bytes) after our command is executed.

Unfortunately, you cannot delete a file using /dev/null as it can only do the two functions mentioned earlier.

2. Using echo to empty the contents of a file

You can use the echo command, normally designed to send data to stdout (standard output or your console) and use a redirection operator again to place the contents of your echo command into the file you want to empty.

echo > yourFile.txt

The echo command outputs a new line when no input is provided. When combining this with a redirection of the output into your file, your file gets replaced with only the new line.

This is how it looks in practice:

As you can see, the file’s contents are emptied. You might notice, however, that unlike the previous method shown, this file now has a size of 1 byte instead of 0 bytes. This is because we store a newline instead of a truly empty file. If your use case requires that the file have a size of zero bytes, then this method won’t work for you.

Additionally, you cannot delete files using the echo command. Echo can only create data, not destroy it.

3. Using a redirection operator to empty the contents of a file

You may have noticed our use of redirection operators in both methods listed above to empty the contents of a file. Instead of using commands to redirect output, we can actually take advantage of this redirection to empty our file.

> yourFile.txt

You can see in this command we are redirecting nothing! By doing this, we are taking the output of nothing and replacing the contents of our file with it.

This is what it looks like when you run the command using only redirection:

You should note that the file is emptied completely, with a file size of zero bytes. This is the easiest and fastest way to empty a file.

Once again, this method won’t work for deleting files, as it only redirects content instead of destroying it.

4. Using truncate to empty the contents of a file

This great command lets you truncate (or cut short) the content of any file easily and quickly. Interestingly, the name does not suggest it, but you can also use this command to increase the apparent size of any file too.

truncate -s 0 yourFile.txt

What this command does is execute the truncate command, the option -s 0 sets the size to zero bytes.

You can see the example below:

This command does exactly as advertised, setting the file size to 0 bytes by truncating anything past that size.

Once again, this useful tool only sets the size of files; it does not delete them.

5. Using rm or unlink to delete a file

Now that we have seen multiple ways to empty the contents of a file, it’s about time we see ways to delete the file altogether. Luckily, there are two different ways of doing so.

Delete a file with the rm command

The rm command (short for remove) does one task extremely well: removing files and directories.

rm yourFile.txt

By running this, your file will be deleted instantly.

Another option is the unlike command, which simply calls the unlink function, which removes the link to the file.

unlink yourFile.txt

If no process is using the file, then the file is deleted, and the filesystem reclaims the space.

Here are some examples detailing how they work:

The next image shows the use of unlink:

With these commands, however, the opposite issue is the case – you cannot empty the contents of the file. You can only delete the file or destroy the link to the file.

However, if you are a user of our Managed VPS hosting services, make sure to use our team of Linux experts. Not only will they give you a list of all of the large files on your system, but they can also clear their contents, delete the files, or even set up a rotation of these files to ensure their size stays small automatically.

Did this post help you empty or delete a large file on your filesystem? If so, please consider spreading the word so others can benefit from this tip. Have any other methods of emptying or deleting a file? Let us know in our comment section below!

The post 5 Ways to Empty or Delete a Large File in Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/5-ways-to-empty-or-delete-a-large-file-in-linux/feed/ 0
How to Install Bagisto Ecommerce on Almalinux https://linuxhostsupport.com/blog/how-to-install-bagisto-ecommerce-on-almalinux/ https://linuxhostsupport.com/blog/how-to-install-bagisto-ecommerce-on-almalinux/#respond Sun, 15 Jan 2023 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1751 Bagisto is an open-source eCommerce platform built using Laravel framework and VueJS. The framework is very flexible and easy to use, even for non-tech users. Bagisto offers Multi-Warehouse Inventory; almost everything you need when building an eCommerce website is available in Bagisto. In this tutorial, we will show you how to install Bagisto Ecommerce on […]

The post How to Install Bagisto Ecommerce on Almalinux appeared first on LinuxHostSupport.

]]>
Bagisto is an open-source eCommerce platform built using Laravel framework and VueJS. The framework is very flexible and easy to use, even for non-tech users. Bagisto offers Multi-Warehouse Inventory; almost everything you need when building an eCommerce website is available in Bagisto. In this tutorial, we will show you how to install Bagisto Ecommerce on Almalinux.

Prerequisites

  • A server with AlmaLinux as the operating system
  • Root access or regular access with sudo privileges

Step 1. Log in to your server via SSH

First, you will need to log in to your AlmaLinux VPS via SSH as the root user:

ssh root@IP_Address -p Port_number

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

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

# cat /etc/almalinux-release

You will see an output similar to this:

[root@almalinux9 ~]# cat /etc/almalinux-release
AlmaLinux release 9.1 (Lime Lynx)

The shell commands in this article are executed using ‘root’ account. If you want to use your regular user with sudo privileges to run the commands, make sure to append ‘sudo’ in front of the commands.

Step 2. Update the system

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

# dnf update
# dnf upgrade

Step 3. Install and Configure the Web Server

In this tutorial, we are going to use Nginx as the web server. Run this command to install it.

# dnf install nginx -y

Start nginx and enable it on boot.

# systemctl enable --now nginx

Now, let’s create an nginx server block or virtual host.

# nano /etc/nginx/conf/bagisto.conf

Paste the following and make sure you replace bagisto.yourdomain.com with your actual domain or subdomain name:

server {
   listen 80;
   server_name bagisto.yourdomain.com;
   root /opt/bagisto/public;

   add_header X-Frame-Options "SAMEORIGIN";
   add_header X-Content-Type-Options "nosniff";

   index index.php;

   charset utf-8;

   location / {
      try_files $uri $uri/ /index.php?$query_string;
   }

   location = /favicon.ico { access_log off; log_not_found off; }
   location = /robots.txt { access_log off; log_not_found off; }

   error_page 404 /index.php;

   location ~ \.php$ {
      fastcgi_pass unix:/run/php-fpm/www.sock;
      fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
      include fastcgi_params;
   }

   location ~ /\.(?!well-known).* {
      deny all;
   }
}

Save the file, then exit and restart nginx.

# systemctl restart nginx

Step 4. Install MariaDB and Create a Database

In this step, we are going to install the MariaDB server from the default repository. To install the MariaDB server, execute this command:

# dnf install mariadb-server

Let’s run the MariaDB service and enable it on boot.

# systemctl enable --now mariadb

MariaDB has been successfully installed, and it is running; now we can proceed with creating a new database and a user for our Bagisto website.

# mysql

There is no password for root at the moment, so that you can log in to MySQL/MariaDB shell without one.

mysql> CREATE DATABASE bagisto;
mysql> GRANT ALL on bagisto.* to bagisto@localhost identified by 'm0d1fyth15';
mysql> FLUSH PRIVILEGES;
mysql> \q

Make sure to create a stronger database password, and replace m0d1fyth15 in the command above with a stronger password.

Step 5. Install PHP

The default version of PHP available in AlmaLinux 9 is version 8. We can use this PHP version to proceed with Bagisto installation.

Run this command to install PHP and the required extensions

# dnf install php-{bcmath,common,curl,fpm,gd,intl,mbstring,mysqlnd,soap,xml,xsl,zip,cli,devel,pear} libsodium-devel

We would also need to install Sodium, and this can be installed using PECL

# pecl install libsodium

To enable Sodium extension, we can add enable it by adding extension=sodium.so in php.ini file, run this command:

# echo "extension=sodium.so" >> /etc/php.ini

You can check and verify the installed PHP version with this command.

# php -v

It will return an output like this:

[root@almalinux9 ~]# 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 6. Install Composer

Composer is a package manager for the PHP programming language that can be used for managing dependencies of PHP software and required libraries.

The installation of Composer is fairly easy and straightforward. Simply download and install Composer with these commands:

# curl -sS https://getcomposer.org/installer -o composer-setup.php
# php composer-setup.php --install-dir=/usr/local/bin --filename=composer

That’s it. You have successfully installed Composer on your AlmaLinux server. To check the Composer version, you can run the following command:

# composer -V

Or

# composer --version

Step 7. Install NodeJS

For this tutorial purpose, we are going to install the latest LTS version of NodeJS. Invoke these commands to add the NodeJS repository, then install it.

# curl -sL https://rpm.nodesource.com/setup_lts.x | bash -
# dnf install nodejs -y

NodeJS has been installed, and we can verify the installation by checking the node and vpm versions.

# node -v; npm -v

You should see this output:

[root@almalinux9 ~]# node -v; npm -v
v18.12.1
8.19.2

Step 8. Install Bagisto using Composer

When running composer using the root account, we would receive a warning message. Since we are using the ‘root’ user in this tutorial to install Bagisto, we need to run this command to allow the root to run composer.

# export COMPOSER_ALLOW_SUPERUSER=1

We should be able to run the composer executable without warning. Next, go to /opt; we will install Bagisto in /opt/bagisto

# cd /opt

Execute the command below to start downloading Bagisto.

# composer create-project bagisto/bagisto

Now, we need to modify the .env file to proceed with the installation.

# nano /opt/bagisto/.env

Make sure to edit the followings:

APP_URL=http://localhost
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
DB_PREFIX=

You need to use the MySQL database credentials we created earlier. It should look like this:

APP_URL=http://bagisto.yourdomain.com
DB_DATABASE=bagisto
DB_USERNAME=bagisto
DB_PASSWORD=m0d1fyth15
DB_PREFIX=bgs_

Save the changes, then exit from the editor. Now, we can start the installation.

# cd bagisto
# php artisan bagisto:install

The command above will install Bagisto, and you will see an output similar to this:

Congratulations!
The installation has been finished and you can now use Bagisto.
Go to http://bagisto.yourdomain.com/admin and authenticate with:
Email: admin@example.com
Password: admin123

You can use a web browser and navigate to http://bagisto.yourdomain.com/admin now.

Once logged in, you will be brought to the dashboard.

Step 9. Install SSL/TLS Certificate

This step is optional but highly recommended to complete. This step will walk you through SSL installation from Let’s Encrypt using certbot.

# dnf install certbot python3-certbot-nginx

Prior to generating a new SSL certificate for your bagisto.yourdomain.com, make sure that the domain/subdomain DNS A record is already pointing to your server IP address. If there is an issue when generating a free SSL certificate, most likely, the DNS update is not fully propagated.

# certbot

You will get an output like this; you need to answer the prompts.

[root@almalinux9 bagisto]# certbot

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
(Enter 'c' to cancel): you@yourdomain.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, 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
Account registered.

Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: bagisto.yourdomain.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Requesting a certificate for bagisto.yourdomain.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/bagisto.yourdomain.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/bagisto.yourdomain.com/privkey.pem
This certificate expires on 2023-03-04.
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 bagisto.yourdomain.com to /etc/nginx/conf.d/bagisto.yourdomain.com.conf
Congratulations! You have successfully enabled HTTPS on https://bagisto.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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

That’s it! You have learned how to install Bagisto Ecommerce on Almalinux. Your bagisto website should be accessible at https://bagisto.yourdomain.com.

Of course, you don’t have to install Bagisto Ecommerce on Almalinux if you use one of our Django VPS Hosting services. You can simply ask our expert Linux admins to install Bagisto Ecommerce on Almalinux VPS 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 Bagisto Ecommerce on Almalinux, please share it with your friends on the social networks using the buttons below or simply leave a reply in the comments sections. Thanks.

The post How to Install Bagisto Ecommerce on Almalinux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-bagisto-ecommerce-on-almalinux/feed/ 0
How to Install Uptime Kuma on Ubuntu 22.04 https://linuxhostsupport.com/blog/how-to-install-uptime-kuma-on-ubuntu-22-04/ https://linuxhostsupport.com/blog/how-to-install-uptime-kuma-on-ubuntu-22-04/#respond Fri, 30 Dec 2022 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1737 Uptime Kuma is an open-source monitoring solution. We can monitor our websites and servers’ uptime and configure them to send us notifications via multiple options, like Telegram, email, Discord, etc. Uptime Kuma is an easy-to-use monitoring tool, and it is powerful for traffic control, observability, service discovery, etc. This article will show you how to […]

The post How to Install Uptime Kuma on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
Uptime Kuma is an open-source monitoring solution. We can monitor our websites and servers’ uptime and configure them to send us notifications via multiple options, like Telegram, email, Discord, etc. Uptime Kuma is an easy-to-use monitoring tool, and it is powerful for traffic control, observability, service discovery, etc. This article will show you how to install Uptime Kuma on Ubuntu 22.04.

Prerequisites

  • An Ubuntu server 22.04
  • SSH access with root privileges

Step 1. Log in to the server

First, log in to your Ubuntu 22.04 VPS through SSH as the root user:

ssh root@IP_Address -p Port_number

You would need to replace ‘IP_Address‘ and ‘Port_number‘ with your server’s IP address and SSH port number.

Before starting, we need to make sure that all Ubuntu 22.04 packages installed on the server are up to date. You can do this by executing the following commands:

# apt update -y

Step 2. Create a System User

In this step, we will create a new system user and grant it sudo privileges. Let’s say the new system user is called ‘master’; you can choose any username you like.

# adduser master

Next, let’s run the command below to add the new user to sudo group. In Ubuntu operating system, users who are members of sudo group are allowed to run sudo commands.

# usermod -aG sudo master

Once created and given sudo privileges, we can log in as the new user ‘master’, and we will use this user to run commands and complete the Uptime Kuma installation.

# su - master

Step 3. Install NodeJS and NPM

Uptime Kuma requires NodeJS runtime environment and npm. We can install NodeJS from the Ubuntu default repository, but we will get an older version of NodeJS if we use this method and Uptime Kuma requires at least NodeJS version 14. In this step, we will install NodeJS and npm through the NodeJS repository to get the most recent version of it.

$ curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -

Once completed, we need to download the package information from the newly added source above.

$ sudo apt update

Next, run the following command to install NodeJS and NPM finally.

$ sudo apt install nodejs

That’s it; nodejs and NPM are installed; you can check the installed version by executing this one-liner:

$ node -v; npm -v

You will see an output like this:

master@ubuntu22:~$ node -v; npm -v
v16.18.0
8.19.2

Step 4. Install Uptime Kuma

Uptime Kuma is not available in the default Ubuntu repository. We can install it by downloading it from GitHub using git.

$ sudo apt install git

After git is installed, we can continue to clone Uptime Kuma from its GitHub repository.

$ git clone https://github.com/louislam/uptime-kuma.git
$ cd uptime-kuma

It’s time to run the installation using the NPM package manager of Nodejs.

$ npm run setup
uptime kuma npm run setup

Step 5. Install PM2

With Process Manager (PM2), we can keep our applications alive forever, reload them without downtime, and facilitate common system admin tasks. Execute the command below to install PM2 on your Ubuntu 22.04.

$ sudo npm install pm2 -g

Once pm2 is installed, we can run our Uptime Kuma with this command.

$ pm2 start server/server.js --name kuma

uptime kuma pm2 start

Now, you can open your web browser and navigate to the page at http://YOUR_SERVER_IP_ADDRESS:3001, and you will see the uptime Kuma welcome page, you can create a new user now.

uptime kuma welcome

To add monitoring, you can click on the ‘Add New Monitor’ button

uptime kuma monitor

You can customize and configure your monitoring here.

uptime kuma customize monitor

After starting Uptime Kuma, we can create a service file for PM2 to make Uptime Kuma start automatically upon reboot.

$ pm2 startup

You will get an output like this:

[PM2] Init System found: systemd
[PM2] To setup the Startup Script, copy/paste the following command:
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u master --hp /home/master

Just follow the instruction shown on the screen, for example:

$ sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u master --hp /home/master

Then, you will also see an output like this one:

uptime kuma pm2 startup

Now we need to save the current ongoing process:

$ pm2 save

Step 6. Install and Configure NGINX

Your Uptime Kuma install has now been completed, and you should be able to access it at your server’s public IP with port number 3001. However, if you want to access your Uptime Kuma website using a domain name or subdomain name instead of typing the server’s IP address and the port number in the URL, you would need to configure a reverse proxy on your server.

This step will show you how to implement the reverse proxy configuration using Nginx.

First, install Nginx with the following command:

$ sudo apt install nginx

On Ubuntu 22.04, Nginx is configured to start running upon installation; you can check it by running this command:

$ sudo systemctl status nginx

Once installed, create a new Nginx server block configuration file. Replace kuma.yourdomain.com with your actual domain or subdomain name:

$ sudo nano /etc/nginx/sites-enabled/kuma.yourdomain.com.conf

Add the following content to the file:

server {

listen 80;
server_name kuma.yourdomain.com;
location / {
    proxy_pass http://localhost:3001;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    }

location ~ /.well-known {
    alias /var/www/html;
    }
}

Save the file by pressing CTRL + O, then press CTRL + X to exit the nano editor, then restart Nginx.

$ sudo systemctl restart nginx

Step 7. Install SSL certificate

This is an optional step but highly recommended to complete. We will install a free SSL certificate from Let’s Encrypt.

$ sudo apt install python3-certbot-nginx -y

Once completed, we can run this command to install the SSL certificate.

$ sudo certbot certonly -d kuma.yourdomain.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log

How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Nginx Web Server plugin (nginx)
2: Spin up a temporary webserver (standalone)
3: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-3] then [enter] (press 'c' to cancel): 1
Enter email address (used for urgent renewal and security notices)
(Enter 'c' to cancel): you@yourdomain.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, 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
Account registered.
Requesting a certificate for kuma.yourdomain.com

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
master@ubuntu22:~#

Make sure to pay attention to these lines; we need them when editing our nginx server block.

Certificate is saved at: /etc/letsencrypt/live/kuma.yourdomain.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/kuma.yourdomain.com/privkey.pem

Next, we need to edit the nginx server block for kuma.yourdomain.com

$ sudo nano /etc/nginx/sites-enabled/kuma.yourdomain.com.conf

Replace the content with the lines below.

server {
    listen 443 ssl http2;
    server_name kuma.yourdomain.com;
    ssl_certificate /etc/letsencrypt/live/kuma.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/kuma.yourdomain.com/privkey.pem;

location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_pass http://localhost:3001/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    }
}

server {
    listen 80;
    server_name kuma.yourdomain.com;
    return 301 https://kuma.yourdomain.com$request_uri;
}

Save the file, then exit and restart nginx

$ sudo systemctl restart nginx

Now, you should be able to access your Uptime Kuma website in HTTPS mode at https://kuma.yourdomain.com; you can proceed with building your application using the Uptime Kuma.

Of course, you don’t have to pull your hair to install Uptime Kuma on Ubuntu 22.04 if you have a managed Linux VPS hosting plan hosted with us. If you do, you can simply ask our support team to install Uptime Kuma on Ubuntu 22.04 for you. They are available 24/7 and will be able to help you with the installation of Uptime Kuma, as well as any additional requirements that you may have.

PS. If you enjoyed reading this blog post on how to install Uptime Kuma on Ubuntu 22.04, feel free to share it on social networks or simply leave a comment down in the comments section. Thank you.

The post How to Install Uptime Kuma on Ubuntu 22.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-uptime-kuma-on-ubuntu-22-04/feed/ 0
How to Install CouchDB on AlmaLinux https://linuxhostsupport.com/blog/how-to-install-couchdb-on-almalinux/ https://linuxhostsupport.com/blog/how-to-install-couchdb-on-almalinux/#respond Thu, 15 Dec 2022 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1735 Apache CouchDB is a free yet reliable non-relational or NoSQL database engine. It is written in Erlang language and natively supports data in JSON format. The data can be accessed and queried via the HTTP protocol, making it easier and more scalable than traditional SQL relational databases like MySQL. CouchDB also offers replication capability and […]

The post How to Install CouchDB on AlmaLinux appeared first on LinuxHostSupport.

]]>
Apache CouchDB is a free yet reliable non-relational or NoSQL database engine. It is written in Erlang language and natively supports data in JSON format. The data can be accessed and queried via the HTTP protocol, making it easier and more scalable than traditional SQL relational databases like MySQL. CouchDB also offers replication capability and provides high availability access. This tutorial will show you how to install CouchDB on AlmaLinux.

Prerequisites

  • An AlmaLinux VPS
  • SSH access with root privileges

Step 1: Log in to your server via SSH

First, you will need to log in to your AlmaLinux VPS via SSH as the root user:

ssh root@IP_Address -p Port_number

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

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

# cat /etc/redhat-release

You will get an output similar to this:

AlmaLinux release 8.7 (Stone Smilodon)

We use ‘root’ in this article when running the shell commands. If you want to use your regular user with sudo privileges to run the commands, make sure to append ‘sudo’ in front of the commands.

Step 2: Update the System

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

# dnf update

Step 3. Install CouchDB

In this step, we will install CouchDB from its default repository. First, we need to install yum-utils package on our AlmaLinux:

# dnf install -y yum-utils

Now you can download and enable the CouchDB repository on your server with the following command:

# yum-config-manager --add-repo https://couchdb.apache.org/repo/couchdb.repo

Then, let’s update our local package index again with this command:

# dnf update

You will be prompted to add the GPG key, and you need to press Y to continue.

Next, use the command below to install CouchDB:

# dnf install -y couchdb

That’s it all, and Apache CouchDB has been successfully installed on your server.

Step 4. Configure CouchDB

In this step, we will configure CouchDB to run on all available IP addresses instead of the default 127.0.0.1 and give a password.

Let’s open the configuration file in /opt/couchdb/etc/local.ini

# nano /opt/couchdb/etc/local.ini

Find the [chttpd] section the uncomment the port and bind address. In the default configuration file, CouchDB is set to listen on 127.0.0.1. You can change it to 0.0.0.0, which means it listens on all interfaces. We can also change it to our specific IP address. So, let’s edit these lines:

[chttpd]
#port = 5984
#bind_address = 127.0.0.1

to

[chttpd]
port = 5984
bind_address = 0.0.0.0

Still, in the same file, scroll down and find the [admins] section. In this section, we can modify our CouchDB user and password.

Change these lines

[admins]
;admin = mysecretpassword

to

[admins]
admin = m0d1fyth15

Save the changes and exit from the file editor. Please make a note about your password because once the CouchDB service is running, the password you specified in the configuration file will be hashed.

Next, we can start and enable it to run upon reboot on your AlmaLinux 8 with the following command:

# systemctl enable couchdb
# systemctl start couchdb

CouchDB is now up and running. We can verify this by checking its status.

# systemctl status couchdb

The command above will give you an output like this:

● couchdb.service - Apache CouchDB
Loaded: loaded (/usr/lib/systemd/system/couchdb.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2022-11-15 20:22:16 CST; 19min ago
Main PID: 6493 (beam.smp)
Tasks: 37 (limit: 11384)
Memory: 47.0M
CGroup: /system.slice/couchdb.service
├─6493 /opt/couchdb/bin/../erts-11.2.2.13/bin/beam.smp -K true -A 16 -Bd -- -root /opt/couchdb/bin/.. -progname couchdb -- -home /opt/couchdb -- -boot /opt/couchdb/bin/../re>
├─6505 /opt/couchdb/bin/../erts-11.2.2.13/bin/epmd -daemon
└─6524 erl_child_setup 65536

Nov 15 20:22:16 almalinux.rosehosting.com systemd[1]: Started Apache CouchDB.

Step 5. Access CouchDB

CouchDB is now running, and we can start working on it. We can use CLI (Command Line Interface) to manage our CouchDB databases, or we can also use the GUI. You can navigate to http://YOUR_IP_ADDRESS/_utils/ and then log in using the username and password you specified earlier in the previous step if you prefer to use its GUI.

Enter the username and password. Then you will be brought to the CouchDB dashboard.

You will see no databases in the dashboard because we have not created one. You can now start working and using CouchDB, like creating a database, creating a cluster, or even database replication.

That’s it! You have successfully installed CouchDB on AlmaLinux

If you are one of our web hosting customers and use our managed Linux Hosting, you don’t have to follow this tutorial and install CouchDB on AlmaLinux yourself; our Linux admins will set up and configure a CouchDB VPS for you. They are available 24×7 and will take care of your request immediately, and all you need to do is to submit a ticket.

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

The post How to Install CouchDB on AlmaLinux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-couchdb-on-almalinux/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
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
10 Useful iptables Commands in Linux https://linuxhostsupport.com/blog/10-useful-iptables-commands-in-linux/ https://linuxhostsupport.com/blog/10-useful-iptables-commands-in-linux/#respond Tue, 30 Aug 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1714 In this tutorial we are going to explain to you 10 useful iptables commands applicable in any Linux distro. Iptables on Linux servers are used for controlling the incoming and outgoing web traffic. The traffic is controlled by the iptables rules in the firewall written by system administrators or users familiar with Linux servers. The […]

The post 10 Useful iptables Commands in Linux appeared first on LinuxHostSupport.

]]>
In this tutorial we are going to explain to you 10 useful iptables commands applicable in any Linux distro.

Iptables on Linux servers are used for controlling the incoming and outgoing web traffic. The traffic is controlled by the iptables rules in the firewall written by system administrators or users familiar with Linux servers. The rules in iptables are stored in tables that have chains for every defined rule. In this blog post, we are going to use Ubuntu 22.04 as OS, but you can choose any distro if you want to try these iptables commands by yourself. Let’s get started!

Prerequisites

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

Update the System

Before we start with the basic iptables rules we are going 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 iptables commands in Linux.

Install iptables service

To install the iptables service execute the following command:

sudo apt-get install iptables -y

Once, the iptables service is installed we can proceed with the basic iptables rules in the next paragraphs.

1. Check iptables rules

Since, we installed the iptables service and we did not add any rule, checking the iptables rules should give you empty output.

iptables -nvL

You should receive the following output:

root@host:~# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

2. Whitelist IP Address

Sometimes the users are not able to access the website, or the server thus we need to whitelist their IP address manually with the following command:

iptables -A INPUT -s 192.168.1.1 -j ACCEPT

3. Block IP Address

If there are continuous attacks on the server, or the owner do not want some IP addresses to have access on his server, we can easily block them with the following command:

iptables -A INPUT -s 192.168.0.1 -j DROP

4. Block Host in iptables

Sometimes we need to block the whole host in the iptables rules. For example to block google.com in the iptables rules first you need to find the IP address and the CIDR with the following commands:

host google.com

You should receive the following output:

root@host:~# host google.com
google.com has address 172.217.4.46
google.com has IPv6 address 2607:f8b0:4004:c07::64
google.com has IPv6 address 2607:f8b0:4004:c07::8b
google.com has IPv6 address 2607:f8b0:4004:c07::65
google.com has IPv6 address 2607:f8b0:4004:c07::71
google.com mail is handled by 10 smtp.google.com.

Now, to find the CIDR execute the following command:

whois 172.217.4.46 | grep CIDR

You should receive the following output:

root@host:~# whois 172.217.4.46 | grep CIDR
CIDR:           172.217.0.0/16

We have everything that we need to block the google network. Just execute the following command:

iptables -A OUTPUT -p tcp -d 172.217.0.0/16 -j DROP

5. Block Specific Port

For example if we do not want some specific port to be accessible from outside, we can easily block it. To block outgoing connections on the MySQL 3306 port via iptables rules execute the following command:

iptables -A OUTPUT -p tcp --dport 3306 -j DROP

6. Grant Access to multiple ports

To allow multuple ports for incoming connections execute the following command:

iptables -A INPUT  -p tcp -m multiport --dports 80,443 -j ACCEPT

To allow multuple ports for outgoing connections execute the following command:

iptables -A OUTPUT -p tcp -m multiport --sports 80,443 -j ACCEPT

7. Port Forwarding

To set up port forwarding and forward for example port 80 to port 443 execute the following command:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 443

8. Save iptables rules

For example to save all these iptables commands you need to execute the following command:

iptables-save

You should receive the following output:

root@host:~# iptables-save
# Generated by iptables-save v1.8.7 on Fri Jul 22 23:52:08 2022
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -s 192.168.0.1/32 -j ACCEPT
-A INPUT -s 192.168.0.1/32 -j DROP
-A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
-A OUTPUT -d 172.217.0.0/16 -p tcp -j DROP
-A OUTPUT -p tcp -m tcp --dport 3306 -j DROP
-A OUTPUT -p tcp -m multiport --sports 80,443 -j ACCEPT
COMMIT
# Completed on Fri Jul 22 23:52:08 2022
# Generated by iptables-save v1.8.7 on Fri Jul 22 23:52:08 2022
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 443
COMMIT
# Completed on Fri Jul 22 23:52:08 2022

9. Flush iptables rules

To flush all iptables rules we set in the previuous steps you need to execute the command iptables -F but first check the ouput of iptables -nvL to check the previously set up rules:

iptables -nvL

If you followed the previous commands you should receive the following output:

root@host:~# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  *      *       192.168.0.1          0.0.0.0/0
    0     0 DROP       all  --  *      *       192.168.0.1          0.0.0.0/0
    1    60 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            172.217.0.0/16
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:3306
    1    40 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport sports 80,443

Now, you can flush the rules with the following command:

iptables -F

Now, if you execute the command iptables -nvL to list the current rules you should receive an empty output similar in the first step above.

root@host:~# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

10. Man command for iptables

If you want to know, everything about the iptables command and the parameters that can be used, execute the man iptables and you will receive the following output:

root@host:~# man iptables
IPTABLES(8)                                                                iptables 1.8.7                                                               IPTABLES(8)

NAME
       iptables/ip6tables — administration tool for IPv4/IPv6 packet filtering and NAT

SYNOPSIS
       iptables [-t table] {-A|-C|-D} chain rule-specification

       ip6tables [-t table] {-A|-C|-D} chain rule-specification

       iptables [-t table] -I chain [rulenum] rule-specification

       iptables [-t table] -R chain rulenum rule-specification

       iptables [-t table] -D chain rulenum

       iptables [-t table] -S [chain [rulenum]]

       iptables [-t table] {-F|-L|-Z} [chain [rulenum]] [options...]

       iptables [-t table] -N chain

       iptables [-t table] -X [chain]

       iptables [-t table] -P chain target

       iptables [-t table] -E old-chain-name new-chain-name

       rule-specification = [matches...] [target]

       match = -m matchname [per-match-options]

       target = -j targetname [per-target-options]

DESCRIPTION
       Iptables and ip6tables are used to set up, maintain, and inspect the tables of IPv4 and IPv6 packet filter rules in the Linux kernel.  Several different ta‐
       bles may be defined.  Each table contains a number of built-in chains and may also contain user-defined chains.

Congratulations! You successfully practiced the 10 most used iptables in Linux. If you have difficulties understanding the commands all you need to do is sign up for one of our NVMe VPS plans and submit a support ticket. Our admins are available 24/7 and will help you with the request immediately.

If you liked this about 10 useful iptables commands in Linux with an example, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below.

The post 10 Useful iptables Commands in Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/10-useful-iptables-commands-in-linux/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
How to Install and Use Ncdu for Better Overview of Disk Usage in Linux https://linuxhostsupport.com/blog/how-to-install-and-use-ncdu-for-better-overview-of-disk-usage-in-linux/ https://linuxhostsupport.com/blog/how-to-install-and-use-ncdu-for-better-overview-of-disk-usage-in-linux/#respond Wed, 15 Jun 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1699 The default disk usage command from UNIX based system summarizes directories on trees’ sizes, so it includes all their contents and individual files sizes. But, it is helpful to track down space hogs on your system. In other words, it will list directories and files that consume large amounts of space on the hard disk […]

The post How to Install and Use Ncdu for Better Overview of Disk Usage in Linux appeared first on LinuxHostSupport.

]]>
The default disk usage command from UNIX based system summarizes directories on trees’ sizes, so it includes all their contents and individual files sizes. But, it is helpful to track down space hogs on your system. In other words, it will list directories and files that consume large amounts of space on the hard disk drive.

NCDU explained

Passing the years, ncdu was getting hugely recommended through the internet. NCDU is a disk usage analyzer that has an ncurses interface. However, in this post we’ll explain how to install ncdu on *UNIX-based system to check the disk usage.

Installing NCDU

In order to install NCDU, you’ll have to see what is the Distro that you are using, to use one of the below codes:

1. Debian-based install
– Apt command to install ncdu:

sudo apt install ncdu

2. CentOS/RHEL/Fedora install:
– To install on CentOS/RHEL/Fedora you must enable EPEL repository using this command:

sudo yum install epel-release

– Then you can run the ncdu installation command on CentOS:

sudo yum install ncdu

– Or, if you are running Fedora, you should run:

sudo dnf install ncdu

3. Alpine Linux install:
– You can try to install it using the apk command:

apk add ncdu ncdu-doc

4. OpenSUSE/SUSE Linux:
– For this system, we use zypper:

sudo zypper in ncdu

5. Arch Linux:
– On arch linux, you should use pacman:

pacman -S ncdu

6. FreeBSD unix:
– Type the following command on your terminal:

sudo pkg install ncdu

7. OpenBSD:
– There’s little difference on this one, so just copy below to install it:

doas pkg_add ncdu

How to use NCDU

The syntax of it is really simple, you just need to use as it described below:

ncdu
ncdu <flags> <directories>

Flags and the directory are optional, if not provided, the command will check your current working directory. When you run the command, the disk usage of each directory from your current one will show up as a list. To exit that list, you can simply press “Q”.

You can get info from any directory using NCDU, simply use:

ncdu /root
ncdu /home
ncdu /var/log

NCDU flags

In that section we’ll review some flags available to be used on the NCDU command. The first one is the flag “-x”.

This flag let you scan a full system, your root filesystem. To use it, you can run:

ncdu -x /

We can also enable the extended information mode with the flag -e, simply run:

ncdu -e

If you want your ncdu response to having some colors, you can add this by using the “–color” flag:

ncdu --color dark -x /

We can also exclude files that match the provided pattern:

ncdu --exclude '.ht*'
ncdu -x --exclude '/var/log/ --exclude '/directory2' --exlucde ... /

There are many others and shortcuts that are explained in their manual:

man ncdu

That’s it. You have successfully installed NCDU on Linux and learned its basic syntax. You can now use it on your system to have a better usage description on your server.

The post How to Install and Use Ncdu for Better Overview of Disk Usage in Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-and-use-ncdu-for-better-overview-of-disk-usage-in-linux/feed/ 0
How to Install Grafana on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-grafana-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-grafana-on-ubuntu-20-04/#comments Mon, 30 May 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1673 Grafana is a free, open-source, and composable observability and data visualization platform. It is used for monitoring, analysis, and visualization of real-time system data. Its frontend is written in Typescript while the backend is written in Go. It can be used with time series databases such as InfluxDB, Prometheus, and Elasticsearch. It provides a beautiful […]

The post How to Install Grafana on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
Grafana is a free, open-source, and composable observability and data visualization platform. It is used for monitoring, analysis, and visualization of real-time system data. Its frontend is written in Typescript while the backend is written in Go. It can be used with time series databases such as InfluxDB, Prometheus, and Elasticsearch. It provides a beautiful dashboard that allows users to create and edit both log and data graphs and create metrics.

In this post, we will explain how to install Grafana on Ubuntu 20.04.

Prerequisites

  • A Ubuntu 20.04 VPS with root access enabled or a user with sudo privileges.

Log in via SSH and Update your System

First, you will need to log in to your Ubuntu 20.04 VPS via SSH as the root user:

ssh root@IP_ADDRESS -p PORT_NUMBER
Next, run the following commands to upgrade all installed packages on your VPS:

apt-get update -y

Once all the packages are updated, restart your system to apply the changes.

Add Grafana Repository

By default, the Grafana package is not included in the Ubuntu 20.04 default repository. So you will need to add the Grafana official repository to your system.

First, install all required dependencies using the following command:

apt-get install wget curl gnupg2 apt-transport-https software-properties-common -y

Next, download and add the Grafana GPG key with the following command:

wget -q -O - https://packages.grafana.com/gpg.key | apt-key add -

Next, add the Grafana repository to APT using the following command:

echo "deb https://packages.grafana.com/oss/deb stable main" | tee -a /etc/apt/sources.list.d/grafana.list

Once the repository is added to your system, you can update it with the following command:

apt-get update -y

Install Grafana

Now, you can install the Grafana by running the following command:

apt-get install grafana -y

Once the Grafana package is installed, verify the Grafana version with the following command:

grafana-server -v

You will get the following output:

Version 8.4.5 (commit: 4cafe613e1, branch: HEAD)

Now, start the Grafana service and enable it to start at system reboot:

systemctl start grafana-server
systemctl enable grafana-server

You can now check the status of the Grafana with the following command:

systemctl status grafana-server

You will get the following output:

● grafana-server.service - Grafana instance
     Loaded: loaded (/lib/systemd/system/grafana-server.service; disabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-04-06 14:39:27 UTC; 5s ago
       Docs: http://docs.grafana.org
   Main PID: 2761 (grafana-server)
      Tasks: 9 (limit: 2348)
     Memory: 32.2M
     CGroup: /system.slice/grafana-server.service
             └─2761 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/run/grafana/grafana-server.pid --packaging=deb cfg:>

Apr 06 14:39:29 ubuntu2004 grafana-server[2761]: logger=sqlstore t=2022-04-06T14:39:29.83+0000 lvl=info msg="Created default admin" user=admin
Apr 06 14:39:29 ubuntu2004 grafana-server[2761]: logger=sqlstore t=2022-04-06T14:39:29.83+0000 lvl=info msg="Created default organization"
Apr 06 14:39:29 ubuntu2004 grafana-server[2761]: logger=plugin.manager t=2022-04-06T14:39:29.89+0000 lvl=info msg="Plugin registered" pluginI>
Apr 06 14:39:29 ubuntu2004 grafana-server[2761]: logger=plugin.finder t=2022-04-06T14:39:29.9+0000 lvl=warn msg="Skipping finding plugins as >
Apr 06 14:39:29 ubuntu2004 grafana-server[2761]: logger=query_data t=2022-04-06T14:39:29.9+0000 lvl=info msg="Query Service initialization"
Apr 06 14:39:29 ubuntu2004 grafana-server[2761]: logger=live.push_http t=2022-04-06T14:39:29.91+0000 lvl=info msg="Live Push Gateway initiali>
Apr 06 14:39:30 ubuntu2004 grafana-server[2761]: logger=server t=2022-04-06T14:39:30.11+0000 lvl=info msg="Writing PID file" path=/run/grafan>
Apr 06 14:39:30 ubuntu2004 grafana-server[2761]: logger=http.server t=2022-04-06T14:39:30.12+0000 lvl=info msg="HTTP Server Listen" address=[>
Apr 06 14:39:30 ubuntu2004 grafana-server[2761]: logger=ngalert t=2022-04-06T14:39:30.13+0000 lvl=info msg="warming cache for startup"
Apr 06 14:39:30 ubuntu2004 grafana-server[2761]: logger=ngalert.multiorg.alertmanager t=2022-04-06T14:39:30.13+0000 lvl=info msg="starting Mu>

At this point, Grafana is started and listens on port 3000. You can check it with the following command:

ss -antpl | grep 3000

You should see the following output:

LISTEN    0         4096                     *:3000                   *:*        users:(("grafana-server",pid=2761,fd=8))                                       

Configure Nginx as a Reverse Proxy for Grafana

Next, you will need to install the Nginx as a reverse proxy for Grafana. First, install the Nginx package using the following command:

apt-get install nginx -y

Once the Nginx is installed, create an Nginx virtual host configuration file:

nano /etc/nginx/conf.d/grafana.conf

Add the following lines:

Server {
        server_name grafana.example.com;
        listen 80 ;
        access_log /var/log/nginx/grafana.log;

    location / {
                proxy_pass http://localhost:3000;
        proxy_set_header Host $http_host;
                proxy_set_header X-Forwarded-Host $host:$server_port;
                proxy_set_header X-Forwarded-Server $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
}

Save and close the file then verify the Nginx configuration file using the following command:

nginx -t

You will 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

Finally, restart the Nginx service to apply the changes:

systemctl restart nginx

Access Grafana Dashboard

Now, open your web browser and access the Grafana dashboard using the URL http://grafana.example.com. You will be redirected to the Grafana login page:

Provide default admin username and password as admin/admin and click on the Log in button. You should see the Grafana password change screen:

Change your default password and click on the Submit button. You should see the Grafana dashboard on the following screen:

Of course, if you are one of our Ubuntu Hosting customers, you don’t have to install Grafana on your Ubuntu 20.04 VPS – simply ask our admins, sit back, and relax. Our admins will install Grafana on Ubuntu 20.04 for you immediately.

PS. If you liked this post about how to install Grafana on Ubuntu 20.04 VPS, 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 Grafana on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-grafana-on-ubuntu-20-04/feed/ 7
How to Install Varnish 7 on AlmaLinux https://linuxhostsupport.com/blog/how-to-install-varnish-7-on-almalinux/ https://linuxhostsupport.com/blog/how-to-install-varnish-7-on-almalinux/#respond Sun, 15 May 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1670 Varnish is a free, and open-source web application accelerator used for caching website content in memory. It is designed for HTTP to speed up caching of heavy dynamic websites. It is capable of speeding up your website page loading time by a factor of 10x to 300x. This will helps you with your Search Engine […]

The post How to Install Varnish 7 on AlmaLinux appeared first on LinuxHostSupport.

]]>
Varnish is a free, and open-source web application accelerator used for caching website content in memory. It is designed for HTTP to speed up caching of heavy dynamic websites. It is capable of speeding up your website page loading time by a factor of 10x to 300x. This will helps you with your Search Engine Results Page and also improve the user experience on your website.

In this post, we will show you how to install Varnish 7 on AlmaLinux.

Prerequisites

  • An AlmaLinux VPS with root access enabled or a user with sudo privileges.

Log in via SSH and Update your System

First, you will need to log in to your AlmaLinux VPS via SSH as the root user:

ssh root@IP_ADDRESS -p PORT_NUMBER
Next, run the following commands to upgrade all installed packages on your VPS:

dnf update -y

Once all the packages are updated, restart your system to apply the changes.

Add Varnish Repo

By default, the latest version of Varnish is not included in the AlmaLinux default repo. So you will need to disable the default Varnish repo. You can disable it with the following command:

dnf module disable varnish

You will get the following output:

AlmaLinux - AppStream                                                                                     5.6 MB/s | 9.7 MB     00:01    
AlmaLinux - BaseOS                                                                                        8.8 MB/s | 6.8 MB     00:00    
AlmaLinux - Extras                                                                                         28 kB/s |  12 kB     00:00    
Dependencies resolved.
==============================================================================================================================================
 Package                           Architecture                     Version                           Repository                         Size
==============================================================================================================================================
Disabling modules:
 varnish                                                                                                                                     

Transaction Summary
==============================================================================================================================================

Is this ok [y/N]: y
Complete!

Next, install the EPEL repository and add the Varnish 7 repo with the following command:

dnf install epel-release -y
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish70/script.rpm.sh | bash -

Install Varnish 7

Now, you can run the following command to install the Varnish 7 on your server.

dnf install varnish -y

Once the Varnish is installed, you can verify the Varnish version using the following command:

rpm -qi varnish

You will get the Varnish package information in the following output:

Name        : varnish
Version     : 7.0.2
Release     : 1.el8
Architecture: x86_64
Install Date: Wednesday 06 April 2022 03:21:17 PM UTC
Group       : System Environment/Daemons
Size        : 8907085
License     : BSD
Signature   : (none)
Source RPM  : varnish-7.0.2-1.el8.src.rpm
Build Date  : Wednesday 12 January 2022 02:25:34 PM UTC
Build Host  : 7fc509e75620
Relocations : (not relocatable)
URL         : https://www.varnish-cache.org/
Summary     : High-performance HTTP accelerator
Description :
This is Varnish Cache, a high-performance HTTP accelerator.

Manage Varnish Service

By default, the Varnish service is managed by systemd. You can start the Varnish service with the following command:

systemctl start varnish

To enable the Varnish service, run the following command:

systemctl enable varnish

To check the status of the Varnish service, run the following command:

systemctl status varnish

You will get the following output:

● varnish.service - Varnish Cache, a high-performance HTTP accelerator
   Loaded: loaded (/usr/lib/systemd/system/varnish.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2022-04-06 15:21:40 UTC; 6s ago
  Process: 25005 ExecStart=/usr/sbin/varnishd -a :6081 -a localhost:8443,PROXY -p feature=+http2 -f /etc/varnish/default.vcl -s malloc,256m (>
 Main PID: 25006 (varnishd)
    Tasks: 217
   Memory: 108.5M
   CGroup: /system.slice/varnish.service
           ├─25006 /usr/sbin/varnishd -a :6081 -a localhost:8443,PROXY -p feature=+http2 -f /etc/varnish/default.vcl -s malloc,256m
           └─25017 /usr/sbin/varnishd -a :6081 -a localhost:8443,PROXY -p feature=+http2 -f /etc/varnish/default.vcl -s malloc,256m

Apr 06 15:21:39 rockylinux systemd[1]: Starting Varnish Cache, a high-performance HTTP accelerator...
Apr 06 15:21:40 rockylinux varnishd[25006]: Version: varnish-7.0.2 revision 9b5f68e19ca0ab60010641e305fd12822f18d42c
Apr 06 15:21:40 rockylinux varnishd[25006]: Platform: Linux,4.18.0-348.12.2.el8_5.x86_64,x86_64,-junix,-smalloc,-sdefault,-hcritbit
Apr 06 15:21:40 rockylinux varnishd[25006]: Child (25017) Started
Apr 06 15:21:40 rockylinux varnishd[25006]: Child (25017) said Child starts
Apr 06 15:21:40 rockylinux systemd[1]: Started Varnish Cache, a high-performance HTTP accelerator.

Configure Varnish

By default, Varnish listens on port 6081. You can check it with the following command:

ss -antpl | grep varnish

You will get the following output:

LISTEN 0      128          0.0.0.0:6081       0.0.0.0:*    users:(("cache-main",pid=25017,fd=6),("varnishd",pid=25006,fd=6))
LISTEN 0      128             [::]:6081          [::]:*    users:(("cache-main",pid=25017,fd=7),("varnishd",pid=25006,fd=7))

Now, you will need to configure Varnish to listen on port 80. You can do it by editing the Varnish configuration file:

nano /usr/lib/systemd/system/varnish.service

Replace the port 6081 with 80 as shown below:

ExecStart=/usr/sbin/varnishd \
          -a :80 \
          -a localhost:8443,PROXY \
          -p feature=+http2 \
          -f /etc/varnish/default.vcl \
          -s malloc,2g

Save and close the file then reload the systemd daemon to apply the changes:

systemctl daemon-reload

Next, you will also need to edit the Varnish VCL configuration file and define your Nginx backend.

nano /etc/varnish/default.vcl

Define your Nginx backend as shown below:

backend default {
    .host = "127.0.0.1";
    .port = "8080";
}

Save and close the file when you are finished.

Note: Replace 127.0.0.1 with your Nginx web server IP.

Configure Varnish for Nginx

First, install the Nginx web server package with the following command:

dnf install nginx -y

Once the Nginx is installed, you will need to edit the Nginx configuration file and change the listen port from 80 to 8080:

nano /etc/nginx/nginx.conf

Change the default port from 80 to 8080:

    listen       8080 default_server;
        listen       [::]:8080 default_server;

Save and close the file then restart the Nginx service to apply the changes:

systemctl restart nginx

Finally, restart the Varnish service to apply the changes:

systemctl restart varnish

Verify Varnish

At this point, Varnish is installed and configured to work with Nginx. Now it’s time to verify it.

You can verify it using the curl command as shown below:

curl -I http://your-server-ip

If everything is fine, you will get the following output:

HTTP/1.1 200 OK
Server: nginx/1.14.1
Date: Wed, 06 Apr 2022 15:25:48 GMT
Content-Type: text/html
Content-Length: 3429
Last-Modified: Thu, 10 Jun 2021 09:09:03 GMT
ETag: "60c1d6af-d65"
X-Varnish: 2
Age: 0
Via: 1.1 varnish (Varnish/7.0)
Accept-Ranges: bytes
Connection: keep-alive

Of course, if you are one of our Linux VPS hosting customers, you don’t have to install Varnish 7 on your AlmaLinux VPS – simply ask our admins, sit back, and relax. Our admins will install Varnish 7 on AlmaLinux for you immediately.

PS. If you liked this post about how to install Varnish 7 on AlmaLinux VPS, 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 Varnish 7 on AlmaLinux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-varnish-7-on-almalinux/feed/ 0
How to Install Webuzo v3 on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-webuzo-v3-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-webuzo-v3-on-ubuntu-20-04/#comments Sat, 30 Apr 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1657 In this tutorial, we are going to explain how to install Webuzo v3 control panel on Ubuntu 20.04. Webuzo is a hosting control panel that allows the developers and administrators to easily manage their domains, create databases, deploy a variety of applications create users and etc. With Webuzo can be managed different applications such as […]

The post How to Install Webuzo v3 on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we are going to explain how to install Webuzo v3 control panel on Ubuntu 20.04.

Webuzo is a hosting control panel that allows the developers and administrators to easily manage their domains, create databases, deploy a variety of applications create users and etc. With Webuzo can be managed different applications such as MySQL, MongoDB as databases, Nginx, LighTTPD as webservers, PHP, Ruby, Perl as languages and etc.

Installing the Webuzo control panel is done with an installation script and can take up to 15 minutes. Let’s get started!

Prerequisites

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

Step 1. Update the System

Webuzo control panel requires a fresh installation of Ubuntu 20.04. Since we have a fresh installation we need to update the system before we take any steps about the installation process.

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

Step 2. Remove Unnecessary installations

Webuzo v3 control panel has its own way of configuring the PHP, MySQL, and Apache or Nginx, so we need to remove them completely before we download and run the installation script.

sudo apt purge php* mysql* apache2* nginx* -y

Step 3. Install Webuzo v3 Control Panel

First, we need to download the installation script. Execute the command below for the installation script to be downloaded in the root directory on your server:

wget http://files.webuzo.com/install.sh

Once, the script is downloaded, make it executable:

chmod +x install.sh

Before you execute the script it is good to be mentioned, that the Webuzo v3 control panel can be installed with the LAMP(Linux, Apache, MySQL, PHP) or LEMP(Linux, Nginx, MySQL, PHP) stack. In this tutorial, we are going to install the Webuzo with the LAMP stack.

Run the installation script with the arguments as explained below:

./install.sh --v3 --lamp

This should be the first output after execution of the script:

 Welcome to Webuzo Installer
--------------------------------------------------------
 Installation Logs : tail -f /root/webuzo-install.log
--------------------------------------------------------

1) Installing Libraries and Dependencies

After successful installation the following message will be displayed:

----------------------------------------------------------------
 /$      /$ /$ /$  /$   /$ /$  /$
| $  /$ | $| $_____/| $__  $| $  | $|_____ $  /$__  $
| $ /$| $| $      | $  \ $| $  | $     /$/ | $  \ $
| $/$ $ $| $   | $ | $  | $    /$/  | $  | $
| $_  $| $__/   | $__  $| $  | $   /$/   | $  | $
| $/ \  $| $      | $  \ $| $  | $  /$/    | $  | $
| $/   \  $| $| $/|  $/ /$|  $/
|__/     \__/|________/|_______/  \______/ |________/ \______/
----------------------------------------------------------------
Congratulations, Webuzo has been successfully installed

You can now configure Softaculous Webuzo at the following URL :
https://162.246.248.185:2005/

----------------------------------------------------------------
Thank you for choosing Webuzo !
----------------------------------------------------------------

Step 4. Access the Webuzo GUI

To access the Webuzo control panel, access your server IP address on port 2004

http://YOUR_SERVER_IP:2004

As username, you can use the root user, and the root password of your server.

After successful login you should see the screen as described in the picture below:

Step 5. The Webuzo Panel Menu

In the next paragraphs we are going to explain the most important options that the Webuzo control panel offers, to make the work easier for developers and system administrators.

USERS:The first section on the left menu is the users section. In this section, we can list the users, add new users, see the domains, suspend the existing users, and email them as well. Also, in this section, the admins can grant shell access to the users.

PLANS:The second option in this menu is the section for the plans. We can add a new plan, list plans, add and disable some features and etc. By adding a new plan we can name it, add some features like disk quota, max FTP accounts, max addon domains, define the home directory, max email accounts, and so on. Adding a new plan has a variety of options and to understand them in more detail you will have to spend some time in this section.

RESELLERS: Next section is the reseller section where we can list the resellers, add some privileges to the resellers, and email them at once. One user can become a reseller, simply by checking one checkbox while we add a new user.

SETTINGS: This is one of the most important sections, where the administrator can change the root password of the server, configure the backup strategy, set the server’s timezone, update the Webuzo control panel, set the nameservers, manage the PHP settings and etc.

NETWORKING: In this section, we can add new IP, set the IP range, change the resolver configuration and change the server’s hostname.

The rest of the sections in the panel menu are for storage, emails, security, plugins, SQL services, support and Softaculous. Now when you successfully installed the Webuzo control panel, and manage to login in you can easily access these sections.

That’s it! In this tutorial, we explained the process of installing the Webuzo v3 control panel and its features. Of course, you do not have to install it by yourself if you do not have experience with Linux servers and control panels. All you need to do is to sign up for one of our SSD VPS plans and submit a support ticket. Our professional admins are 24/7 available for you.

If you liked this post on how to install Webuzo v3 on Ubuntu 20.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 Webuzo v3 on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-webuzo-v3-on-ubuntu-20-04/feed/ 3
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
How to Install and Configure HAProxy on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-and-configure-haproxy-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-and-configure-haproxy-on-ubuntu-20-04/#comments Sun, 30 Jan 2022 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1629 HAProxy or High Availability Proxy, is a well-known open-source TCP/HTTP load balancer and proxy solution which is able to handle a lot of traffic. HAProxy consumes a very low amount of memory, and it is commonly used to improve the performance of servers by distributing the workload across multiple servers to handle a large number […]

The post How to Install and Configure HAProxy on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
HAProxy or High Availability Proxy, is a well-known open-source TCP/HTTP load balancer and proxy solution which is able to handle a lot of traffic. HAProxy consumes a very low amount of memory, and it is commonly used to improve the performance of servers by distributing the workload across multiple servers to handle a large number of concurrent connections. If you have busy websites, you can install and configure HAProxy as the reverse proxy to your webservers.

In this tutorial, we will show you how to install and configure HAProxy on Ubuntu 20.04, one of the most popular operating systems in the world.

Prerequisites

  • 3 Ubuntu 20.04 VPS, one for HAProxy and we will use the other two as the webservers.
  • SSH root access or a normal SSH user with sudo privileges.

Step 1. Login and Update the System

Log in to your Ubuntu 20.04 VPS as a root user or as a regular user with sudo privileges. In this tutorial, we will use a sudoer user called ‘master’.

ssh master@IP_Address -p Port_number

Do not forget to replace “master” with a user that has sudo privileges, or root. Additionally, replace “IP_Address” and “Port_Number” with your server’s IP address and SSH port.

Run this command to check whether you have the proper Ubuntu version installed on your server:

$ lsb_release -a

You should see this output:

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
install and configure haproxy on ubuntu 20.04

Now, run the following command to update all installed packages to the latest available version.

$ sudo apt update && sudo apt upgrade

Step 2. Install HAProxy

HAProxy is available on the default Ubuntu 20.04 repository. However, the available package is not the most recent stable version. Let’s check the HAProxy version if we want to install it from Ubuntu 20.04 repository.

$ sudo apt show haproxy
set up and configure haproxy on ubuntu 20.04

You can check the latest stable version at http://www.haproxy.org/#down. In this article, we are going to install HAPproxy 2.5, let’s run the following command to proceed with the installation.

$ sudo apt install software-properties-common


The software-properties-common package is probably already installed on your server, but there will be no issue if you run this command again.

$ sudo add-apt-repository ppa:vbernat/haproxy-2.5

This command puts the Personal Package Archive (PPA) into the list of apt sources. After adding the PPA to our APT source list, we can run the command below to complete the installation. You can replace the version number in the command above if you want to use another version of HAProxy.

$ sudo apt update
$ sudo apt install haproxy

Once installed, we can check the version by running this command:

$ sudo haproxy -v

You should see this output:

HAProxy version 2.5.0-1ppa1~focal 2021/11/26 - https://haproxy.org/
Status: stable branch - will stop receiving fixes around Q1 2023.
Known bugs: http://www.haproxy.org/bugs/bugs-2.5.0.html
Running on: Linux 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64
setting up and configuring haproxy on ubuntu 20.04

Step 3. Configure HAProxy

By default, HAProxy is not configured to listen on a port number. In this step, since we are going to configure it as a reverse proxy and load balancer, we are going to make changes to the default HAProxy configuration.

$ sudo cp -a /etc/haproxy/haproxy.cfg{,.orig}

The command above will copy the file /etc/haproxy/haproxy.cfg to /etc/haproxy/haproxy.cfg.orig

Now. let’s edit the file.

$ sudo nano /etc/haproxy/haproxy.cfg

And append these lines:

frontend haproxy-main
    bind *:80
    option forwardfor  
    default_backend apache_webservers    

backend apache_webservers
    balance roundrobin
    server websvr1	10.0.0.10:80 check
    server websvr2	10.0.0.20:80 check

Make sure to replace 10.0.0.10 and 10.0.0.20 with your actual webserver IP addresses. Save the file then exit.

Now, log in to your other two servers and install apache on the servers then create a default index file by running these commands.

$ sudo apt update; sudo apt install apache2 -y

On websvr1, run this command:

echo "<H1>Apache on backend server 1 is running </H1>" |sudo tee /var/www/html/index.html

On websvr2, run this command:

echo "<H1>Apache on backend server 2 is running </H1>" |sudo tee /var/www/html/index.html

Save the files then exit.

On your HAProxy server, restart the service:

$ sudo systemctl restart haproxy

The HAProxy server is now ready to accept and distribute the workload across the two apache servers. You can verify this by invoking a one-liner command in your HAProxy server.

$ while true; do curl localhost; sleep 1; done
configure haproxy on ubuntu 20.04

As seen in the picture, the website is loaded both from websvr1 and websvr2.

If you want to see the statistics and see the information through the GUI, we can configure HAProxy and enable the monitoring function.

Open HAProxy configuration file.

$ sudo nano /etc/haproxy/haproxy.cfg

Then append these lines.

listen stats
    bind :8800
    stats enable
    stats uri /
    stats hide-version
    stats auth rosehosting:m0d1fyth15
    default_backend apache_webservers

Pay attention to the stats auth part. This is where you specify the login name and password. Change the login name and password to a stronger password. Save the file, exit and restart HAProxy.

$ sudo systemctl restart haproxy

Now, you can navigate to http://YOUR_HAPROXY_IP_ADDRESS:8800 to see the statistics, you will be asked for the username and password you specified earlier in /etc/haproxy/haproxy.cfg.

installing and configuring haproxy on ubuntu 20.04

That’s it. You have successfully installed HAProxy on your Ubuntu VPS. For more information about HAProxy, please refer to the HAProxy website.

If you are one of our web hosting customers and use our optimized Linux Hosting, you don’t have to install HAProxy On Ubuntu 20.04 by yourself, our expert Linux admins will set up and configure HAProxy on your Ubuntu VPS, 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 HAProxy on Ubuntu 20.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 and Configure HAProxy on Ubuntu 20.04 appeared first on LinuxHostSupport.

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

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

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

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

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

Prerequisites

  • Server running Debian 11
  • Root access to the server

Updating system and installing dependencies

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

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

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

Installing and configuring Apache

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

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

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

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

systemctl restart apache2

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

Installing and configuring Nginx.

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

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

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

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

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

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

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

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

installing nginx as a reverse proxy for apache on debian 11

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

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

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

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

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

Prerequisites

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

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

Step 1. Update System

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

ssh master@IP_Address -p Port_Number

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

$ lsb_release -a

You should get this as the output:

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

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

$ sudo apt update && apt upgrade

Step 2. Add Repository

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

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

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

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

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

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

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

Now, we need to update the repository.

$ sudo apt update -y

Step 3. Install GitLab

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

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

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

$ sudo gitlab-ctl reconfigure

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

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

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

Step 4. Configure GitLab

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

Secure GitLab Server with Let’s Encrypt SSL Certificate

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

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

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

Replace it with

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

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

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

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

Save the file then exit.

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

$ sudo gitlab-ctl reconfigure

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

Email Configuration

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

Open /etc/gitlab/gitlab.rb

$ sudo nano /etc/gitlab/gitlab.rb

Then, find the following

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

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

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

$ sudo gitlab-ctl reconfigure

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

configuring gitlab on debian 11

Congratulations! You have successfully installed GitLab on Debian 11.

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

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

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

]]>
https://linuxhostsupport.com/blog/how-to-install-gitlab-on-debian-11/feed/ 3
How to Search Files on the Linux Terminal https://linuxhostsupport.com/blog/how-to-search-files-on-the-linux-terminal/ https://linuxhostsupport.com/blog/how-to-search-files-on-the-linux-terminal/#comments Wed, 15 Dec 2021 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1606 Finding files and directories in Linux is a very difficult task compared to Windows operating system. Especially if you are working on the server operating system without a Desktop interface. There are several ways to search files and directories in Linux. The simple and easiest way is to use the Linux terminal to search or […]

The post How to Search Files on the Linux Terminal appeared first on LinuxHostSupport.

]]>
Finding files and directories in Linux is a very difficult task compared to Windows operating system. Especially if you are working on the server operating system without a Desktop interface. There are several ways to search files and directories in Linux. The simple and easiest way is to use the Linux terminal to search or locate files.

The find and locate are the most popular command-line tool used to search files and directories in Linux. The find command allows you to search for files and directories based on an expression. This way you can search files and directories based on their size, date, type, and ownership.

In this post, we will show you how to search files on the Linux terminal using the find and locate commands.

Prerequisites

  • A Linux VPS with root access enabled, or a user with sudo privileges.

Log in and Update Packages

First, we’re going to need to log into our server using SSH. You can do that by entering this command:

ssh root@IP_Address -p Port_Number

Remember to replace root with your username if you are not using the root user. Change IP_Address and Port_Number according to your server’s IP address and SSH port number.

Once you are logged in, you should update all of your packages to their latest available versions.

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

Once all the packages are up-to-date, restart your server to apply the configuration changes.

Search Files by Name

The find command allows you to search a specific file by its name. You can use the find command with -name option followed by the file name that you want to search.

For example, to search a file named file1.txt in the /etc directory, run the following command:

find /etc -type f -name file1.txt

If you want to ignore the case during the file search, use the -i option as shown below:

find /etc -type f -iname file1.txt

You can use the following option if you want to search for a specific file type:

  • f – regular file
  • d – directory
  • l – symbolic link
  • c – character devices
  • b – block devices

Search Files by Extension

You can use the asterisk * symbol before any extension to find all files that end with specific extensions including, .txt, .png, .pdf, .mp4, etc.

For example, to search all files with extensions .png in the /opt directory, run the following command:

find /opt -type f -name '*.png'

This command will search all PNG files located inside /opt directory.

Search Files by Size

You can search a file based on their size using the -size option followed by size criteria.

For example, to search all files less than 2 MB inside /home directory, run the following command:

find /home -type f -size -2M

You can use the + symbol before the size if you want to search files greater than 2 MB:

find /home -type f +size -2M

You can also specify the size range during the file search.

For example, to search all files between 2 MB and 10 MB, run the following command:

find /home -type f -size +2M -size 10M

Use the following options to specify the size in KB, MB, GB, and more.

  • c – bytes
  • k – Kilobytes
  • M – Megabytes
  • G – Gigabytes
  • b – 512-byte

Search Files by Modification Time

The find command can search a file based on its modification, access, and change time.

For example, to search PHP files inside /home directory that have been modified in the last 10 days, run the following command:

find /home -name "*.php" -mtime 10

You can use the + symbol if you want to find all files that have been modified more than 10 days.

find /home -name "*.php" -mtime +10

Search Files by Permissions

You can use the find command with the -perm option to search a file based on their permissions.

For example, to search all files inside the /etc directory with permissions of exactly 764, run the following command:

find /etc -perm 764

Search Files Using the Locate Command

The locate is another command-line tool that allows you to search for a file in Linux. The locate command is much faster than other tools because it uses a database file to perform the search instead of searching your local hard disks.

For example, to search a file named rc.local, run the following command:

locate rc.local

If you want to count the number of search keywords is matched, use the -c option.

locate -c rc.local

Conclusion

In the above post, we explained how to search for a file using the find and locate command in Linux. I hope you have now enough understanding of how to search a file in your Linux system using the terminal.

PS. If you liked this post, on how to search files on the Linux terminal, 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 Search Files on the Linux Terminal appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-search-files-on-the-linux-terminal/feed/ 6
How To Install Kuma on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-kuma-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-kuma-on-ubuntu-20-04/#respond Tue, 30 Nov 2021 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1595 Kuma is an open source monitoring tool like “Uptime Robot” written in Nodejs. In this article, we’ll learn how to install it on Ubuntu 20.04 so we can self-host our Uptime Bot. We’ll also set up a reverse proxy on Apache with a Let’s Encrypt SSL to secure our website. Kuma is easy to use […]

The post How To Install Kuma on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
Kuma is an open source monitoring tool like “Uptime Robot” written in Nodejs. In this article, we’ll learn how to install it on Ubuntu 20.04 so we can self-host our Uptime Bot. We’ll also set up a reverse proxy on Apache with a Let’s Encrypt SSL to secure our website.

Kuma is easy to use and upgrade, and is powerful for traffic control, observability, service discovery, etc.

Prerequisites

  • An Ubuntu server 20.04
  • Root access on your server to install and deploy the services.

Adding user to the system

For security reasons, you should deploy the application using a non-root user on your system. To add the user, you can just use this command:

useradd -m -s /bin/bash kuma

After your user is created, you need to set a password using this command:

passwd kuma

Now we’ll let our user have root privileges with the following command:

usermod -aG sudo kuma

Installing NVM (Node Version Manager)

This tool that we’ll install now, will let us specific our nodejs versions for our applications to make our development and deployments environments more flexible.

First of all, we need to switch from the root user to our Kuma.

su - kuma

Now you can just install the NVM with the following command:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

You need to reload your bashrc file to load the nvm commands:

source ~/.bashrc

We can check now if the NVM is running with this command:

nvm --version

Install NodeJS LTS Version

To install and deploy your uptime Kuma bot, you need to install nodejs >= 14, git, and pm2. In this section, you’ll learn how to install NodeJS.

With the NVM command properly working, you can simply run:

nvm install --lts

And the latest version will be installed on your server. You can check once it finished with the following command:

kuma@server:~$ node --version
v14.18.1

Downloading and installing Uptime-Kuma

To download the uptime Kuma, you need to install git on your server. You can simply run:

sudo apt-get install git

Now just run the following to download the uptime-kuma:

git clone https://github.com/louislam/uptime-kuma.git

You’ll be able now to access your downloaded content and setup the Kuma with the following command:

cd uptime-kuma/
npm run setup

And you’re done, the uptime-kuma setup runs without errors and we can go to setup pm2.

Setting up Uptime-Kuma with pm2

pm2 is a nodejs process manager that will help you manage and keep your nodejs application alive forever. pm2 has some built-in features that make the nodejs application deployment easy, it allows you to monitor your application status, logs, and even set up the service file for your application.

  1. Install pm2 with npm:
npm install pm2 --global

2. Once the installation is completed, you can run this to start Kuma command:

pm2 start npm --name uptime-kuma -- run start-server -- --port=3001 --hostname=127.0.0.1

You should see a screen like the below once you run the command above:

installing kuma on ubuntu 20.04

Now, we’ll create a system file for the service, first you need to run the below command to get the following result:

pm2 startup

You should receive an output like this one:

sudo env PATH=$PATH:/home/kuma/.nvm/versions/node/v14.18.1/bin /home/kuma/.nvm/versions/node/v14.18.1/lib/node_modules/pm2/bin/pm2 startup systemd -u kuma --hp /home/kuma

Just copy the result and paste it on your terminal, so you’ll have an output like this:

installation of kuma on ubuntu 20.04

We need to save the current ongoing process:

pm2 save

Settuping a reverse proxy on kuma service

First of all, we need to install the apache on our server:

sudo apt install apache2

Once the installation is done, you need to enable the proxy modules:

sudo a2enmod ssl proxy proxy_ajp proxy_wstunnel proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_html

We need to create the virtualhost for our subdomain or domain with the following content:

<VirtualHost *:80>
  ServerName EXAMPLE.COM
  ProxyPass / http://localhost:3001/
  RewriteEngine on
  RewriteCond %{HTTP:Upgrade} websocket [NC]
  RewriteCond %{HTTP:Connection} upgrade [NC]
  RewriteRule ^/?(.*) "ws://localhost:3001/$1" [P,L]
</VirtualHost>

(Be sure to change from example.com to your actual domain)

You can now access your domain and you should see the Kuma website

Setting up Let’s Encrypt on our domain

First of all, to secure our domains with Let’s Encrypt, we need to install the certbot. The service responsible for the verification of our domain:

sudo apt install python3-certbot-apache

To generate a certificate on your domain, you need to run the following command:

sudo certbot --apache example.com

(Be sure to change from example.com to your actual domain)

And you just need to follow the instructions on your terminal.

So, we are done. You can now proceed with your uptime kuma setup and finish it. Everything should be working fine with HTTPS.

setting up kuma on ubuntu 20.04

Of course, you don’t have to install Uptime Kuma on Ubuntu 20.04, if you use one of our managed VPS hosting services, in which case you can simply ask our expert Linux admins to set up this for you. They are available 24/7 and will take care of your request immediately.

The post How To Install Kuma on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-kuma-on-ubuntu-20-04/feed/ 0
How to Install Joomla 4.0 on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-joomla-4-0-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-joomla-4-0-on-ubuntu-20-04/#respond Mon, 15 Nov 2021 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1582 Joomla is one of the most popular open-source content management systems (CMS). It is used to publish applications and websites online. It is written in PHP and is commonly configured to use MySQL/MariaDB databases. In this tutorial, we will show you how to install Joomla 4.0 on Ubuntu 20.04 server.  It should work everywhere but […]

The post How to Install Joomla 4.0 on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
Joomla is one of the most popular open-source content management systems (CMS). It is used to publish applications and websites online. It is written in PHP and is commonly configured to use MySQL/MariaDB databases.

installing joomla 4.0 on ubuntu 20.04

In this tutorial, we will show you how to install Joomla 4.0 on Ubuntu 20.04 server.  It should work everywhere but we will do this on one of our Joomla hosting servers.

Prerequisites:

– A VPS running Ubuntu 20.04
– Administrative sudo user with root privileges

Step 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:

sudo apt-get update
sudo apt-get upgrade

Step 2: Install Apache web server and PHP

Joomla requires a webserver to function. Apache is a fast and secure web server and one of the most popular and widely used web servers in the world. You can install it from the official Ubuntu repositories running the following command:

sudo apt install apache2

After installing Apache, the commands below can be used to stop, start and enable Apache services to always start up every time your server starts up.

sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service

To verify that Apache is running, execute the following command:

sudo systemctl status apache2
installation of joomla 4.0 on ubuntu 20.04

Since Joomla is built on PHP, you will need to install PHP as well. You will install PHP and other supporting packages by running the following command:

sudo apt install php php-common libapache2-mod-php php-cli php-fpm php-mysql php-json php-opcache php-gmp php-curl php-intl php-mbstring php-xmlrpc php-gd php-xml php-zip

To verify that PHP is successfully installed, run the following command:

php -v

You should get the following output on your screen:

PHP 7.4.3 (cli) (built: Aug 13 2021 05:39:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

Once all the packages are installed, we will need to edit the php.ini file and modify some settings:

memory_limit = 512M
upload_max_filesize = 256M
post_max_size = 256M 
max_execution_time = 300
output_buffering = off
date.timezone = America/Chicago

Step 3: Install MariaDB

Joomla uses MariaDB/MySQL as a database.  To install the MariaDB database server, enter the following command:

sudo apt install -y mariadb-server mariadb-client

Secure your installation

When the installation is complete, run the following command to secure your installation:

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

Step 4: Create a Joomla Database

Next, you will need to create a database and user for the Joomla installation. First, connect to the MariaDB shell with the following command:

mysql -u root -p

Once connected, create a database and user using the following command:

MariaDB [(none)]> CREATE DATABASE joomla;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON joomla.* TO 'joomla'@'localhost' IDENTIFIED BY  'StrongPassword';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

At this point, MariaDB is installed and configured for Joomla. You can now proceed to install Joomla.

Step 5: Install Joomla

Now that you have your environment completely set up, you can proceed with the Joomla installation. At the time of writing this article, the latest version of Joomla is 4.0.3. You can download it from the Joomla! 4.0 downloads page using the following command:

wget https://downloads.joomla.org/cms/joomla4/4-0-3/Joomla_4-0-3-Stable-Full_Package.zip

Once the download is completed, unzip the archive and move the extracted files to the /var/www/html/joomla directory, which will be the root directory of your new Joomla site:

sudo unzip Joomla_4-0-3-Stable-Full_Package.zip -d /var/www/html/joomla

Finally, change the ownership of the /var/www/html/joomla directory to the www-data user:

sudo chown -R www-data: /var/www/html/joomla

Step 6: Configure Apache for Joomla

Next, you will need to create an Apache virtual host configuration file for the Joomla installation. You can create it with the following command:

nano /etc/apache2/sites-available/joomla.conf

Add the following lines:

<VirtualHost *:80>
     ServerAdmin admin@your_domain.com
     DocumentRoot /var/www/html/joomla/
     ServerName your_domain.com
     ServerAlias www.your_domain.com

     <Directory /var/www/html/joomla/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

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

Save and close the file then activate the Joomla virtual host with the following command:

a2ensite joomla.conf

Next, restart the Apache service to apply the changes:

systemctl restart apache2

Open http://your_domain.com in your favorite web browser and follow the on-screen instructions to complete the Joomla installation.

how to set up joomla 4.0 on ubuntu 20.04

Select your language and enter your site name.

setting up joomla 4.0 on ubuntu 20.04

Insert username and password for your Joomla 4.0 administration account.

Note: Passwords must have at least 12 characters.

how to configure joomla 4.0 on ubuntu 20.04

Set the databases configuration credentials as created previously.

configuring joomla 4.0 on ubuntu 20.04

Click on Complete & Open Site to visit the Joomla 4.0 front page

configuration of joomla 4.0 on ubuntu 20.04

or hit Complete & Open Admin to visit the Joomla 4.0 administration back-end.

installing and setting up joomla 4.0 on ubuntu 20.04

Use your administrator credentials created during the Joomla 4.0 installation.

installation and configuring of joomla 4.0 on ubuntu 20.04

That’s it. You have successfully installed Joomla 4.0 on Ubuntu 20.04. For more information about how to manage your Joomla installation, please refer to the official Joomla documentation.


Of course, you don’t have to install Joomla 4.0 on Ubuntu 20.04, if you use one of our managed VPS hosting services, in which case you can simply ask our expert Linux admins to set up this 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 Joomla 4.0 on Ubuntu 20.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 Joomla 4.0 on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-joomla-4-0-on-ubuntu-20-04/feed/ 0
How to Install and Configure Docker Compose on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-and-configure-docker-compose-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-and-configure-docker-compose-on-ubuntu-20-04/#respond Sat, 30 Oct 2021 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1551 Docker Compose is a command-line tool for managing multiple Docker containers. It is a tool for building isolated containers through the YAML file to modify your application’s services. On the other hand, Ubuntu 20.04 feels more stable and easy to use, and as a result, users consider the operations running more smoothly, compared to some […]

The post How to Install and Configure Docker Compose on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
Docker Compose is a command-line tool for managing multiple Docker containers. It is a tool for building isolated containers through the YAML file to modify your application’s services.

how to install docker compose on ubuntu 20.04

On the other hand, Ubuntu 20.04 feels more stable and easy to use, and as a result, users consider the operations running more smoothly, compared to some previous versions. Still, some users have issues while installing certain apps and software. Such is the case with Docker Compose.

In the following tutorial, we will show you how to install Docker Compose on Ubuntu 20.04 server.

Prerequisites

  • A fresh Ubuntu 20.04 VPS.
  • Access to the root user account (or access to an admin account with root privileges)

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

First, log in to your Ubuntu 20.04 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address‘ and ‘Port_number‘ with your server’s respective IP address and SSH port number. Additionally, replace ‘root‘ with the username of the admin account if necessary.

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

apt-get update -y

Step 2: Install  docker-compose on your server

By default, Docker Compose is available in the Ubuntu 20.04 default repository. You can install it with the following command:

apt-get install docker-compose

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

docker-compose --version

You should get the following output:

docker-compose version 1.25.0, build unknown

This option will not guarantee that you downloading the latest docker-compose version.

On the GitHub repository, you will get the updates of Docker Compose, which might not be available on the standard Ubuntu repository. At the time of this writing this tutorial, the most current stable version is 1.29.2.

curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

This command saves the file in: /usr/local/bin directory, under the name docker-compose.

Next, you need to change the file permission, and making the downloaded file executable with the following command:

chmod +x /usr/local/bin/docker-compose

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

docker-compose --version

You should get the following output:

docker-compose version 1.29.2, build 5becea4c

Step 3: Test Docker Compose with Sample Container

Create a new directory for your sample container example:

mkdir test

Change directory that you just created:

cd test

From there, create a YAML configuration file:

nano docker-compose.yaml

And copy the following configuration into docker-compose.yaml file:

version: '3.3'
services:
   hello-world:
      image:
         hello-world:latest

Next, run the following command to pull the hello-world image on your system.

docker-compose up

The output should be similar to this:

Creating network "root_default" with the default driver
Pulling hello-world (hello-world:latest)...
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:9ade9cc2e26189a19c2e8854b9c8f1e14829b51c55a630ee675a5a9540ef6ccf
Status: Downloaded newer image for hello-world:latest
Creating root_hello-world_1 ... done
Attaching to root_hello-world_1
hello-world_1 |
hello-world_1 | Hello from Docker!
hello-world_1 | This message shows that your installation appears to be working correctly.
hello-world_1 |
hello-world_1 | To generate this message, Docker took the following steps:
hello-world_1 | 1. The Docker client contacted the Docker daemon.
hello-world_1 | 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
hello-world_1 | (amd64)
hello-world_1 | 3. The Docker daemon created a new container from that image which runs the
hello-world_1 | executable that produces the output you are currently reading.
hello-world_1 | 4. The Docker daemon streamed that output to the Docker client, which sent it
hello-world_1 | to your terminal.
hello-world_1 |
hello-world_1 | To try something more ambitious, you can run an Ubuntu container with:
hello-world_1 | $ docker run -it ubuntu bash
hello-world_1 |
hello-world_1 | Share images, automate workflows, and more with a free Docker ID:
hello-world_1 | https://hub.docker.com/
hello-world_1 |
hello-world_1 | For more examples and ideas, visit:
hello-world_1 | https://docs.docker.com/get-started/
hello-world_1 |
root_hello-world_1 exited with code 0

After downloading the image, Docker Compose creates a container and runs the hello-world program.

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
31b0b7a2e9f0 hello-world:latest "/hello" 17 minutes ago Exited (0) 17 minutes ago root_hello-world_1

In this tutorial, we learned how to install Docker Compose on your Ubuntu 20.04 server, as well as the basics of how to use it.

Of course, you don’t need to do any of this if your server is covered by our Managed Linux Support services in which case you can simply ask our expert Linux admins to install Docker Composer onto your Ubuntu 20.04 server for you. They are available 24×7 and will take care of your request immediately.

installing docker compose on ubuntu 20.04

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 in the comment section. Thanks.

The post How to Install and Configure Docker Compose on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-and-configure-docker-compose-on-ubuntu-20-04/feed/ 0
How to Install Python 3.9 on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-python-3-9-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-python-3-9-on-ubuntu-20-04/#comments Fri, 15 Oct 2021 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1545 In the following article, we’ll walk through the installation of your Python 3.9 version with two options. Installing it directly from the APT repository or building the Python 3.9 from the source. Python is one of the world’s most popular programming languages. It is a versatile language used to build all kinds of applications, from […]

The post How to Install Python 3.9 on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
In the following article, we’ll walk through the installation of your Python 3.9 version with two options. Installing it directly from the APT repository or building the Python 3.9 from the source. Python is one of the world’s most popular programming languages.

install python 3.9 on ubuntu 20.04

It is a versatile language used to build all kinds of applications, from simple scripts to complex machine learning algorithms. With its simple and easy-to-learn syntax, Python is a popular choice for beginners and experienced developers. Next, you will learn how to install Python 3.9 on Ubuntu 20.04 version, using a few simple steps to complete this process.

Installing Python 3.9 on Ubuntu 20.04 with Apt

Below we’ll show you how to install Python 3.9 using the apt cli from Python, we just need to follow the following steps.

1 – We’ll start with the apt update and installation of the prerequisites.

apt update -y
apt upgrade -y
apt install software-properties-common

2 – Once you finish the update and prerequisites installation, we need to add the deadsnakes PPA to our system’s sources list. The following command will do that:

add-apt-repository ppa:deadsnakes/ppa

When prompted, you need to press [Enter] in order to continue.

3- Then, you just need to install the python with this command, once the repository is successfully added.

apt install python3.9

4- Once installed, you can verify the version installed with:

python3.9 --version
Output
Python 3.9.7

That’s it, you successfully installed python3.9 on your server using APT

Installing Python 3.9 on Ubuntu 20.04 from Source

The benefit to install Python from the source is that it allows you to install the latest Python version and customize the build options. However, you will not be able to maintain your Python installation through the apt package manager. Since it was installed from the source.

Bellow, we’ll learn how to do that.

1- Update your server and be sure to install the necessary dependencies to build python:

apt update -y
apt upgrade -y
apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev -y

2- Download the latest release source code from the Python download page with wget installed on the last step. In this tutorial we are using the 3.9.7, the latest one today.

wget https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz

3- Now, we need to extract the python compressed file with the following command:

tar -xvf Python-3.9.7.tgz

4- We’ll start the build of our Python now, let’s enter the directory now and start the configure script.

cd Python-3.9.7/
./configure --enable-optimizations

The flag –enable-optimizations is optional. It will optimize the python binary, but the build process will be slower.

5 – Starting the build process with the make command:

make

6 – When the build process is complete, we’ll install the Python binaries by typing:

make altinstall

7- Once the binaries are installed, you can test your python version with the following command:

python3.9 --version
Output
Python 3.9.7

That’s it, you successfully installed Python 3.9 on your Ubuntu 20.04 server. You can now run your python scripts using the latest version available. We hope this tutorial on Python will help you, and don’t forget to leave a reply of appreciation below, in the comments section.

Alternatively, in case you are out of time and need to automate things, you can always subscribe to one of our managed Linux hosting plans and let a team of industry experts do it for you, 100% free of charge. Thanks!

The post How to Install Python 3.9 on Ubuntu 20.04 appeared first on LinuxHostSupport.

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

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

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

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

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

Let’s start with the installation on Debian 10!

 

Prerequisites

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

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

lsb_release -a

The out should be similar to this:

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

1. Updating the System

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

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

2. Install Java

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

sudo apt install default-jdk -y

Check the installed version with the following command:

java --version

The output should be similar to this:

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

3. Tomcat User Creation

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

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

4. Downloading and installing Tomcat 10

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

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

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

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

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

chown -R tomcat:tomcat /opt/tomcat/

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

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

5. Systemd Unit File for Tomcat

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

nano /etc/systemd/system/tomcat.service
[Unit]
Description="Tomcat Service"
After=network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment="JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64"
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom"
Environment="CATALINA_BASE=/opt/tomcat"
Environment="CATALINA_HOME=/opt/tomcat"
Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
[Install]
WantedBy=multi-user.target

Save the file, close it and start the service.

systemctl start tomcat
systemctl enable tomcat

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

systemctl status tomcat

The output will be similar to this:

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

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

http://YOUR_IP_ADDRESS:8080

6. Configuration of Tomcat

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

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

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

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

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

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

Comment out the following lines

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

Save the files close it and restart the tomcat service:

systemctl restart tomcat

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

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

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

]]>
https://linuxhostsupport.com/blog/how-to-install-apache-tomcat-10-on-debian-10/feed/ 0
How to Install Joomla 3.9 on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-joomla-3-9-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-joomla-3-9-on-ubuntu-20-04/#comments Wed, 15 Sep 2021 17:30:05 +0000 https://linuxhostsupport.com/blog/?p=1520 Joomla is a free and open-source content management system (CMS) built in PHP Joomla allows users to publish different kinds of websites, such as personal blogs, government applications, corporate intranets and extranets, small and large business websites, etc. In today’s article, we will guide you through the steps of installing the latest stable release of […]

The post How to Install Joomla 3.9 on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
Joomla is a free and open-source content management system (CMS) built in PHP Joomla allows users to publish different kinds of websites, such as personal blogs, government applications, corporate intranets and extranets, small and large business websites, etc. configure joomla 3.9 on ubuntu 20.04

In today’s article, we will guide you through the steps of installing the latest stable release of Joomla on an Ubuntu 20.04 VPS, with all necessary components, such as Apache web server, MySQL database server, and PHP.

Prerequisites

  • Ubuntu 20.04 VPS. We will use one of our SSD 2 VPS hosting plans.
  • system user with sudo privileges
  • MySQL database server version 5.1 or newer (5.5.3 + is recommended)
  • Apache web server version 2.0 or newer (2.4 + is recommended)
  • PHP version 5.3.10 or newer (7.3 + is recommended)

Login and Update the VPS

Open your favorite terminal application and log in to your Ubuntu 20.04 VPS via SSH

ssh root@IP_address -p Port_number

Don’t forget to replace user, IP_address, and Port_number with your server’s actual IP address and port number.

Once you are in, run the following command to make sure that all installed packages on the VPS are up to date

apt update && apt upgrade

Install Apache web server

The first component we will install on the VPS is the Apache web server. We need it to serve the website content to the visitors. We can easily install the web server by running the following command

apt -y install apache2

After the command completes, start the Apache web server and enable it to start automatically after a server reboot

systemctl start apache2
systemctl enable apache2

Confirm that the web server is running

systemctl status apache2

Output:

● apache2.service - The Apache HTTP Server
  Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Active: active (running)
  Docs: https://httpd.apache.org/docs/2.4/
  Main PID: 271961 (apache2)
  Tasks: 55 (limit: 4620)
  Memory: 5.7M
  CGroup: /system.slice/apache2.service
├─271961 /usr/sbin/apache2 -k start

Install PHP

Joomla is PHP based application and one of the requirements for its installation is PHP. Run the following command to install PHP 7.4 along with some other PHP dependencies

apt install php libapache2-mod-php php-mysql php-opcache php-xml php-gd php-mbstring php-curl php-xmlrpc php-intl php-soap php-zip

Wait for the installation process to complete and run the following command to check if the right version of PHP is installed

# php -v
PHP 7.4.3 (cli) (built: Jul 5 2021 15:13:35) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

From the output above we can confirm that PHP version 7.4.3 is properly installed on the Ubuntu 20.04 VPS.

Next, we will have to tweak some values in the PHP configuration file (php.ini). Open the PHP configuration file (/etc/php/7.4/apache2/php.ini) and modify the following values:

  • memory_limit – Minimum: 64M Recommended: 128M or higher
  • upload_max_filesize – Minimum: 30M
  • post_max_size – Minimum: 30M
  • max_execution_time: Recommended: 30

Save the php.ini file and restart the web server for the changes to take effect

sysemctl restart apache2

Install MySQL and create database

The Joomla installation requires a database to store data such as articles, users, menus, and categories. MySQL and PostgreSQL databases are supported, but in our example, we will use MySQL. Let’ proceed and install the MySQL database server

apt install -y mysql-server

Check the version of MySQL installed on our Ubuntu 20.04 VPS

mysql -V
mysql Ver 8.0.26-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))

Next, we will run the mysql_secure_installation post-installation script to improve the security of the MySQL server and set the MySQL root password

mysql_secure_installation

Set a strong password for the MySQL root user when prompted and proceed with the next steps. You can use the following options:

remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Next, log in to the MySQL server as user root

mysql -u root -p
mysql> CREATE DATABASE joomladb;
mysql> CREATE USER 'joomlauser'@'localhost' IDENTIFIED BY 'STRONG_PASSWORD';
mysql> GRANT ALL PRIVILEGES ON joomladb.* TO 'joomlauser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> exit

Replace STRONG_PASSWORD with an actual strong password.

Download Joomla

Download the latest stable release of Joomla from their website to your server. At the moment of writing this article, it is version 3.9.28.

wget https://downloads.joomla.org/cms/joomla3/3-9-28/Joomla_3-9-28-Stable-Full_Package.zip

Create a new directory for your Joomla website, inside the document root directory

mkdir /var/www/html/joomla

Unpack the downloaded ZIP package to the newly created directory

unzip Joomla_3-9-28-Stable-Full_Package.zip -d /var/www/html/joomla/

Change the ownership of the files inside the Joomla directory

chown -R www-data:www-data /var/www/html/joomla/

Create Apache virtual host

Next, in order to be able to access the Joomla website with a domain name, we will have to create an appropriate virtual host

vim /etc/apache2/sites-available/domain.com.conf

Enter the following content

<VirtualHost *:80>
    ServerName domain.com 
    ServerAdmin webmaster@domain.com 
    DocumentRoot /var/www/html/joomla
    <Directory /var/www/html/joomla>
         Allowoverride all
   </Directory>
</VirtualHost>

Where domain.com is your actual domain.

Disable the default Apache virtual host and enable the newly created one

a2dissite 000-default
a2ensite domain.com

Reload the web server for the changes to take effect

systemctl reload apache2

Complete Joomla Installation

Now that we have Joomla downloaded and all necessary components installed on our server, we can proceed and complete the Joomla installation using its web installation wizard. Open your favorite web browser, go to http://domain.com and Joomla’s web installation wizard will appear on your screen.

The first step of the installation is to enter the main details of your website such as the name of the website, website description, and create your superuser account

setting up joomla 3.9 on ubuntu 20.04

On the second step of the installation process, you will have to enter the information about the MySQL database we created in this tutorial. Enter the details as shown on the image below

set up joomla 3.9 on ubuntu 20.04

The final step of the installation is actually an overview of all information we entered about the Joomla installation and it includes an option for installing sample data. Once you confirm that everything is OK, click the install button and you will see the final, success page.

install joomla 3.9 on ubuntu 20.04

That’s all. The latest version of Joomla is successfully installed on your Ubuntu 20.04 website. You can check Joomla’s official documentation for more details on how to use and configure the application.


Of course, you don’t have to install Joomla 3.9 on Ubuntu 20.04 if you use one of our Joomla VPS hosting services, in which case you can simply ask our expert Linux admins to install Joomla on your Ubuntu 20.04 server, for you. They are available 24/7/365 and will take care of your request immediately. You can also consider reading our post on how to install Joomla 3.9 on Ubuntu 20.04. installing joomla 3.9 on ubuntu 20.04

PS. If you liked this post on how to install Joomla 3.9 on Ubuntu 20.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 Joomla 3.9 on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-joomla-3-9-on-ubuntu-20-04/feed/ 1
How to Install Neos CMS on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-neos-cms-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-neos-cms-on-ubuntu-20-04/#respond Mon, 30 Aug 2021 17:45:57 +0000 https://linuxhostsupport.com/blog/?p=1506 Neos CMS is an open-source and PHP-based content management system created by over 100+ contributors around the world. It is highly extensible and follows a content repository pattern. Neos CMS can be integrated with other modern front-end technologies using JSON or GraphQL export formats. With Neos CMS, you can create your blog and website without […]

The post How to Install Neos CMS on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
Neos CMS is an open-source and PHP-based content management system created by over 100+ contributors around the world. It is highly extensible and follows a content repository pattern. Neos CMS can be integrated with other modern front-end technologies using JSON or GraphQL export formats. With Neos CMS, you can create your blog and website without any programming knowledge.

This tutorial will explain how to install Neos CMS with Apache on Ubuntu 20.04.

Prerequisites

  • A fresh Ubuntu 20.04 VPS.
  • Access to the root user account (or access to an admin account with root privileges)

Log in to the Server & Update the Server OS Packages

First, log in to your Ubuntu 20.04 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address‘ and ‘Port_number‘ with your server’s respective IP address and SSH port number. Additionally, replace ‘root‘ with the username of the admin account if necessary.

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

apt-get update -y

Install Apache, MySQL and PHP

First, install the Apache web server and MySQL 8 on your server:

apt-get install apache2 mysql-server -y

After installing both packages, run the following command to install PHP with all required extensions:

apt-get install php7.4 libapache2-mod-php7.4 php7.4-common php7.4-mysql php7.4-gmp php7.4-curl php7.4-intl php7.4-mbstring php7.4-xmlrpc php7.4-gd php7.4-bcmath php7.4-xml php7.4-cli php7.4-gmagick php7.4-zip curl unzip git -y

Once all the packages are installed the start the Apache and MySQL service with the following command:

systemctl start apache2
systemctl start mysql

Create MySQL Database and User

Neos CMS uses MySQL or MariaDB as a database backend. So you will need to create a user and database for Neos CMS.

First, connect to the MySQL with the following command:

mysql

Next, create a database and user with the following command:

mysql> CREATE DATABASE neos CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> CREATE USER 'neos'@'localhost' IDENTIFIED BY 'securepassword';

Next, grant all the privileges on neos database with the following command:

mysql> GRANT ALL PRIVILEGES ON neos.* TO 'neos'@'localhost';

Next, flush the privileges and exit from the MySQL shell using the following command:

mysql> FLUSH PRIVILEGES;
mysql> EXIT;

Install Neos CMS

Before starting, you will need to install the Composer to your server. Run the following command to install Composer:

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

Next, change the directory to Apache webroot and download the Neos CMS using the Composer:

cd /var/www/html/
composer create-project --no-dev neos/neos-base-distribution neoscms

Next, install the required module and update the Composer with the following command:

composer require guzzlehttp/psr7 "^1.8.2"
composer update

Next, set proper permission and ownership to the neoscms directory:

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

Configure Apache for Neos CMS

Next, create an Apache virtual host configuration file for Neos CMS:

nano /etc/apache2/sites-available/neoscms.conf

Add the following lines:

<VirtualHost *:80>
     ServerAdmin admin@yourdomain.com
     DocumentRoot /var/www/html/neoscms/Web
     ServerName neos.yourdomain.com
     <Directory /var/www/html/neoscms/Web/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/neos_error.log
     CustomLog ${APACHE_LOG_DIR}/neos_access.log combined

     <Directory /var/www/html/neoscms/Web/>
            RewriteEngine on
            RewriteBase /
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*) index.php [PT,L]
    </Directory>
</VirtualHost>

Save the file when you are done. Then, enable the Apache virtual host and rewrite module with the following command:

a2ensite neoscms.conf
a2enmod rewrite

Next, reload the Apache service to apply the configuration changes:

systemctl restart apache2

Access Neos CMS Installation Wizard

Now, you can access the Neos CMS web installation wizard using the URL http://neos.yourdomain.com as shown below:

install neos cms on ubuntu 20.04

Click on Go to setup button. You will be asked to provide a setup password as shown below:

installing neos cms on ubuntu 20.04

Type the password from the SetupPassword.txt file and click on the Login button. You should see the requirements check page:

set up neos cms on ubuntu 20.04

Click on the Next button. You should see the database configuration page:

configure neos cms on ubuntu 20.04

Provide your database details and click on the Next button. You should see the administrator account setup page:

installation of neos cms on ubuntu 20.04

Provide your admin username, password and click on the Next button. You should see the site configuration page:

guide on installing neos cms on ubuntu 20.04

Provide your Sitename and click on the Next button. Once the installation is completed, you should see the following page:

tutorial on installing neos cms on ubuntu 20.04

Click on the go to the backend. You should see the Neos CMS login page:

how do you install neos cms on ubuntu 20.04

Provide your admin username, password and click on the Login button. You will be redirected to the Neos CMS dashboard:

neos cms ubuntu 20.04

Of course, you don’t need to do any of this if your server is covered by our Managed Linux Support services in which case you can simply ask our expert Linux admins to install Neos CMS onto your Ubuntu 20.04 server for you. They are available 24×7 and will take care of 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 in the comment section. Thanks

 

 

 

The post How to Install Neos CMS on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-neos-cms-on-ubuntu-20-04/feed/ 0
How To Fix “502 Bad Gateway” Error In Nginx https://linuxhostsupport.com/blog/how-to-fix-502-bad-gateway-error-in-nginx/ https://linuxhostsupport.com/blog/how-to-fix-502-bad-gateway-error-in-nginx/#respond Sun, 15 Aug 2021 17:30:30 +0000 https://linuxhostsupport.com/blog/?p=1494 The 502 Bad Gateway error is an HTTP status code that means that one server received an invalid response from another server. In more technical words, A 502 Bad Gateway means that the proxy (gateway) server wasn’t able to get a valid or any response from the upstream server. If you are seeing a 502 […]

The post How To Fix “502 Bad Gateway” Error In Nginx appeared first on LinuxHostSupport.

]]>
The 502 Bad Gateway error is an HTTP status code that means that one server received an invalid response from another server. In more technical words, A 502 Bad Gateway means that the proxy (gateway) server wasn’t able to get a valid or any response from the upstream server.

fixing 502 bad gateway error in nginx

If you are seeing a 502 bad gateway error on a website, it means that the origin server sent out an invalid response to another server that acted as a gateway or proxy. It can be a tricky investigation to locate what and where is the process which caused the issue. However, there are some general troubleshooting steps that you can follow to get it solved.

For example, if you use Nginx as the webserver and you encounter this issue, it could be that Nginx is unable to communicate with the upstream server, this upstream server could be PHP-FPM or other application that you want to access through Nginx, like Odoo, NodeJS, etc.

How to Fix 502 Gateway Error in Nginx

First, you need to investigate your Nginx server block and check what the upstream server is.

For example, we have a WordPress website at blog.yourdomain.com, and this is the Nginx server block configuration.

how to repair 502 bad gateway error in nginx

According to the configuration, as shown in the picture above, the website’s PHP files are processed by fastcgi running on port 9000.

To check what is running on port 9000, we can issue this shell command:

$ sudo netstat -pltn | grep 9000

or

$ sudo lsof -i :9000

If a process is running on port 9000, you should see something like this after invoking the shell command.

repairing 502 bad gateway error in nginx

If the shell command does not print anything on the screen, then the process is dead. This is why you see the 502 bad gateway error when accessing your WordPress website.

The next step is to find what pservice should run on port 9000, you can run this command:

$ sudo grep -rl 9000 /etc
removing 502 bad gateway error in nginx

As we can see in the picture, it seems that php-fpm7.2 should run to process the PHP files.

In the latest CentOS and Ubuntu, you can invoke this command to see where the process should be run from:

$ sudo systemctl list-unit-files | grep fpm

or

$ sudo systemctl -l | grep -i fpm
how to remove 502 bad gateway error in nginx

If the process is stopped, this is most likely because your server has run out of memory, although you can try to restart it by running this command:

$ sudo systemctl start php7.2-fpm

But, if you see that php-fpm process is running, it means php-fpm could not respond in time and Nginx is unable to communicate with it, hence the issue.

To solve this php-fpm issue, we can tweak Nginx and PHP-FPM configurations.

Increase the timeouts and buffers between NGINX and PHP-FPM.

Increasing the buffers and timeouts gives NGINX / PHP-FPM space to work, particularly if you have any heavy PHP scripts. In the HTTP or location block of your NGINX site configuration, add the following to increase buffers and timeouts:

location {
…
   fastcgi_buffers 8 16k;
   fastcgi_buffer_size 32k;
   fastcgi_connect_timeout 60;
   fastcgi_send_timeout 300;
   fastcgi_read_timeout 300;
}

Change PHP-FPM configuration

PHP-FPM can be configured to listen on a file or tcp/ip as a socket. If you configure php-fpm to listen on tcp/ip as a socket, you would want to switch to a file because theoretically the file saved on a disk could be accessed faster.

To do this, in your PHP-FPM configuration file, you need to change the following: listen = 127.0.0.1:9000

to this: listen = /var/run/php7.2-fpm.sock

You can choose whatever the socket name is, just remember and make sure your Nginx is configured to connect to the socket file

After making the changes, you need to adjust your Nginx server block as well. In your Nginx server block, change this line

fastcgi_pass 127.0.0.1:9000; to fastcgi_pass unix:/var/run/php7.2-fpm.sock;

Then, check your Nginx configuration with nginx -t and reload both Nginx and php-fpm services.

$ sudo systemctl reload nginx
$ sudo systemctl reload php7.2-fpm

If the PHP-FPM processes are running but you are seeing the 502 error message, then you would need to tine tune your PHP-FPM’s process management to utilize the available memory on the server properly.

There are three process manager options you can choose from.

static – a fixed number of child processes, i.e the value of pm.max_children dynamic – the number of child processes are set dynamically ondemand – children will be forked when new requests will connect

By default, the dynamic process manager is activated, if you use this process manager and see a similar message below in the PHP-FPM log:

WARNING: [pool nnnnn] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 64 children, there are 8 idle, and 79 total children

then this can trigger the 502 error message on your site, you need to adjust the pm.start_servers, or pm.min/max_spare_servers values to get this fixed. Or, use ‘ondemand’ instead of ‘dynamic’. The ‘ondemand’ will be more efficient, although you need to calculate them based on your server’s amount of RAM, how much a PHP-FPM process consumes memory, etc.

With ‘static’ as the process manager, you will keep everything sitting in memory, traffic spikes will only cause fewer spikes to your CPU, this will make your CPU average lower, but RAM usage may be higher.

If your website is using another application and connected to Nginx as the reverse proxy and you see the 502 error message, most likely the application behind Nginx is down.

fix nginx 502 bad gateway error

The picture above tells us that Nginx is connected to an Odoo instance on port 8069. We can check whether Odoo is running or not, by running the netstat command as mentioned earlier in this blogpost.

$ sudo netstat -pltn | grep 8069

or

$ sudo lsof -i :8069

If none of the above commands print anything, then it means Odoo is down. You need to check the service name and then start it.

$ sudo systemctl -l | grep -i odoo
$ sudo systemctl start odoo

To further investigate why Odoo or PHP-FPM is down, we can run this command:

$ sudo dmesg -T | egrep -i 'killed process'

It might print something like this:

[Tue Jul 13 22:59:47 2021] Out of memory in UB 1644: OOM killed process 27128 (phyton3) score 0 vm:6107440kB, rss:113576kB, swap:0kB

It means your server is running out of memory, you would need to tweak your Odoo configuration. You can check one of our Odoo related posts at How to Speed up Odoo – RoseHosting or contact our support team if you have a server with us.


Of course, you don’t need to get troubled with your server if you have a managed VPS hosting with us – in which case, our technical support team will help you investigate and solve this 502 Bad Gateway issue immediately. They are available 24/7 and can cater to any questions or requests.

PS. If you liked this post, feel free to share it with your friends by using the social media share shortcuts below, or simply leave a comment. Thanks.

The post How To Fix “502 Bad Gateway” Error In Nginx appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-fix-502-bad-gateway-error-in-nginx/feed/ 0
SSH Tunnel using Putty and Firefox https://linuxhostsupport.com/blog/ssh-tunnel-using-putty-and-firefox/ https://linuxhostsupport.com/blog/ssh-tunnel-using-putty-and-firefox/#respond Fri, 30 Jul 2021 17:45:12 +0000 https://linuxhostsupport.com/blog/?p=1462 In this tutorial, we will show you how to create an SSH Tunnel using Putty and Firefox. SSH tunnel is an encrypted tunnel created through an SSH protocol. SSH Tunnel will be used to transfer unencrypted data over a network through an encrypted channel. If your service provider or some organization has blocked certain sites […]

The post SSH Tunnel using Putty and Firefox appeared first on LinuxHostSupport.

]]>
ssh tunnel with putty and firefoxIn this tutorial, we will show you how to create an SSH Tunnel using Putty and Firefox. SSH tunnel is an encrypted tunnel created through an SSH protocol. SSH Tunnel will be used to transfer unencrypted data over a network through an encrypted channel. If your service provider or some organization has blocked certain sites using their proxy filter you can bypass them with a SOCKS 5 proxy tunnel. In general, SOCKS is a protocol that establishes a TCP connection and exchanges network packets between a client and a server through a proxy server. If you can connect to an external SSH server, you can create an SSH tunnel to forward a port on your local machine to a port in the other machine which will be the other end of the tunnel.

There are several ways to set up an SSH tunnel with different types of port forwarding. There are three types of port forwarding:

  •  Local port forwarding – With local port forwarding we can forward a port from our local machine to the server machine. The SSH client will listen for connections on a configured port and when it receives a connection it will create a tunnel to the SSH server.
  • Remote port forwarding – Remote port forwarding works opposite from the local port forwarding. It will forward the traffic coming to a port on our server to our local computer machine and it will send back to a destination.
  • Dynamic port forwarding – Dynamic port forwarding is a complex method of creating an SSH Tunnel, traversing a firewall or NAT through the use of a firewall. Communication can be established across a range of ports.

In this tutorial, we will create an SSH Tunnel using Putty and Firefox with Local port forwarding.

This setup is also useful if you are browsing the Internet via an unsecured network and you want to make your connection secure.

Pre-Requisites:

To complete this tutorial, we will have to download two pieces of software Putty and Firefox Web Browser on our local machine:

  • Putty SSH Client (download)
  • Firefox Web Browser (download)
  • Linux-based virtual server with full SSH root access or a user with sudo privileges.

Putty Configuration

1. We need first to open Putty, then in the Session section, we need to add the Hostname(or IP address) of our server, and also SSH port is required.

ssh tunnel putty and firefox2. On the left side we need to click on SSH, then choose Tunnels, add the source port number between 1025-65536. In this tutorial we have used port (4433) and make sure “Dynamic” and “Auto” are selected and click the ‘Add‘ button.

ssh tunnel using firefox and putty
3. Click on Session, we will add a name under Saved Sessions “Putty-Tunnel” and click on the Save button. Now we need to click on the Open button and make the connection. Once the connection is open we need to enter the sudo username and password to log in.

ssh tunnel with firefox and putty
After a successful login, please note that you should not close the SSH connection.

Firefox Configuration

Now that we have SSH tunnel, we need to configure Firefox Web Browser to use that tunnel. To work the configuration in Firefox with the SOCKS 5 protocol we have to use a local application.

First, we have to open the Firefox Web Browser and access Firefox’s menu:
ssh tunneling with putty and firefox

We need to click on the Options icon. Find the Network Settings and click on the Settings button.

ssh proxy tunnel with putty and firefox

We will be prompted with a new window where we will configure the proxy configuration. We need to select the radio button for Manual proxy configuration. In the SOCKS Host field, we will enter localhost and in the Port field, we will enter the same port from our SSH connection.

ssh proxy tunnel with firefox and putty

We need to click the OK button to save and close the configuration.

Final steps

Now, we have successfully created an SSH Tunnel using Putty and Firefox. We can open a new tab and start with browsing the Internet via secured network. To test if everything is set up correctly we can visit a site like http://icanhazip.com/ or enter in the google search bar “whats my ip” and you should see your remote IP Address.


Of course, you don’t have to configure SSH Tunnel using Putty and Firefox, if you use one of our Server Management Services, in which case you can simply ask our expert Linux admins to configure SSH Tunnel on Linux for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on how to configure SSH Tunnel using Putty and Firefox on Linux, 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 SSH Tunnel using Putty and Firefox appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/ssh-tunnel-using-putty-and-firefox/feed/ 0
How To Speed Up a Website on Debian 9 https://linuxhostsupport.com/blog/how-to-speed-up-a-website-on-debian-9/ https://linuxhostsupport.com/blog/how-to-speed-up-a-website-on-debian-9/#respond Thu, 15 Jul 2021 17:30:26 +0000 https://linuxhostsupport.com/blog/?p=1414 Speeding up a website is a very important process because most of the visitors will leave a slow website and visit a competitor’s website instead of suffering a delay. Also, they would not return to a website with poor loading speed. A faster page load speed gives visitors a better user experience. The impact of […]

The post How To Speed Up a Website on Debian 9 appeared first on LinuxHostSupport.

]]>
speed up website debian 9Speeding up a website is a very important process because most of the visitors will leave a slow website and visit a competitor’s website instead of suffering a delay. Also, they would not return to a website with poor loading speed. A faster page load speed gives visitors a better user experience. The impact of website speed is huge on search engine rankings too. If you strive to achieve good rankings on search engines, make sure to optimize your website for speed. Before we start working on improving the website speed, it is a good idea to know what is an acceptable web page speed. In general, the best practice is around three seconds.

There are many different steps we can take to increase website speed and improve user experience. In this guide, we will show you how to speed up a website on a Debian 9 VPS.

Listed below are the most efficient ways to increase the website speed:

Enable GZIP compression

Enabling website compression allows the web page to load faster, so if you have Apache2 installed and running on your Debian VPS, enable Gzip module (mod_deflate) using the following command:

sudo a2enmod deflate

Restart the Apache service for the changes to take effect:

service apache2 restart

Create a .htaccess file in the document root directory of your website (or modify it if it exists) and add the following code in it:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>

Enable Expires Header to static resources

When visiting a website, the website will cache in the visitor’s web browser. Adding Expires headers to static resources is useful because it reduces the web page loading speed for subsequent page views/return visits from returning visitors. In order to enable Expires headers to static resources, we need to add the following code in the .htaccess file:

ExpiresActive On
ExpiresDefault A0
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000

Where A2592000 means 1 month.

Use a Content Delivery Network (CDN)

Using a CDN is a great way to achieve a better user experience and reduce the load speed of a website. When using a CDN, the website files are cached on many servers in different locations of the world and whenever a visitor accesses your website, the requests to your website are served from a nearby server.

Use advanced caching mechanisms

Use a caching mechanism that works efficiently to optimize your website for speed. By enabling a caching mechanism, we can reduce the time it takes for repeat visitors to load the website. Depending on the website content (static, dynamic, and/or database-driven), we can install and use Varnish, Redis, Memcached, etc. All caching mechanisms allow web applications to store data and recall it from memory very fast. Also, if you use a CMS on your website, try to install a caching plugin/extension.

Minify JavaScript and CSS files

Minify all JavaScript files over 4 KB of size.

Remove all unused CSS code. Minify the CSS code by stripping out unnecessary characters and spaces thus reduce its file size.

Load the CSS code inside the <head> element, and JavaScript code inside the <body>, usually to the bottom of your web pages.

Optimize Images

Larger images take longer to download than smaller ones. Try to use smaller images, and keep the number of images to an absolute minimum. Use images in an appropriate format. such as JPG, SVG, PNG, and GIF format.

Optimize the database

To optimize the website loading time, it is important to optimize the MySQL database used by your website too.

If you use a MySQL database on your website, use the following command to optimize it:

mysqlcheck -u<db_user> -p -o <db_name>

Replace <db_user> with the actual MySQL username and <db_name> with your MySQL database name respectively.

Remove Unnecessary Plugins and Add-ons

speed up website debian 9If you use a CMS on your website, try to delete all unused themes, extensions, plugins, add-ons, etc. Of course, you don’t have to speed up your website on Debian 9, if you use one of our Linux server management services, in which case you can simply ask our expert Linux admins to help you speed up and optimize your website for you. They are available 24×7 and will take care of your request immediately.

If you liked this post, on how to speed up your website on Debian 9, please share it with your friends on the social networks using the buttons below or simply leave a reply in the comments section.

The post How To Speed Up a Website on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-speed-up-a-website-on-debian-9/feed/ 0
How to Install Asterisk on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-asterisk-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-asterisk-on-ubuntu-20-04/#comments Wed, 30 Jun 2021 17:30:40 +0000 https://linuxhostsupport.com/blog/?p=1429 Asterisk is an open-source framework used for building communications applications including VoIP gateways, and conference servers. It is used by small businesses, enterprises, call centers, and governments worldwide. Asterisk uses a VoIP protocol that allows you to make a call using the TCP/IP without any cost. It provides very useful features including, voicemail, call recording, […]

The post How to Install Asterisk on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
Asterisk is an open-source framework used for building communications applications including VoIP gateways, and conference servers. It is used by small businesses, enterprises, call centers, and governments worldwide. Asterisk uses a VoIP protocol that allows you to make a call using the TCP/IP without any cost. It provides very useful features including, voicemail, call recording, automatic call, music on hold, messaging, and more.install asterisk on ubuntu 20.04

Asterisk can run on multiple operating systems, although it was originally created for Linux. Today, NetBSD, macOS, and Solaris users, among others, can install and use the Asterisk software with ease.

In this guide, we will show you how to install and configure Asterisk on Ubuntu 20.04.

Prerequisites

  • An Ubuntu 20.04 VPS (we’ll be using our SSD 2 VPS plan)
  • Access to the root user account (or access to an admin account with root privileges)

Log in to the Server & Update the Server OS Packages

First, log in to your Ubuntu 20.04 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.

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

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

Install Required Dependencies

Before starting, you will need to install some dependencies required to build the Asterisk server. You can install all of them using the following command:

apt-get install build-essential git autoconf wget subversion pkg-config libjansson-dev libxml2-dev uuid-dev libsqlite3-dev libtool -y

Once all the packages are installed, you will need to install DAHDI to communicate Asterisk with analog and digital telephones.

First, download the latest version of DAHDI to the /opt directory:

cd /opt
git clone -b next git://git.asterisk.org/dahdi/linux dahdi-linux

Next, change the directory to the downloaded directory and compile it using the following command:

cd dahdi-linux
make
make install

Next, download the DAHDI tools with the following command:

cd /opt
git clone -b next git://git.asterisk.org/dahdi/tools dahdi-tools

Once the download is completed, configure and install it with the following command:

cd dahdi-tools
autoreconf -i
./configure
make install
make install-config
dahdi_genconf modules

Next, download the LibPRI to communicate Asterisk with ISDN connections.

git clone https://gerrit.asterisk.org/libpri libpri
cd libpri

Next, install it using the following command:

make
make install

Once all the necessary tools are installed, you can proceed to install Asterisk.

Install Asterisk

By default, the Asterisk package is not included in the Ubuntu 20.04 default repository. So you will need to download and compile it from the source. You can download it from the Git Hub using the following command:

git clone -b 18 https://gerrit.asterisk.org/asterisk asterisk-18

Once the download is completed, change the directory to the downloaded directory and install required dependencies with the following command:

cd asterisk-18/
contrib/scripts/get_mp3_source.sh
contrib/scripts/install_prereq install

Next, configure the Asterisk with the following command:

./configure

You should get the following output:

configure: Menuselect build configuration successfully completed

               .$$$$$$$$$$$$$$$=..      
            .$7$7..          .7$$7:.    
          .$$:.                 ,$7.7   
        .$7.     7$$$$           .$$77  
     ..$$.       $$$$$            .$$$7 
    ..7$   .?.   $$$$$   .?.       7$$$.
   $.$.   .$$$7. $$$$7 .7$$$.      .$$$.
 .777.   .$$$$$$77$$$77$$$$$7.      $$$,
 $$$~      .7$$$$$$$$$$$$$7.       .$$$.
.$$7          .7$$$$$$$7:          ?$$$.
$$$          ?7$$$$$$$$$$I        .$$$7 
$$$       .7$$$$$$$$$$$$$$$$      :$$$. 
$$$       $$$$$$7$$$$$$$$$$$$    .$$$.  
$$$        $$$   7$$$7  .$$$    .$$$.   
$$$$             $$$$7         .$$$.    
7$$$7            7$$$$        7$$$      
 $$$$$                        $$$       
  $$$$7.                       $$  (TM)     
   $$$$$$$.           .7$$$$$$  $$      
     $$$$$$$$$$$$7$$$$$$$$$.$$$$$$      
       $$$$$$$$$$$$$$$$.                

configure: Package configured for: 
configure: OS type  : linux-gnu
configure: Host CPU : x86_64
configure: build-cpu:vendor:os: x86_64 : pc : linux-gnu :
configure: host-cpu:vendor:os: x86_64 : pc : linux-gnu :

Next, you will need to select the modules that you want to install with Asterisk. You can select it using the following command:

make menuselect

You can use the Arrow key to navigate and Enter key to select the modules.

Select and enables the Addons as shown below: how to install asterisk on ubuntu 20.04

Next, enable the Core sound modules: set up asterisk on ubuntu 20.04 Next, enable the additional MOH packages: how to set up asterisk on ubuntu 20.04 Next, enable the Extra Sound Packages: setting up asterisk on ubuntu 20.04

Now, click on the Save and Exit button.

Next, build the Asterisk using the following command:

make -j2

Next, Asterisk and its modules using the following command:

make install

You should get the following output:

 +---- Asterisk Installation Complete -------+
 +                                           +
 +    YOU MUST READ THE SECURITY DOCUMENT    +
 +                                           +
 + Asterisk has successfully been installed. +
 + If you would like to install the sample   +
 + configuration files (overwriting any      +
 + existing config files), run:              +
 +                                           +
 + For generic reference documentation:      +
 +    make samples                           +
 +                                           +
 + For a sample basic PBX:                   +
 +    make basic-pbx                         +
 +                                           +
 +                                           +
 +-----------------  or ---------------------+
 +                                           +
 + You can go ahead and install the asterisk +
 + program documentation now or later run:   +
 +                                           +
 +               make progdocs               +
 +                                           +
 + **Note** This requires that you have      +
 + doxygen installed on your local system    +
 +-------------------------------------------+

You can also install the documentation and basic PBX config files with the following command:

make samples
make basic-pbx

Next, install the Asterisk init script with the following command:

make config

Next, update the shared libraries using the following command:

ldconfig

Create Asterisk User

It is always recommended to run Asterisk as a standalone user for security reasons.

First, create a new Asterisk user with the following command:

adduser --system --group --home /var/lib/asterisk --no-create-home --gecos "Asterisk PBX" asterisk

Next, edit the Asterisk default configuration file and configure it to run as a asterisk user:

nano /etc/default/asterisk

Uncomment the following lines:

AST_USER="asterisk"
AST_GROUP="asterisk"

Save and close the file then add the asterisk user to dialout and audio group:

usermod -a -G dialout,audio asterisk

Next, set proper ownership and permissions of all Asterisk files and directories with the following command:

chown -R asterisk: /var/{lib,log,run,spool}/asterisk /usr/lib/asterisk /etc/asterisk
chmod -R 750 /var/{lib,log,run,spool}/asterisk /usr/lib/asterisk /etc/asterisk

Start and Verify Asterisk

At this point, Asterisk is installed and configured. Now, you can start the Asterisk service using the following command:

systemctl start asterisk

You can also enable the Asterisk service to start at system reboot with the following command:

systemctl enable asterisk

To check the status of the Asterisk service, run the following command:

systemctl status asterisk

You should get the following output:

● asterisk.service - LSB: Asterisk PBX
     Loaded: loaded (/etc/init.d/asterisk; generated)
     Active: active (running) since Sun 2021-05-16 12:24:29 UTC; 13s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 60668 ExecStart=/etc/init.d/asterisk start (code=exited, status=0/SUCCESS)
      Tasks: 46 (limit: 4691)
     Memory: 34.7M
     CGroup: /system.slice/asterisk.service
             └─60685 /usr/sbin/asterisk -U asterisk -G asterisk

May 16 12:24:29 ubuntu2004 systemd[1]: Starting LSB: Asterisk PBX...
May 16 12:24:29 ubuntu2004 asterisk[60668]:  * Starting Asterisk PBX: asterisk
May 16 12:24:29 ubuntu2004 asterisk[60668]:    ...done.
May 16 12:24:29 ubuntu2004 systemd[1]: Started LSB: Asterisk PBX.

Now, connect to the Asterisk command line utility with the following command:

asterisk -vvvr

Once connected, you should get the following output:

Asterisk GIT-18-78d7862463, Copyright (C) 1999 - 2021, Sangoma Technologies Corporation and others.
Created by Mark Spencer 
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk GIT-18-78d7862463 currently running on ubuntu2004 (pid = 60685)
ubuntu2004*CLI> 

Congratulations! You have successfully installed and configured Asterisk server on Ubuntu 20.04 VPS.

Of course, you don’t have to install and set up Asterisk if you use one of our Managed VPS Hosting services, in which case you can simply ask our expert Linux admins to install Asterisk on Ubuntu 20.04, for you. They are available 24×7 and will take care of your request immediately. If you’re looking to find something else, such as how to install Magento or Elasticsearch on Ubuntu 20.04, check out our blog.

install asterisk on ubuntu 20.04

If you liked this post on how to install Asterisk on Ubuntu 20.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 Asterisk on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-asterisk-on-ubuntu-20-04/feed/ 9
How To Create a New User and Grant Permissions in MySQL https://linuxhostsupport.com/blog/how-to-create-a-new-user-and-grant-permissions-in-mysql/ https://linuxhostsupport.com/blog/how-to-create-a-new-user-and-grant-permissions-in-mysql/#comments Tue, 15 Jun 2021 17:30:48 +0000 https://linuxhostsupport.com/blog/?p=1447 MySQL is one of the most popular and open-source relational database management systems around the world. It provides a lot of management options like creating and managing a user with specific permissions to databases and tables. When you hire a new developer to manage MySQL databases then you may need to grant specific permission to […]

The post How To Create a New User and Grant Permissions in MySQL appeared first on LinuxHostSupport.

]]>
MySQL is one of the most popular and open-source relational database management systems around the world. It provides a lot of management options like creating and managing a user with specific permissions to databases and tables.

how to create a new user and grant permissions in mysql

When you hire a new developer to manage MySQL databases then you may need to grant specific permission to manage those databases such as deleting or modifying the information. In that case, it is essential for your to know how to grant specific privileges to the MySQL user account.

In this post, we will show you how to create a MySQL user and grant specific permissions

Prerequisites

  • A Linux VPS with MySQL server installed.
  • Access to the root user account (or access to an admin account with root privileges)

Log in to the Server & Update the Server OS Packages

First, log in to your Debian 10 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.

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

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

Create a New MySQL User

First, you will need to connect to the MySQL shell using the MySQL root user. You can connect it using the following command:

mysql -u root -p

You will be asked to provide your MySQL root password. Once you are connected to the MySQL shell, you should see the following output:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.25-0ubuntu0.20.04.1 (Ubuntu)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

Now, create a new MySQL user with the following command:

mysql> CREATE USER 'username'@'localhost' IDENTIFIED BY 'userpassword';

Where:

  • username is the name of the MySQL user you want to create.
  • userpassword is the password of the MySQL user.
  • localhost is a host from where you want to connect to MySQL.

You will need to replace the localhost with the remote server IP address if you want to connect the MySQL from the remote server. In that case, you can create a new MySQL user with the following command:

mysql> CREATE USER 'username'@'192.168.0.100' IDENTIFIED BY 'userpassword';
  • 192.168.0.100 is the IP address of the remote server.

Grant Privileges to a MySQL User Account

There are multiple types of permissions available in MySQL that you can provide to the MySQL user account. Some of the most commonly used permissions are shown below:

  • ALL PRIVILEGES: – This will allow MySQL users to run any query on the specified database.
  • CREATE: – This will allow MySQL users to create databases and tables.
  • DELETE: – This will allow MySQL users to delete rows from the table.
  • DROP: – This will allow MySQL users to drop databases and tables.
  • INSERT: – This will allow MySQL users to insert rows to a specific table.
  • SELECT: – This will allow MySQL users to read a database.
  • UPDATE: – This will allow MySQL users to update table rows.
  • GRANT OPTION: – This will allow MySQL users to grant or remove other users’ privileges.

To grant all privileges to the MySQL user account on a specific database, run the following command:

mysql> GRANT ALL PRIVILEGES ON dbname.* TO 'username'@'localhost';

To grant all privileges to the MySQL user on a specific table from a database, run the following command:

mysql> GRANT ALL PRIVILEGES ON dbname.tablename TO 'username'@'localhost';

To grant multiple privileges like, SELECT, INSERT, DELETE to the MySQL user on a specific database, run the following command:

mysql> GRANT SELECT, INSERT, DELETE ON dbname.* TO username@'localhost';

You will need to run the flush privileges command for the changes to take effect.

mysql> FLUSH PRIVILEGES;

View MySQL User Account Privileges

If you want to view the privileges assigned to the MySQL user account, run the following command:

mysql> SHOW GRANTS FOR 'username'@'localhost';

You should see the following output:

+--------------------------------------------------------------+
| Grants for username@localhost                                |
+--------------------------------------------------------------+
| GRANT USAGE ON *.* TO `username`@`localhost`                 |
| GRANT ALL PRIVILEGES ON `dbname`.* TO `username`@`localhost` |
+--------------------------------------------------------------+
2 rows in set (0.00 sec)

Remove MySQL User Account Privileges

You can use the REVOKE command to remove the permission of the MySQL user from the specific database or table.

For example, to remove ALL PRIVILEGES from the database, run the following command:

mysql> REVOKE ALL ON *.* FROM 'username'@'localhost';

Next, you will need to run the flush privileges command for the changes to take effect.

mysql> FLUSH PRIVILEGES;

Of course, you don’t have to manage MySQL server if you use one of our Managed Hosting services, in which case you can simply ask our expert Linux admins to manage the MySQL server for you. They are available 24/7 and will take care of your request immediately.

how to create a new user and grant permissions in mysql

If you liked this post on How to Create a New User and Grant Privileges in MySQL, 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 Create a New User and Grant Permissions in MySQL appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-create-a-new-user-and-grant-permissions-in-mysql/feed/ 1
How to Install Thelia on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-thelia-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-thelia-on-ubuntu-18-04/#respond Fri, 28 May 2021 12:24:34 +0000 https://linuxhostsupport.com/blog/?p=1407 We will show you how to install Thelia 2 on Ubuntu 18.04 using Apache web-server and a MySQL database. Thelia is an open-source tool for creating e-business websites and managing online content. It is written in PHP and it is published under a free license. Developed in accordance to web development standards and based on […]

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

]]>
We will show you how to install Thelia 2 on Ubuntu 18.04 using Apache web-server and a MySQL database. Thelia is an open-source tool for creating e-business websites and managing online content. It is written in PHP and it is published under a free license. Developed in accordance to web development standards and based on Symfony 2, Thelia meets the following objectives: performance and scalability. It is fairly easy to install Thelia 2 on an Ubuntu 18.04 VPS. The installation process should take about 10 minutes if you follow the very easy steps described below.

Requirements

At the time of writing this tutorial, the latest stable version of Thelia is 2.3.4 and it requires:

  • PHP 5.5 or greater (preferably PHP 7.1), with openssl, GD, DOM, cURL, calendar, PDO_MySQL, and intl PHP extensions enabled. The memory_limit value set in PHP should be at least 128 megabytes, preferably 256 megabytes. Safe_mode should be disabled, and the date.timezone value in PHP should be set, so it can be used by all date/time functions in Thelia;
  • MySQL 5.6 or greater, or MariaDB installed on the Ubuntu server;
  • Apache web server 2.0 or higher compiled with mod_rewrite module. Alternatively, we can use Nginx as a web server.

Log in to the server update your server OS Packages

Log in to your Ubuntu 18.04 VPS with SSH as the root user:

ssh root@IP_Address -p Port_number

Before we can start with the Thelia installation, we have to make sure that all Ubuntu OS packages installed on the server are up to date. We can do this by running the following commands:

sudo apt-get update
sudo apt-get upgrade

Install Apache web server

Check whether Apache is already installed and running on your server:

ps aux | grep apache2

We can also check if there are Apache2 packages installed on the server:

dpkg -l | grep apache2

If Apache is already installed on the server, we can skip the Apache installation steps and proceed with PHP installation.
If Apache is not installed, we can install it using:

apt-get install apache2

Once installed, start the Apache server and enable it to start on server boot:

systemctl start apache2
systemctl enable apache2

Install the required PHP extensions

The default PHP version available from the official Ubuntu 18.04 repository is PHP 7.2. Remove PHP 7.2 and install PHP 7.1 and all the required PHP extensions:

sudo apt-get remove php7.2*
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1 php7.1-common php7.1-curl php7.1-gd php7.1-curl php7.1-dom php7.1-mysql php7.1-intl
sudo a2dismod php7.2
sudo a2enmod php7.1

Configure PHP

Locate the PHP configuration file:

php -c /etc/php/7.1/apache2/ -i |grep "Loaded Configuration File"

The output should be something like this:

Loaded Configuration File => /etc/php/7.1/apache2/php.ini

Edit the php.ini configuration file:

vi /etc/php/7.1/apache2/php.ini

Add/modify the following options:

memory_limit = 256M 
file_uploads = On	
allow_url_fopen = On
allow_url_include = Off
post_max_size 32M
upload_max_filesize = 8M	
max_execution_time = 300
default_charset = "UTF-8"
date.timezone = "America/Chicago"

Enable Apache Rewrite Module

Enable Apache rewrite module if it is not already done so:

a2enmod rewrite

Restart the Apache service for the changes to take effect:

systemctl restart apache2

Install MariaDB

We will use MariaDB as a database engine. We can install MariaDB server from the Ubuntu base repository using the following commands:

sudo apt-get install mariadb-server-10.1 mariadb-server-core-10.1

Install Thelia

Download and extract the latest version of Thelia in the document root directory of your website ( e.g /var/www/html/your-domain.com).

cd /opt/
wget https://thelia.net/download/thelia.zip
unzip thelia.zip
mkdir -p /var/www/html/your-domain.com
mv /opt/thelia_*/* /var/www/html/your-domain.com/
chown -R www-data:www-data /var/www/html/your-domain.com
rm thelia.zip

Create a Database for Thelia

Create a MySQL database for the Thelia website:

mysql -u root -p
MariaDB [(none)]> CREATE DATABASE thelia;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON thelia.* TO 'thelia'@'localhost' IDENTIFIED BY 'Str0ngPa55w0rd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> exit;

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

Create a Virtual Host in Apache

Create a virtual host in Apache for your domain:

vi /etc/apache2/sites-available/your-domain.com.conf

And add the following content to the file:

<VirtualHost *:80>

ServerAdmin admin@your-domain.com
ServerName your-domain.com ServerAlias www.your-domain.com DocumentRoot /var/www/html/your-domain.com <Directory /var/www/html/your-domain.com> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/your-domain.com_error.log CustomLog ${APACHE_LOG_DIR}/your-domain.com_access.log combined </VirtualHost>

Replace ‘your-domain.com’ with your actual domain.

To enable the virtual host we have just created, run the following command:

a2ensite your-domain.com.conf

Then, disable the default Apache configuration:

a2dissite 000-default.conf

Restart Apache service for the changes to take effect:

systemctl restart apache2

Open http://your-domain.com in a web browser and follow the on-screen instructions: Select the language you want to use, check the PHP version, required PHP extensions and file permissions, and if everything is OK, click on the ‘Continue’ button.

install thelia on ubuntu 18.04

On the next page, enter the database settings:

installing thelia on ubuntu 18.04

Click ‘Continue’ and choose ‘thelia’ as database. On the next page, create a new admin account.

Don’t forget to delete the web/install directory:

rm -rf /var/www/html/your-domain.com/web/install/

That’s it. If you followed all of the instructions properly you can now access the Thelia back-office at http://your-domain.com/web/admin/login

install thelia ubuntu 18.04

Of course, you don’t have to install Thelia on Ubuntu 18.04, if you use one of our Server Support Services solutions, in which case you can simply ask our expert Linux admins to set up Thelia on Ubuntu 18.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 Thelia on an Ubuntu 18.04 VPS, 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 Thelia on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-thelia-on-ubuntu-18-04/feed/ 0
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 Install Mahara on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-mahara-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-mahara-on-ubuntu-20-04/#respond Wed, 07 Apr 2021 16:28:36 +0000 https://linuxhostsupport.com/blog/?p=1377 Mahara is a free and open-source electronic portfolio management system written in PHP. It is a web-based application mainly used in academic institutions to provide a platform to share their knowledge. It helps you to create a digital classroom and organize a student’s progress. You can also create a blog, build a resume, file repository, […]

The post How to Install Mahara on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
installing mahara on ubuntu 20.04Mahara is a free and open-source electronic portfolio management system written in PHP. It is a web-based application mainly used in academic institutions to provide a platform to share their knowledge. It helps you to create a digital classroom and organize a student’s progress. You can also create a blog, build a resume, file repository, and a competency framework using Mahara. Compared to other Learning Management Systems, Mahara is distributed and user-focused.

In this tutorial, we will show you how to install Mahara on Ubuntu 20.04 server.

Prerequisites

  • An Ubuntu 20.04 VPS (we’ll be using our SSD 2 VPS plan)
  • Access to the root user account (or access to an admin account with root privileges)

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

First, log in to your Ubuntu 20.04 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.

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

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

Step 2: Install LAMP Server

Mahara runs on a web server, written in PHP and uses MySQL or PostgreSQL as a database backend. So LAMP server must be installed in your server. If not installed, you can install it with the following command:

apt-get install apache2 mariadb-server php libapache2-mod-php php-mysql php-gd php-curl php-json php-xml php-mbstring -y

Once all the required packages are installed, edit the php.ini file and make some changes:

nano /etc/php/7.4/apache2/php.ini

Change the following lines:

log_errors = On
upload_max_filesize = 50M
post_max_size = 100M

And, add the following lines at the end of the file:

register_globals = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
magic_quotes_gpc = Off
allow_call_time_pass_reference = Off

Save and close the file then restart the Apache service to apply the changes:

systemctl restart apache2

Step 3: Create a Database

Next, you will need to create a database and user for Mahara. First, connect to the MariaDB with the following command:

mysql

Once connected, create a database and user with the following command:

MariaDB [(none)]> create database maharadb character set utf8mb4;
MariaDB [(none)]> grant all on maharadb.* to 'mahara'@'localhost' identified by 'password';

Next, flush the privileges and exit from the MariaDB with the following command:

MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

Once the database is created, you can proceed to download Mahara.

Step 4: Install Mahara

First, visit the Mahara website and download the latest version of Mahara with the following command:

wget https://launchpad.net/mahara/20.10/20.10.0/+download/mahara-20.10.0.tar.bz2

Once the download is completed, extract the downloaded file with the following command:

bunzip2 mahara-20.10.0.tar.bz2 
tar -xvf mahara-20.10.0.tar

Next, move the extracted directory to the Apache web root with the following command:

mv mahara-20.10.0 /var/www/html/mahara

Next, create a data directory for Mahara with the following command:

mkdir /var/www/html/mahara/data

Next, set the ownership and permissions with the following command:

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

Next, change the directory to Mahara and generate a secrets with the following command:

cd /var/www/html/mahara/htdocs
openssl rand -base64 32

You should get the following output:

QaU6HjHs6N93JIFX1bysH6OwmNP/QnDsIGI7MiX0Yag=

Next, rename the default config.php file:

cp config-dist.php config.php

Next, edit the config.php file and define database settings, data directory and secrets:

nano config.php

Change the following lines:

$cfg->dbtype   = 'mysql';
$cfg->dbhost   = 'localhost';
$cfg->dbport   = null; // Change if you are using a non-standard port number for your database
$cfg->dbname   = 'maharadb';
$cfg->dbuser   = 'mahara';
$cfg->dbpass   = 'password';
$cfg->dataroot = '/var/www/html/mahara/data';
$cfg->passwordsaltmain = 'QaU6HjHs6N93JIFX1bysH6OwmNP/QnDsIGI7MiX0Yag=';
$cfg->urlsecret = 'mysupersecret';

Save and close the file when you are finished.

Step 5: Configure Apache for Mahara

Next, create an Apache virtual host configuration file with the following command:

nano /etc/apache2/sites-available/mahara.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
DocumentRoot /var/www/html/mahara/htdocs/
ServerName mahara.example.com
<Directory /var/www/html/mahara/htdocs/>
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>

Save and close the file then enable the Apache virtual host with the following command:

a2ensite mahara.conf

Next, reload the Apache service to apply the changes:

systemctl reload apache2

Step 6: Setup a Cron Job

In order to update the RSS feeds and send email notifications, you will need to set a cron jobs that run every minute.

You can set up it with the following command:

crontab -e

Add the following line:

* * * * * php /var/www/html/mahara/htdocs/lib/cron.php

Save and close the file when you are finished.

Step 7: Access Mahara Web Interface

Now, open your web browser and access the Mahara web UI using the URL http://mahara.example.com. You will be redirected to the following page:

install mahara on ubuntu 20.04

Click on the Install Mahara button to start the installation. Once the installation has been finished, you should see the following page:

install mahara ubuntu 20.04

Click on the Continue button. You should see the following page:

configure mahara on ubuntu 20.04

Set your admin password and click on the Submit button. You will be redirected to the Mahara dashboard in the following page:

how to install mahara on ubuntu

Congratulations! you have successfully installed Mahara on Ubuntu 20.04.

Of course, you don’t have to install Mahara on Ubuntu if you use one of our Server Support Services, in which case you can simply ask our expert Linux admins to install Mahara on Ubuntu, 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 Mahara on Ubuntu, 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 Mahara on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-mahara-on-ubuntu-20-04/feed/ 0
How to Install Magento 2 on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-magento-2-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-magento-2-on-ubuntu-20-04/#respond Mon, 01 Mar 2021 11:34:56 +0000 https://linuxhostsupport.com/blog/?p=1368 In this guide, we will show you how to install Magento 2 with LEMP stack on an Ubuntu 20.04 VPS. Magento is one of the most popular open-source e-commerce platforms available, thanks to its customizability and flexibility. It is created using the Zend Framework and uses MySQL as its database management system. Magento provides online […]

The post How to Install Magento 2 on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
In this guide, we will show you how to install Magento 2 with LEMP stack on an Ubuntu 20.04 VPS.

Magento is one of the most popular open-source e-commerce platforms available, thanks to its customizability and flexibility. It is created using the Zend Framework and uses MySQL as its database management system. Magento provides online merchants with a very flexible shopping cart and it comes with a rich set of features.

Installing Magento 2 on Ubuntu 20.04 should take less than 10 minutes to complete. Let’s get started with the tutorial.

Prerequisites

  • An Ubuntu 20.04 VPS with root access enabled, or a user with or a user with Sudo privileges is also required
  • 2GB of RAM or higher
  • MySQL 5.6 or 5.7 version, (or MariaDB >= 10.0, or higher, Percona 5.7, or any other binary-compatible MySQL database server)
  • nginx, or Apache webserver with mod_rewrite module enabled
  • PHP 7.3 with bcmath, ctype, curl, dom, gd, hash, iconv, intl, libxml, mbstring, openssl, pdo_mysql, simplexml, soap, xsl and zip extensions enabled. Also, for performance reasons, it is a good idea to install and enable the opcache extension.
  • A valid domain name for accessing the Magento 2 website. Also, a valid SSL certificate is required for accessing the website using HTTPS.

Step 1: Login and Update the OS Packages

First, we’re going to need to log into our server using SSH. You can do that by entering this command:

ssh root@IP_Address -p Port_number

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

Once you are logged in, you should update all of your Ubuntu OS packages to their latest available versions.

apt-get update 
apt-get upgrade

Once all the OS packages are up-to-date, restart your server if required to apply the configuration changes.

Step 2: Install LEMP

LEMP is an acronym that describes a Linux OS with an installed Nginx web server, i.e. LEMP consists of Linux, Nginx, MySQL, and PHP.

Install Nginx

If there is an Apache web server installed on the server, stop the Apache service and disable it to start on server boot:

systemctl stop apache2
systemctl disable apache2

Install Nginx with the following command:

apt-get install nginx

Install MySQL

Install the MySQL database server which will be used for storing the data of your Magento website, such as products, categories, customers, and orders.
For the purposes of this tutorial, we will install and use MariaDB. You can also install and use the MySQL 5.7 version. Please note, MySQL 8 version is not supported yet. To install the MariaDB database server, enter the following command:

apt install mariadb-server

Enable the MariaDB service to start on server boot:

systemctl enable mariadb.service

Install PHP 7.3

By default, Ubuntu 20.04 ships with PHP version 7.4. But, Magento 2.3 does not support PHP 7.4. So, we will need to remove PHP 7.4 version, install PHP 7.3 version and all the respective PHP extensions.
Remove the PHP 7.4 version:

apt-get remove php7.4 php7.4-common

Add PPA for PHP 7.3:

add-apt-repository ppa:ondrej/php

Next, update the OS package list and install PHP 7.3 with the following command:

apt-get update
apt-get install php7.3

Install all the required PHP extensions with the following command:

apt-get install php7.3-bcmath php7.3-common php7.3-curl php7.3-fpm php7.3-gd php7.3-intl php7.3-mbstring php7.3-mysql php7.3-soap php7.3-xml php7.3-xsl php7.3-zip

Once the PHP extensions have been installed on the server, install few other OS packages required for the Magento 2 installation:

apt-get install git curl software-properties-common

Next, open the main PHP configuration file /etc/php/7.3/fpm/php.ini and change the following PHP settings:

nano /etc/php/7.3/fpm/php.ini

Change the following settings:

memory_limit = 256M
upload_max_filesize = 128M
zlib.output_compression = On
max_execution_time = 600
max_input_time = 900
date.timezone = America/Chicago

Save and close the PHP configuration file.

Step 3: Create a Database for Magento 2

Next, we will create our MySQL user and database for our Magento 2 website. Log in to your MySQL server with the following command and enter your MySQL root password when prompted:

mysql -u root -p

To create a new database for our Magento 2 instance, run the following commands:

mysql> set global log_bin_trust_function_creators=1;
mysql> CREATE USER 'magento'@'localhost' IDENTIFIED WITH mysql_native_password BY 'strongPassword';
mysql> create database magentodb;
mysql> GRANT ALL PRIVILEGES ON magentodb.* TO 'magento'@'localhost';
mysql> flush privileges;
mysql> quit

Step 4: Install Magento 2

We can now proceed with the Magento 2 installation. At the time of writing this article, the latest stable version of Magento is version 2.3.5.
First, go to the GitHub repository and download the latest version of Magento with the following command:

mkdir -p /var/www/magento2/
cd /var/www/magento2/
git clone https://github.com/magento/magento2.git /var/www/magento2/

Next, check the latest version of Magento 2 with the following command:

git checkout $(git describe --tags $(git rev-list --tags --max-count=1))

Next, we will need to install Composer to install all necessary Magento components. You can install Composer by just running the following command:

curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
cd /var/www/magento2
composer install
bin/magento setup:install --base-url=http://yourdomain.com/ --db-host=localhost --db-name=magentodb --db-user=magento --db-password=strongPassword --admin-firstname=FirstName --admin-lastname=LastName --admin-email=your@emailaddress.com --admin-user=magentoadmin --admin-password=strong-password --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1

Do not forget to replace the domain name, database password, admin username, password, and admin email address accordingly.
Once the installation is complete, you should receive the following output:
[Progress: 699 / 701]
Post-installation file permissions check…
For security, remove write permissions from these directories: ‘/var/www/magento2/app/etc’
[Progress: 700 / 701]
Write installation date…
[Progress: 701 / 701]
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin_1k4pc0
Nothing to import.

Remember the ‘Magento Admin URI’. You will need this info later when you need to log in to the Magento backend.

Change the ownership of the magento2 directory to www-data with the following command:

chown -R www-data:www-data /var/www/magento2/

Step 5: Create nginx Configuration File

upstream fastcgi_backend {
server unix:/run/php/php7.3-fpm.sock;
}

server {
server_name yourdomain.com;
listen 80;
set $MAGE_ROOT /var/www/magento2;
set $MAGE_MODE developer; # or production

access_log /var/log/nginx/magento2-access.log;
error_log /var/log/nginx/magento2-error.log;

include /var/www/magento2/nginx.conf.sample;
}

Remove the default nginx configuration file, if is not being used:

rm -f /etc/nginx/sites-enabled/default

Enable the newly created nginx configuration file, then test the nginx configuration and make sure that there are no errors:

ln -s /etc/nginx/sites-available/magento2 /etc/nginx/sites-enabled/magento2
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Step 6: Install SSL Certificate

Add PPA for certbot

add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install certbot python3-certbot-nginx

Install a new SSL certificate on your domain name:

certbot --nginx -d yourdomain.com -d www.yourdomain.com

Please select ‘2’ and choose to redirect HTTP traffic to HTTPS:
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
1: No redirect – Make no further changes to the webserver configuration.
2: Redirect – Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you’re confident your site works on HTTPS. You can undo this
change by editing your web server’s configuration.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel): 2

Use the following Magento 2 CLI commands to update the Magento base-url and the base-url-secure values:

cd /var/www/magento2/
php bin/magento setup:store-config:set --base-url="https://yourdomain.com/"
php bin/magento setup:store-config:set --base-url-secure="https://yourdomain.com/"

Edit the nginx configuration file and enable HTTP/2:

nano /etc/nginx/sites-enabled/magento2

Replace:

listen 443 ssl;

With:

listen 443 ssl http2;

Restart the Nginx service for the changes to take effect:

systemctl restart cron.service

Step 7: Install Cron Job

Magento requires a cron job configuration for many important system functions, so create the following cron job:

crontab -u www-data -e
* * * * * /usr/bin/php /var/www/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/magento2/var/log/magento.cron.log

Restart the cron service:

systemctl restart cron.service

That is it. Magento 2 has been successfully installed on your server.

You can access the Magento front-end at http://yourdomain.com :
how to install magento 2 on ubuntu 20.04
Log in to the Magento 2 back-end at http://yourdomain.com/Magento Admin URI, and configure Magento according to your needs, install extensions, add products, categories etc.

magento2 back-end


Of course, you don’t have to install Magento 2 with LEMP stack on Ubuntu 20.04, if you use one of our Monthly Server Maintenance services, in which case you can simply ask our expert system administrators to install Magento 2 on Ubuntu 20.04 for you, using the LEMP stack or any other web hosting stack of your choice. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on how to install Magento 2 with LEMP stack on Ubuntu 20.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 Magento 2 on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-magento-2-on-ubuntu-20-04/feed/ 0
How to Install Elasticsearch on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-elasticsearch-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-elasticsearch-on-ubuntu-20-04/#comments Wed, 03 Feb 2021 09:53:04 +0000 https://linuxhostsupport.com/blog/?p=1359 Elasticsearch is an open-source platform for full-text search and analytics engines. It allows you to store, search, and analyze a large amount of data in real-time. It is a popular search engine designed for applications that have complex search requirements. With Elasticsearch, you can build a complex search functionality similar to the Google search engine. […]

The post How to Install Elasticsearch on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
installing elasticsearch on ubuntu 20.04Elasticsearch is an open-source platform for full-text search and analytics engines. It allows you to store, search, and analyze a large amount of data in real-time. It is a popular search engine designed for applications that have complex search requirements. With Elasticsearch, you can build a complex search functionality similar to the Google search engine.

In this tutorial, we will show you how to install Elasticsearch on Ubuntu 20.04.

Prerequisites

  • An Ubuntu 20.04 VPS (we’ll be using our SSD 2 VPS plan)
  • Access to the root user account (or access to an admin account with root privileges)

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

First, log in to your Ubuntu 20.04 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.

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

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

Step 2: Add Elasticseach Repository

By default, Elasticsearch is not available in the Ubuntu standard OS repository. So you will need to add the Elasticsearch repository to your system.

First, install the required dependencies with the following command:

apt-get install apt-transport-https ca-certificates gnupg2 -y

Once all the dependencies are installed, import the GPG key with the following command:

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -

Next, add the Elasticsearch repository with the following command:

sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'

Once the repository is added, you can proceed and install Elasticsearch.

Step 3: Install Elasticsearch

Now, update the repository cache and install the Elasticsearch with the following command:

apt-get update -y
apt-get install elasticsearch -y

Once the installation is completed, start the Elasticsearch service and enable it to start at system reboot with the following command:

systemctl start elasticsearch
systemctl enable elasticsearch

Next, verify whether Elasticsearch is running or not with the following command:

curl -X GET "localhost:9200"

You should get the following output:

{
  "name" : "ubuntu2004",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "JJY-gI6ESgqEvz1dSPxs3g",
  "version" : {
    "number" : "7.10.1",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "1c34507e66d7db1211f66f3513706fdf548736aa",
    "build_date" : "2020-12-05T01:00:33.671820Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Step 4: Configure Elasticsearch for Remote Access

By default, Elasticsearch is configured to listen on localhost only. If your application is hosted on the remote server and wants to use the Elasticsearch database then you will need to configure Elasticsearch to allow remote connection.

You can do it by editing Elasticsearch main configuration file:

nano /etc/elasticsearch/elasticsearch.yml

Uncomment and change the following line:

cluster.name: my-application
network.host: 192.168.0.100
discovery.seed_hosts: 192.168.0.100     

Save and close the file then restart the Elasticsearch service to apply the configuration changes:

systemctl restart elasticsearch

installing elasticsearch on ubuntu 20.04Congratulations! you have successfully installed Elasticsearch on an Ubuntu 20.04 VPS.installing Elasticsearch on Ubuntu 20.04

If you use one of our server management services, can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post 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 Elasticsearch on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-elasticsearch-on-ubuntu-20-04/feed/ 1
How to Install SOGo on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-sogo-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-sogo-on-ubuntu-20-04/#comments Wed, 20 Jan 2021 13:18:38 +0000 https://linuxhostsupport.com/blog/?p=1349 SOGo is a free and open-source collaborative software with a focus on simplicity and scalability. It provides an AJAX-based Web interface and supports multiple native clients through the use of standard protocols such as CalDAV, CardDAV, and GroupDAV, as well as Microsoft ActiveSync. It also offers address book management, calendaring, and Web-mail clients along with […]

The post How to Install SOGo on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
installing sogo on ubuntu 20.04SOGo is a free and open-source collaborative software with a focus on simplicity and scalability. It provides an AJAX-based Web interface and supports multiple native clients through the use of standard protocols such as CalDAV, CardDAV, and GroupDAV, as well as Microsoft ActiveSync. It also offers address book management, calendaring, and Web-mail clients along with resource sharing and permission handling.

In this tutorial, we will show you how to install SOGo on an Ubuntu 20.04 based virtual private server.

Prerequisites

  • An Ubuntu 20.04 VPS (we’ll be using our SSD 2 VPS plan)
  • Access to the root user account (or access to an admin account with root privileges)

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

First, log in to your Ubuntu 20.04 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address‘ and ‘Port_number‘ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.

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

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

Step 2: Install and Configure MariaDB Server

SOGo uses MariaDB, MySQL, or PostgreSQL as a database backend. So you will need to install the database server in your server.

You can install the MariaDB server by running the following command:

apt-get install mariadb-server -y

Once installed, log in to the MariaDB shell with the following command:

mysql

After login, create a database and use it for SOGo with the following command:

MariaDB [(none)]> CREATE DATABASE sogo;
MariaDB [(none)]> GRANT ALL ON sogo.* TO 'sogo'@'localhost' IDENTIFIED BY 'your-secure-password';

Next, change the database to SOGo and create a required table and insert some values with the following command:

MariaDB [(none)]> USE sogo;
MariaDB [sogo]> CREATE TABLE sogo_users (c_uid VARCHAR(10) PRIMARY KEY, c_name VARCHAR(10), c_password VARCHAR(32), c_cn VARCHAR(128), mail VARCHAR(128));
MariaDB [sogo]> INSERT INTO sogo_users VALUES ('admin1', 'admin1', MD5('your-secure-password'), 'SOGouser', 'sogo@example.com');

Next, flush the privileges and exit from the MariaDB with the following command:

MariaDB [sogo]> flush privileges; 
MariaDB [sogo]> exit;

Now, the MariaDB database server is installed and configured.

Step 3: Install SOGo

By default, SOGo is not available in the Ubuntu 20.04 standard repository. So you will need to download their packages from the SOGo official website. All packages are available at Sope and Sogo

You can download all the packages using the following command:

wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sogo/sogo-activesync_5.0.1.20201101-1_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sogo/sogo-dbg_5.0.1.20201101-1_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sogo/sogo-dev_5.0.1.20201101-1_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sogo/sogo_5.0.1.20201101-1_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsbjson2.3-dev_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsbjson2.3_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-appserver4.9-dev_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-appserver4.9_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-core4.9-dev_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-core4.9_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-gdl1-4.9-dev_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-gdl1-4.9_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-ldap4.9-dev_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-ldap4.9_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-mime4.9_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-xml4.9-dev_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope-xml4.9_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/libsope4.9-dev_4.9.r1664.20201016_all.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/sope4.9-appserver_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/sope4.9-dbg_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/sope4.9-gdl1-mysql_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/sope4.9-gdl1-postgresql_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/sope4.9-libxmlsaxdriver_4.9.r1664.20201016_amd64.deb
wget https://packages.inverse.ca/SOGo/nightly/5/ubuntu/pool/focal/s/sope/sope4.9-stxsaxdriver_4.9.r1664.20201016_amd64.deb

Once all the packages are downloaded, run the following command to install them:

dpkg -i *.deb

Next, run the following command to install all missing dependencies:

apt-get install -f

Once SOGo is installed, start the SOGo service and enable it to start at system reboot:

systemctl start sogo
systemctl enable sogo

Step 4: Install and Configure Apache

Next, you will need to install the Apache webserver for SOGo. You can install it with the following command:

apt-get install apache2 -y

Next, enable all required modules with the following command:

a2enmod proxy proxy_http headers rewrite
a2enconf SOGo.conf

Next, edit the SOGo virtual host configuration file:

nano /etc/apache2/conf-enabled/SOGo.conf

Find the following lines:

  RequestHeader set "x-webobjects-server-port" "443"
  RequestHeader set "x-webobjects-server-url" "https://%{HTTP_HOST}e" env=HTTP_HOST

And, replaced them with the following:

  RequestHeader set "x-webobjects-server-port" "80"
  RequestHeader set "x-webobjects-server-url" "http://%{HTTP_HOST}e" env=HTTP_HOST

Save and close the file then restart the Apache service to apply the changes:

systemctl restart apache2

Step 5: Configure SOGo

Next, you will need to configure SOGo to use MariaDB for authentication. You can do it by editing the SOGo main configuration file:

nano /etc/sogo/sogo.conf

Add the following lines at the end of the file as per your database settings:

SOGoProfileURL = "mysql://sogo:your-secure-password@localhost:3306/sogo/sogo_user_profile";
OCSFolderInfoURL = "mysql://sogo:your-secure-password@localhost:3306/sogo/sogo_folder_info";
OCSSessionsFolderURL = "mysql://sogo:your-secure-password@localhost:3306/sogo/sogo_sessions_folder";

SOGoPasswordChangeEnabled = YES;

SOGoUserSources =
  (
    {
      type = sql;
      id = users;
     viewURL = "mysql://sogo:your-secure-password@127.0.0.1:3306/sogo/sogo_users";
     canAuthenticate = YES;
     isAddressBook = NO;
      userPasswordAlgorithm = md5;
    }
  );

  SOGoPageTitle = SOGo;
  SOGoVacationEnabled = YES;
  SOGoForwardEnabled = YES;
  SOGoSieveScriptsEnabled = YES;
  SOGoMailAuxiliaryUserAccountsEnabled = YES;
  SOGoTrustProxyAuthentication = NO;
  SOGoXSRFValidationEnabled = YES;

  SOGoSuperUsernames = (admin1, admin2); // This is an array - keep the parents!

Save and close the file when you are finished then restart the SOGo service to apply the changes:

systemctl restart sogo

Step 6: Access SOGo Web UI

Now, open your web browser and type the URL http://your-domain.com/SOGo to access the SOGo web interface. You will be redirected to the SOGo login page as shown below:

install sogo ubuntu 20.04

Provide username as admin1 and password as “your-secure-password” then click on the > button. You will be redirected to the SOGo dashboard:

install sogo on ubuntu

That’s it. You have successfully installed SOGo on your Ubuntu 20.04 based VPS.

install sogo on ubuntu 20.04If you use one of our Server Management Services, you don’t have to install SoGo yourself, you can ask our system administrators and they will install SoGo on Ubuntu 20.04 or any other OS of your choice.

PS. If you liked this post 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 SOGo on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-sogo-on-ubuntu-20-04/feed/ 12
How to Install XWiki on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-xwiki-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-xwiki-on-centos-7/#respond Thu, 24 Dec 2020 10:22:02 +0000 https://linuxhostsupport.com/blog/?p=1322 In this tutorial, we are going to show you how to XWiki on CentOS 7. XWiki is a free and open-source advanced wiki software platform written in Java. It runs on servlet containers like JBoss, Tomcat, etc. which uses a database such as MySQL or PostgreSQL to store its information. We will use a VPS […]

The post How to Install XWiki on CentOS 7 appeared first on LinuxHostSupport.

]]>
instaling xwiki on centos 7In this tutorial, we are going to show you how to XWiki on CentOS 7. XWiki is a free and open-source advanced wiki software platform written in Java. It runs on servlet containers like JBoss, Tomcat, etc. which uses a database such as MySQL or PostgreSQL to store its information.

We will use a VPS with CentOS 7 but you should be able to install XWiki following this tutorial on all Red hat based Linux distributions. Installing XWiki on CentOS 7 is a fairly easy task and it shouldn’t take more than 20 minutes to finish it.

XWiki comes with tons of useful features such as the following:

  • BLog
  • Page editing
  • Content organization
  • Forums
  • Create your own applications
  • File Manager
  • Tasks
  • Different translations of the documents
  • Meetings
  • Version control
  • Content imports
    and much more…

Log in to your CentOS 7 server

Log in to your VPS via SSH as a sudo user:

ssh userame@IP_Address

Once you are logged in, issue the following commands to make sure all installed packages are up to date:

sudo yum update

Install Java

XWiki is a Java-based application so the first step is to install Java on your server. Use the following command to install OpenJDK 8 JRE using yum:

sudo yum install java-1.8.0-openjdk

Verify the installation by running:

java -version

The command above should print something like the following:

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

2. Download Tomcat 8

XWiki works with any Servlet Container such as Tomcat, GlassFish, JBoss, and Jetty. In this guide, we will use Tomcat.

Create a system user that will run the Tomcat service:

sudo groupadd tomcat
sudo useradd  -g tomcat -d /opt/tomcat tomcat

Before downloading Tomcat source files change to the tomcat user:

su - tomcat

Download the latest stable version of Apache Tomcat 8 from the official tomcat downloads page:

wget http://www-us.apache.org/dist/tomcat/tomcat-8/v8.0.53/bin/apache-tomcat-8.0.53.zip

When the download is completed unzip the archive by running the following command:

unzip apache-tomcat-8.0.53.zip

Move the apache-tomcat-8.0.53 directory to tomcat:

mv apache-tomcat-8.0.53 tomcat

Set the correct permissions to the startup scripts:

chmod +x tomcat/bin/*.sh

Once completed switch back to the sudo user:

exit

Create SystemD unit file

To create a SystemD unit file for Apache Tomcat 8 open your text editor and create the following file:

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

Copy and paste the following code:

[Unit]
Description=Apache Tomcat 8 Service
After=syslog.target network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat/tomcat
Environment=CATALINA_BASE=/opt/tomcat/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -XX:MaxPermSize=192m -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID

[Install]
WantedBy=multi-user.target

Save and close the file.

Rn the following commands to reload units and to start the Apache Tomcat service:

sudo systemctl daemon-reload
sudo systemctl start tomcat

Enable the Apache Tomcat service to start on boot:

sudo systemctl enable tomcat

Create MySQL database

XWiki works with a lot of relational databases such as MySQL, PostgreSQL, Oracle, and Derby. In this guide, we will use MySQL.

If you don’t have MySQL or MariaDB installed on your server install it with the following command:

sudo yum install mariadb-server

Once installed set the storage engine to InnoDB. Open the MariaDB configuration file with”

sudo nano /etc/my.cnf.d/server.cnf

and add default-storage-engine = innodb in the [mysqld] section:

[mysqld]
default-storage-engine = innodb

Start and enable the MariaDB service:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Login to the MySQL server with:

mysql -u root

Create a new database and user for XWiki:

create database xwiki default character set utf8 collate utf8_bin;
grant all privileges on xwiki.* to xwiki@localhost identified by 'xwiki_password';

Download and Configure XWiki

Switch to the tomcat user:

su - tomcat

Download the latest stable version of XWiki from its official downloads page:

wget http://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/platform/xwiki-platform-distribution-war/10.8/xwiki-platform-distribution-war-10.8.war

Once the download is completed, move the war file to the Tomcat webapps directory as XWiki.war

 mv xwiki-platform-distribution-war-10.8.war tomcat/webapps/xwiki.war

Switch back to the sudo user and restart the Tomcat service:

sudo systemctl restart tomcat

After the Tomcat service is restarted move to the XWiki’s WEB-INF/lib directory and download the MySQL JDBC Driver JAR:

su - tomcat
cd /opt/tomcat/tomcat/webapps/xwiki/WEB-INF/lib/
wget http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.9/mysql-connector-java-5.1.9.jar

Open the WEB-INF/hibernate.cfg.xml file and configure XWiki to use MySQL:

nano /opt/tomcat/tomcat/webapps/xwiki/WEB-INF/hibernate.cfg.xml

Comment out the default hsqldb database section and uncomment and edit the MySQL database section as shown below:

<!-- Configuration for the default database.
Comment out this section and uncomment other sections below if you want to use another database.
Note that the database tables will be created automatically if they don't already exist.

If you want the main wiki database to be different than "xwiki" (or the default schema for schema based engines)
you will also have to set the property xwiki.db in xwiki.cfg file
-->
<!--
<property name="connection.url">jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=true</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>

<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>

<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>
-->
<!-- MySQL configuration.
Uncomment if you want to use MySQL and comment out other database configurations.
Notes:
- if you want the main wiki database to be different than "xwiki"
you will also have to set the property xwiki.db in xwiki.cfg file
-->

<property name="connection.url">jdbc:mysql://localhost/xwiki?useSSL=false</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">xwiki_password</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<property name="dbcp.poolPreparedStatements">true</property>
<property name="dbcp.maxOpenPreparedStatements">20</property>

<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>

<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>

Switch back to the sudo user and restart the Tomcat service:
sudo systemctl restart tomcat

Access XWiki

XWiki runs on port 8080. To access your XWiki installation open your web browser and type: http://yourdomain_or_ip_address:8080/xwiki

You will be asked to create a new admin user for your XWiki and select a flavor. After the browser installation is completed, you can log in as your admin user and access your XWiki admin page.

For more information about XWiki, you can visit their official website.

 

install xwiki on centos 7If you use one of our Managed Server Support services,  you can simply ask our expert Linux admins to install XWiki on CentOS 7 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 XWiki on CentOS 7,  please share it with your friends on the social networks using the buttons below or simply leave a comment in the Comments Section below. Thanks.

The post How to Install XWiki on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-xwiki-on-centos-7/feed/ 0
How to Install Docker Compose on Debian 9 https://linuxhostsupport.com/blog/how-to-install-docker-compose-on-debian-9/ https://linuxhostsupport.com/blog/how-to-install-docker-compose-on-debian-9/#respond Fri, 18 Dec 2020 11:28:27 +0000 https://linuxhostsupport.com/blog/?p=1311 Docker is an open-source application that provides lightweight operating-system-level virtualization through the use of containers. The key benefit of Docker is that it allows users to package an application with all of its dependencies into a standardized unit for software development. Docker Engine is available in Community Edition (CE) and Enterprise Edition (EE). In this […]

The post How to Install Docker Compose on Debian 9 appeared first on LinuxHostSupport.

]]>
installing docker compose on debian 9 Docker is an open-source application that provides lightweight operating-system-level virtualization through the use of containers. The key benefit of Docker is that it allows users to package an application with all of its dependencies into a standardized unit for software development.

Docker Engine is available in Community Edition (CE) and Enterprise Edition (EE). In this guide, we will do the installation of Docker Community Edition on Debian 9.

Requirements

  • For the purposes of this tutorial, we will be using a Debian 9 Server.
  • Full SSH root access or a user with sudo privileges is also required.

Step 1: Connect via SSH

Connect to your server via SSH as the root user using the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

Remember to replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number. Replace “root” with your admin username if you’re not planning on using the root account.

Before starting with the installation, we need to update the OS packages to their latest versions.

We can do this by running the following commands:

$ apt-get update 
$ apt-get upgrade

Once the upgrade is complete, we can move on to the next step.

Step 2: Install Dependency packages

Start the installation by ensuring that all the packages used by docker as dependencies are installed.

apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common build-essential

Step 3: Setting Up Docker Repository

To add the Docker repository to our server, we need to add the GPG keys first with the following commands:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

Once added, add the repository pointing to ‘stable’ update channel.

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

We can now update our packages, which should include the repository from Docker.

apt-get update

After applying the command, you should see the repository link added:

Get:5 https://download.docker.com/linux/debian stretch InRelease [44.8 kB]
Get:7 https://download.docker.com/linux/debian stretch/stable amd64 Packages [8,437 B]

Step 4: Installing Docker CE

After setting up the repository, we can now install the Docker CE, as well as the Docker CLI by running the following command:

apt-get install -y docker-ce docker-ce-cli

This might take some time as it will also install any additional libraries that it requires.

Once the installation is done, verify that the docker service is running by typing:

systemctl status docker

Output:

docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-07-14 03:40:16 EDT; 38s ago
     Docs: https://docs.docker.com
 Main PID: 4434 (dockerd)
   CGroup: /system.slice/docker.service
           └─4434 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

You can also check and verify the Docker version using:

docker -v

Output:

Docker version 18.09.7, build 2d0083d

Finally, make sure that the docker service will run at boot:

systemctl enable docker

The docker the group is created but no users are added. Add normal user to the group to run docker commands as a non-privileged user.

sudo usermod -aG docker $USER

Step 5: Testing Docker CE

Let’s now test if we can run Docker containers. You can test your Docker installation by running the classic “Hello World”.

$ docker run hello-world

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

You can use the docker images a command to see a list of all images on your system.

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              fce289e99eb9        6 months ago        1.84kB

The docker ps command shows you all containers that are currently running.

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Since no containers are running, we see a blank line. Let’s try a more useful variant: docker ps -a

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
1a9048235446        hello-world         "/hello"            24 minutes ago      Exited (0) 24 minutes ago                       amazing_bassi

Throughout this tutorial, you will run multiple times, and leaving stray containers will eat up disk space. Hence, as a rule of thumb, I clean up containers once I’m done with them. To do that, you can run the docker rm command. Just copy the container IDs from above and paste them alongside the command.

docker rm 1a9048235446
1a9048235446

In later versions of Docker, the docker container prune command can be used to achieve the same effect.

$ docker container prune
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y

If you want to see the options available to a specific command execute the following command:

docker --help

The output should be similar to this:

install docker compose on debian 9

That’s it! Docker CE has been successfully installed on your Debian 9 server.


docker installation on debian 9Of course, you don’t need to do any of this if your server is covered by our Managed Linux Support services in which case you can simply ask our expert Linux admins to install Docker CE onto your server for you. They are available 24×7 and will take care of 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 in the comment section. Thanks.

The post How to Install Docker Compose on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-docker-compose-on-debian-9/feed/ 0
How to Install Open Source Social Network on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-open-source-social-network-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-open-source-social-network-on-ubuntu-18-04/#respond Wed, 07 Oct 2020 20:53:46 +0000 https://linuxhostsupport.com/blog/?p=1292 Open Source Social Network (OSSN) is a free and open source software used as a social networking engine for building your own social network with your friends and family. This open source application is written in PHP and is very easy to install. OSSN has user and admin dashboards that allow you to manage profiles […]

The post How to Install Open Source Social Network on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
open source social network apache lamp install guide ubuntuOpen Source Social Network (OSSN) is a free and open source software used as a social networking engine for building your own social network with your friends and family. This open source application is written in PHP and is very easy to install. OSSN has user and admin dashboards that allow you to manage profiles and help you to build content for many devices. This CMS has a lot of features, such as Photos, Emoji, Profiles, Search, Friends, Chat, and much more.

In this article, we will show you how to install Open Source Social Network on an Ubuntu 18.04 server.

At the time of writing this article, the latest stable version of Open Source Social Network is 5.0, and it requires:

  • PHP version 5.6, 7.0 or 7.1
  • MySQL 5 or higher
  • Apache
  • mod_rewrite Apache module
  • PHP cURL
  • PHP Mcrypt s
  • PHP GD Extension
  • PHP ZIP Extension
  • JSON Support
  • XML Support
  • PHP setting allow_url_fopen should be enabled

If you don’t have a LAMP stack set up, don’t worry – we’ll be showing you how to install that as well.

1. Connect to your server

Before we begin, you need to connect to your server via SSH as the root user. To do this, use the following command:

ssh root@IP_Address -p port_number

of course, you will need to 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:

sudo apt update
sudo apt upgrade

2. Install LAMP

In order to run Open Source Social Network, it needs a web server, PHP, and a database server. That’s why we chose the LAMP stack. In this step, we will install Apache, PHP, and MariaDB to fulfill the requirements of this application.

Execute the following command to install Apache2:

sudo apt install apache2

Once the Apache2 web service is installed on the server, we can use the commands below to start, stop and enable the service.

sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service

To confirm that Apache2 is installed properly, we can open a web browser and type the server IP address or domain name (we assume it is pointed to your server) – we should be able to view the Apache2 ‘Default Page’.

Now that our Apache installation is finished, let’s install MariaDB, an open-source equivalent of MySQL. Use the following command to install MariaDB on your server:

sudo apt install mariadb-server mariadb-client

Once MariaDB is installed on your server, you can use the commands below so that you can stop, start and enable the MariaDB service.

sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

The next command is optional. You can run the command if you want to secure the MariaDB server by disallowing remote root access, remove the test database and create a root password.

sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.

Enter current password for root (enter for none): Just press the [Enter] key, there is no password set by default
Set root password? [Y/n]: Y
New password: Enter your password
Re-enter new password: Repeat your 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

Restart the MariaDB server, so the changes will take effect.

sudo systemctl restart mariadb.service

Next, we will install PHP version 7.1 from Ondřej Surý’s repository.

Please note that OSSN does not support PHP 7.2 yet. With running these commands below, you will add Ondřej Surý’s PPA.

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

In order to install PHP 7.1 together with the modules that are required for running the OSSN, please run this command:

sudo apt install php7.1 php7.1-mysql php7.1-curl php7.1-json php7.1-cgi libapache2-mod-php7.1 php7.1-mcrypt php7.1-xmlrpc php7.1-gd php7.1-mbstring php7.1 php7.1-common php7.1-xmlrpc php7.1-soap php7.1-xml php7.1-intl php7.1-cli php7.1-ldap unzip php7.1-zip wget php7.1-readline php7.1-imap php7.1-tidy php7.1-recode php7.1-sq php7.1-intl -y

Once the installation is complete, check that all installed services work properly. If so, you can proceed to the next step.

3. Create and Configure Database on MariaDB

Now we need to create a database for OSSN. Log in to the MariaDB server with the command:

sudo mysql -u root -p

Then type the password you created in the previous step to sign in. Once you are in the MariaDB shell, you can use the following command and create a database called ossn_db for the OSSN application.

CREATE DATABASE ossn_db;

Then create a database user called ossn_user and replace Str0n9Pas$worD with your own password.

CREATE USER 'ossn_user'@'localhost' IDENTIFIED BY 'Str0n9Pas$worD';

To grant the user ossn_user with full access to the database ossn_db, run the command:

GRANT ALL ON ossn_db.* TO 'ossn_user'@'localhost' IDENTIFIED BY 'Str0n9Pas$worD' WITH GRANT OPTION;

Now we can use flush privileges operation to reload the grant tables and after that, we can exit from the MariaDB shell.

FLUSH PRIVILEGES;
EXIT;

4. Install OSSN

Use the command below to change the directory to /opt and download the Open Source Social Network.

cd /opt && wget https://www.opensource-socialnetwork.org/download_ossn/latest/build.zip

unzip the content and move the files to the Apache2 default root directory:

unzip build.zip 
sudo mv ossn /var/www/html/ossn

Create an OSSN data directory by running the commands:

sudo mkdir /var/www/html/ossn_data

Change the permissions and the ownership of the files:

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

5. Configure Virtual Host for OSSN

Since we have Apache installed on your server, we can continue and show you how to create a virtual host for your domain that you want to use. We will use nano as our editor, but if you do not prefer nano, you can use any editor of your choice and create a new configuration file called ossn.conf

sudo nano /etc/apache2/sites-available/ossn.conf

Then paste the configuration from below into the file, and replace domain-name.com with your actual domain name.

<VirtualHost *:80>
     ServerAdmin admin@domain-name.com
     DocumentRoot /var/www/html/ossn
     ServerName domain-name.com
     
          Options FollowSymlinks
          AllowOverride All
          Require all granted

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

After you finish editing the file, save and close it.

Once you have configured the virtual host, you can enable it by executing the following commands.

Disable the default virtual host with:

sudo a2dissite 000-default

then, enable the OSSN virtual host:

sudo a2ensite ossn.conf

Also, you need to make sure that the mod_rewrite Apache module is enabled:

sudo a2enmod rewrite

Restart Apache for the changes to take effect.

sudo systemctl restart apache2.service

6. Access Open Source Social Network

Open your web browser and type your domain:
http://domain-name.com/
If you closely followed this article, you should be able to see the OSSN Installation wizard, as shown on the image below.

 

During the installation, you will create an administrator account that you can use it to manage the OSSN application. You can access the back-end by adding /administrator to the end of the URL.

http://domain-name.com/administrator

The administrator dashboard will look as shown on the following image.

 

Finally, you can access your http://domain-name.com and log in so you can create your first post.

 

Congratulations! You have successfully installed Open Source Social Network on your server.

In this article, we showed you how to install Apache2, PHP 7.1, MariaDB Database Server, created an OSSN database and of course installed Open Source Social Network. Now you can start creating your own private community and connect with your friends with this wonderful social media platform.


managed open source social network supportOf course, if you are one of our Managed Ubuntu Support customers, you don’t have to install Open Source Social Network on your Ubuntu 18.04 VPS – simply ask our admins, sit back, and relax. Our admins will install and configure Open Source Social Network on Ubuntu 18.04 for you immediately.

PS. If you liked this post about how to install Open Source Social Network on an Ubuntu 18.04 VPS, please share it with your friends on the social networks using the share buttons below, or simply leave a comment in the comments section. Thanks.

The post How to Install Open Source Social Network on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-open-source-social-network-on-ubuntu-18-04/feed/ 0
How to Install Let’s Encrypt on CentOS 7 with Nginx https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-on-centos-7-with-nginx/ https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-on-centos-7-with-nginx/#comments Wed, 30 Sep 2020 18:53:05 +0000 https://linuxhostsupport.com/blog/?p=1282 In this tutorial, we will set up a Let’s Encrypt SSL certificate on a CentOS 7 server with Nginx as the web server. After completing the instructions described in this article, you should be able to access your site using HTTPS. Using SSL (short for Secure Socket Layer) is vital to keeping your site’s visitors […]

The post How to Install Let’s Encrypt on CentOS 7 with Nginx appeared first on LinuxHostSupport.

]]>
In this tutorial, we will set up a Let’s Encrypt SSL certificate on a CentOS 7 server with Nginx as the web server. After completing the instructions described in this article, you should be able to access your site using HTTPS.

Using SSL (short for Secure Socket Layer) is vital to keeping your site’s visitors safe as well as improving your webpage’s ranking on search engines. Without SSL, the data and information sent between your web server and your site’s visitors can be seen by third parties that are transmitting that data. With SSL, this data is encrypted, and only you and your visitors can see the information, keeping both sides safer.

Let’s Encrypt lets you set up an SSL certificate on your server for free. Their goal was to make SSL a commodity and give everyone the ability to have a safe and secure website. Let’s Encrypt makes the process of installing/renewing certificates easy for most users. This is very useful for making your website secure without needing the technical knowledge that is usually expected. Google and other search engines further encourage securing your website by giving websites that use SSL a higher ranking than websites without SSL.

In this guide, we will use the Certbot tool from EFF (https://certbot.eff.org).

Prerequisites

As a requirement, we need to install the Extra Packages for Enterprise Linux (EPEL) package. You will need a server or VPS running CentOS 7, and a user that has sudo privileges, or access to the root user itself. Assume the following commands described here are performed by the root user. Let’s install the EPEL package:

$ yum install epel-release

Then update the packages in the system to add the new package lists to the package manager:

$ yum update

1. Install and Start Nginx

If you haven’t done so already, install Nginx and start it:

$ yum install nginx

$ service nginx start

You can also set up Nginx to start automatically after the server boots up by running this command:

$ systemctl enable nginx

Now that our Nginx server is running, we can install Certbot.

2. Install Certbot

Now, we will install certbot by running this command:

$ yum install certbot-nginx

The next command will install a Let’s Encrypt SSL certificate using the Nginx plugin. This will automatically modify your Nginx configuration by adding the relevant lines containing the paths to the certificate and private key created by Certbot, before finally reloading Nginx.

$ certbot --nginx

Simply follow the guide that Certbot provides, enter your email, and your server should now have SSL set up!

3. Automating Renewal

A Let’s Encrypt-issued SSL certificate is valid for 90 days. However, we can automate the process of renewing the certificate by adding a cronjob that periodically checks the expiry status of the certificate and renews the certificate if needed.

In the command line, open your crontab file:

$ crontab -e

This will open a text editor where you can add the following:

0 2 * * * /usr/bin/certbot renew --quiet

This line says to run the certbot command at 2:00 am, every day. The –quiet option tells certbot not to produce any output. Save and exit from the editor.

Firewall settings (optional)

CentOS 7 comes with the default firewall program called firewalld. You may choose to completely disable this to guarantee that no connections will be stopped from/to your server. However, if you wish to use it on your system, you need to configure firewalld to allow HTTPS access to your server.

The following command configures firewalld to allow both HTTP and HTTPS connections.

$ firewall-cmd --permanent --add-service=http --add-service=https

Reload the the firewall in order for the changes to take effect:

$ firewall-cmd --reload

That’s all there is to it – you now have your firewall running while still allowing for HTTP and HTTPS requests to come through.

Congratulations! You have successfully set up Let’s Encrypt SSL using Certbot with Nginx support.


While Let’s Encrypt does make their certificate installation pretty straightforward, that’s not all that needs to be done on a website. Our fully managed CentOS support services provide you with complete and comprehensive support and maintenance for your server, including any requests you have for software installation and configuration. We do everything you could ever need for your server’s health and performance.

If this tutorial helped you set up Let’s Encrypt on your CentOS 7 server or VPS, please consider leaving a comment letting us know how it helped, or you can share this post on social media by using our share shortcuts. Thanks.

The post How to Install Let’s Encrypt on CentOS 7 with Nginx appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-on-centos-7-with-nginx/feed/ 2
Set up a Mail Server With PostfixAdmin on Ubuntu 18.04 https://linuxhostsupport.com/blog/set-up-a-mail-server-with-postfixadmin-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/set-up-a-mail-server-with-postfixadmin-on-ubuntu-18-04/#respond Wed, 23 Sep 2020 21:09:08 +0000 https://linuxhostsupport.com/blog/?p=1274 In this tutorial, we will cover the steps needed for installing a mail server using Postfix, Dovecot, SQLite, and PostfixAdmin on Ubuntu 18.04. PostfixAdmin is a free web-based interface. With PostfixAdmin, we can configure and manage a Postfix-based email server for many users. Postfix is a Mail Transfer Agent (MTA) that relays mail between different mail […]

The post Set up a Mail Server With PostfixAdmin on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will cover the steps needed for installing a mail server using Postfix, Dovecot, SQLite, and PostfixAdmin on Ubuntu 18.04.

  • PostfixAdmin is a free web-based interface. With PostfixAdmin, we can configure and manage a Postfix-based email server for many users.
  • Postfix is a Mail Transfer Agent (MTA) that relays mail between different mail servers across the Internet.
  • Dovecot is a popular Local Delivery Agent (LDA) that deliver mail received from postfix into their final destinations (mailboxes, programs, etc..)

With these three packages combined, your server will be ready to send and receive emails, along with a web-based interface for managing your email server. Let’s begin.

Requirements:

  • For the purposes of this tutorial, we will use an Ubuntu 18.04 VPS.
  • Full SSH root access or a user with sudo privileges is also required.

Step 1 – Getting Started

Connect to your server via SSH as the root user using 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.

Before starting with the installation you will need to update your system packages to their latest version.

You can do this by running the following command:

apt-get update 
apt-get upgrade

Step 2 – Create a System User

Before we create a system user, we need to install some necessary packages.

sudo apt-get -y install wget nano dbconfig-common sqlite3

Now we will create a new system user with the following commands. This user will be the owner of all mailboxes.

sudo useradd -r -u 150 -g mail -d /var/vmail -s /sbin/nologin -c "Virtual Mail User" vmail
sudo mkdir -p /var/vmail
sudo chmod -R 770 /var/vmail
sudo chown -R vmail:mail /var/vmail

Step 3 – Install PHP 7.3 and All Required PHP Modules

We will install the latest stable version of PHP 7.3 and all required PHP modules with the following commands:

apt install software-properties-common python-software-properties
add-apt-repository ppa:ondrej/php
apt update
sudo apt-get install php7.3 php7.3-cli php7.3-common php-fpm php-cli php7.3-mbstring php7.3-imap php7.3-sqlite3

Once these are installed, we can then install Nginx, which will serve as our web server for PostfixAdmin.

Step 4 – Install and configure Nginx

To install Nginx from the official Ubuntu repositories, we will run the following command:

sudo apt-get install nginx

Now we need to create a new Nginx server block with the following content. First, open the file:

sudo nano /etc/nginx/sites-available/postfixadmin.your_domain.com

Then add the following:

server {
listen 80;
server_name postfixadmin.your_domain.com;
root /var/www/postfixadmin-3.0;
index index.php;
charset utf-8;


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

location ~* \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}

Make sure you replace your_domain.com with your actual registered domain name.

To activate the server block, we will create a symbolic link:

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

To make Nginx aware of this, we’ll need to restart it.

sudo service nginx restart

Step 5 – Install and Configure PostfixAdmin

PostfixAdmin supports MySQL, PostgreSQL and SQLite databases. In this tutorial, we will use SQLite as our database system.

Now we will download PostfixAdmin and extract it to the /var/www/ directory:

wget -q -O - "http://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-3.0/postfixadmin-3.0.tar.gz" | sudo tar -xzf - -C /var/www

Open the mail configuration file and edit the following values:

sudo nano /var/www/postfixadmin-3.0/config.inc.php
$CONF['configured'] = true;
$CONF['database_type'] = 'sqlite';
$CONF['database_name'] = '/var/vmail/postfixadmin.db';
// $CONF['database_host'] = 'localhost';
// $CONF['database_user'] = 'postfix';
// $CONF['database_password'] = 'postfixadmin';
// $CONF['database_name'] = 'postfix';

$CONF['domain_path'] = 'NO';
$CONF['domain_in_mailbox'] = 'YES';

Now, change the owner for the folder so that it belongs to the web server:

sudo chown -R www-data: /var/www/postfixadmin-3.0

We will then create the SQLite database:

sudo touch /var/vmail/postfixadmin.db
sudo chown vmail:mail /var/vmail/postfixadmin.db
sudo usermod -a -G mail www-data

If everything is set up correctly, you should open your browser and go to:
https://postfixadmin.your_domain.com/setup.php
You should see something like below:

  • Depends on: SQLite – OK
  • Testing database connection – OK – sqlite://:xxxxx@//var/vmail/postfixadmin.db

To create a new admin user, run the following command:

bash /var/www/postfixadmin-3.0/scripts/postfixadmin-cli admin add admin@your_domain.com --password strong_password --password2 strong_password --superadmin 1 --active 1

Make sure to replace strong_password with an actual strong password.

If you don’t want to do this using the command line, you can also create a new admin user from the PostfixAdmin Web Interface.

Step 6 – Install and Configure Postfix

We can install Postfix with the following command:

sudo apt-get install postfix

We need to create the following files:

sudo nano /etc/postfix/sqlite_virtual_alias_maps.cf

Add the following to the file:

dbpath = /var/vmail/postfixadmin.db
query = SELECT goto FROM alias WHERE address='%s' AND active = '1'

Now the next file:

sudo nano /etc/postfix/sqlite_virtual_alias_domain_maps.cf

Add this to it:

dbpath = /var/vmail/postfixadmin.db
query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = printf('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1'

Save that file, then add the next one:

sudo nano /etc/postfix/sqlite_virtual_alias_domain_catchall_maps.cf

Insert this content into it:

dbpath = /var/vmail/postfixadmin.db
query  = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = printf('@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1'

Save and close the file. Let’s create the next one:

sudo nano /etc/postfix/sqlite_virtual_domains_maps.cf

Add this to the file:

dbpath = /var/vmail/postfixadmin.db
query = SELECT domain FROM domain WHERE domain='%s' AND active = '1'

Save and close again. Once again, let’s create the next file that we need.

sudo nano /etc/postfix/sqlite_virtual_mailbox_maps.cf

This is what should be added as the content:

dbpath = /var/vmail/postfixadmin.db
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'

Onto the last file. Create it with this command:

sudo nano /etc/postfix/sqlite_virtual_alias_domain_mailbox_maps.cf

Then add this to it:

dbpath = /var/vmail/postfixadmin.db
query = SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = printf('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 AND alias_domain.active='1'

Finally, save and close the file.

Now we will edit the main.cf configuration file by executing the following command:

postconf -e "myhostname = $(hostname -A)"

We need to edit the file so that it looks like this. We’re adding all of the files that we just created:

 

postconf -e "virtual_mailbox_domains = sqlite:/etc/postfix/sqlite_virtual_domains_maps.cf"
postconf -e "virtual_alias_maps =  sqlite:/etc/postfix/sqlite_virtual_alias_maps.cf, sqlite:/etc/postfix/sqlite_virtual_alias_domain_maps.cf, sqlite:/etc/postfix/sqlite_virtual_alias_domain_catchall_maps.cf"
postconf -e "virtual_mailbox_maps = sqlite:/etc/postfix/sqlite_virtual_mailbox_maps.cf, sqlite:/etc/postfix/sqlite_virtual_alias_domain_mailbox_maps.cf"
 
postconf -e "smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem"
postconf -e "smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key"
postconf -e "smtpd_use_tls = yes"
postconf -e "smtpd_tls_auth_only = yes"
 
postconf -e "smtpd_sasl_type = dovecot"
postconf -e "smtpd_sasl_path = private/auth"
postconf -e "smtpd_sasl_auth_enable = yes"
postconf -e "smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination"
 
postconf -e "mydestination = localhost"
postconf -e "mynetworks = 127.0.0.0/8"
postconf -e "inet_protocols = ipv4"
 
postconf -e "virtual_transport = lmtp:unix:private/dovecot-lmtp"

Save and close the file once you are done.

Also, we need to edit the master.cf file. Open the file like so:

sudo nano /etc/postfix/master.cf

Find the submission inet n and smtps inet n sections, and make sure the file looks like this:

smtp      inet  n       -       y       -       -       smtpd
#smtp      inet  n       -       y       -       1       postscreen
#smtpd     pass  -       -       y       -       -       smtpd
#dnsblog   unix  -       -       y       -       0       dnsblog
#tlsproxy  unix  -       -       y       -       0       tlsproxy
submission inet n       -       y       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
smtps     inet  n       -       y       -       -       smtpd
  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING

Save and close the file. Now restart the Postfix service and enable it.

systemctl enable postfix
systemctl restart postfix

Step 7 – Install and Configure Dovecot

Now that everything else is set up, we need to install Dovecot with SQLite support:

sudo apt-get install dovecot-imapd dovecot-lmtpd dovecot-pop3d dovecot-sqlite

We need to open the /etc/dovecot/conf.d/10-mail.conf file and change the following values:

mail_location = maildir:/var/vmail/%d/%n
mail_privileged_group = mail
mail_uid = vmail
mail_gid = mail
first_valid_uid = 150
last_valid_uid = 150

We then need to open the /etc/dovecot/conf.d/10-auth.conf file and change the following values so that it looks like this:

auth_mechanisms = plain login
#!include auth-system.conf.ext
!include auth-sql.conf.ext

We will create a new dovecot-sql.conf.ext file:

sudo nano /etc/dovecot/dovecot-sql.conf.ext

Add this as the content:

driver = sqlite
connect = /var/vmail/postfixadmin.db
default_pass_scheme = MD5-CRYPT
password_query = \
  SELECT username as user, password, '/var/vmail/%d/%n' as userdb_home, \
  'maildir:/var/vmail/%d/%n' as userdb_mail, 150 as userdb_uid, 8 as userdb_gid \
  FROM mailbox WHERE username = '%u' AND active = '1'
user_query = \
  SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail, \
  150 AS uid, 8 AS gid, printf('dirsize:storage=', quota) AS quota \
  FROM mailbox WHERE username = '%u' AND active = '1'

In the /etc/dovecot/conf.d/10-ssl.conf file, enable SSL support:

ssl = yes

We will open the /etc/dovecot/conf.d/15-lda.conf file and set the postmaster_address email address.

postmaster_address = postmaster@vps.your_domain.com

Make sure you replace your_domain.com with your domain name.

Also, we need to open the /etc/dovecot/conf.d/10-master.conf file, find the service lmtp section and change it so that it looks like this:

service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    mode = 0600
    user = postfix
    group = postfix
  }
}

Then find the service auth section and change it to this:

service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
    user = postfix
    group = postfix
  }
  unix_listener auth-userdb {
    mode = 0600
    user = vmail
    #group = vmail
  }
  user = dovecot
}

We will also change the service auth-worker section to the following:

service auth-worker {
  user = vmail
}

Close the file, and set the permissions:

chown -R vmail:dovecot /etc/dovecot
chmod -R o-rwx /etc/dovecot

Enable and restart the dovecot service:

systemctl enable dovecot 
systemctl restart dovecot

If everything is set up correctly, you should be able to log in to your PostfixAdmin Web interface and create your first virtual domain and mailbox.


Of course, you don’t have to set up and configure a mail server with PostfixAdmin on your Ubuntu 18.04 server if you use one of our Managed Server Support services, in which case you can simply ask our expert Linux admins to set up and configure a mail server with PostfixAdmin for you. They are available 24×7 and will take care of your request immediately. This can be especially helpful since setting up a mail server is not the simplest thing.

PS. If you liked this post, on how to Set up a mail server with PostfixAdmin 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 below. Thanks.

The post Set up a Mail Server With PostfixAdmin on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/set-up-a-mail-server-with-postfixadmin-on-ubuntu-18-04/feed/ 0
How to Install ClickHouse on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-clickhouse-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-clickhouse-on-ubuntu-18-04/#respond Wed, 09 Sep 2020 19:10:25 +0000 https://linuxhostsupport.com/blog/?p=1261 ClickHouse is a fast and open source column-oriented analytics database system developed by Yandex. ClickHouse is built to process analytical queries while including high-availability features that work across clusters. If you are looking for a powerful column oriented database system with a high-availability system, you really should consider ClickHouse as your database system of choice. ClickHouse […]

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

]]>
ClickHouse is a fast and open source column-oriented analytics database system developed by Yandex. ClickHouse is built to process analytical queries while including high-availability features that work across clusters. If you are looking for a powerful column oriented database system with a high-availability system, you really should consider ClickHouse as your database system of choice.

ClickHouse also provides multi-master synchronous replication, automatic fail-over, and self-organizing clusters. All in all, this makes ClickHouse a great choice for most users that need analytic features from their database system.

In this tutorial, we will show you how to install ClickHouse on an Ubuntu 18.04 server.

Prerequisites

  • Ubuntu 18.04 server or VPS. Other Ubuntu versions may work, but this tutorial is focused on Ubuntu 18.04.
  • SSH access with root privileges (a user account that has sudo access or the root account)

Step 1 – Getting Started – Login & Updates

Log in to your Ubuntu 18.04 VPS using SSH as the root user (or as a user that has sudo privileges)

ssh root@IP_Address -p Port_number

Don’t forget to replace IP_Address and Port_number with their respective values for your server. If you don’t know your server’s SSH port, it’s likely port 22.

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:

Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

Again, if you have Ubuntu 16.04 or Ubuntu 20.04, this may work, but it’s not guaranteed.

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

# apt update && apt upgrade

This maximizes compatibility and ensures that nothing is out of date.

Step 2 – Install ClickHouse

There are several ways to install ClickHouse on Ubuntu 18.04 (such as building it from source), but in this tutorial, we will install it using the ClickHouse official repository. This simplifies the install and gets you up and running in just a few minutes. You can add the key for the repository and then install the repository with these commands:

# apt-key adv --keyserver keyserver.ubuntu.com --recv E0C56BD4
# echo "deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" | tee /etc/apt/sources.list.d/clickhouse.list

The command above will create a clickhouse.list file. We need to run the following commands to install ClickHouse now.

# apt update
# apt install clickhouse-server clickhouse-client

In the installation process, you will be asked to create a password for user ‘default’. Please create and save a copy of the password – you will need it to access your ClickHouse server.

Once the installation is completed, we can enable ClickHouse to run automatically on boot.

# systemctl enable clickhouse-server

Let’s start the ClickHouse service now.

# systemctl start clickhouse-server

Your ClickHouse server is now running, you can verify it by running this command:

# systemctl status clickhouse-server
root@ubuntu1804:~# systemctl status clickhouse-server
● clickhouse-server.service - ClickHouse Server (analytic DBMS for big data)
Loaded: loaded (/etc/systemd/system/clickhouse-server.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-07-01 03:37:57 CEST; 3s ago
Main PID: 19308 (clickhouse-serv)
Tasks: 36 (limit: 2299)
CGroup: /system.slice/clickhouse-server.service
└─19308 /usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid

Jul 01 03:37:57 ubuntu1804 systemd[1]: Started ClickHouse Server (analytic DBMS for big data).
Jul 01 03:37:57 ubuntu1804 clickhouse-server[19308]: Include not found: clickhouse_remote_servers
Jul 01 03:37:57 ubuntu1804 clickhouse-server[19308]: Include not found: clickhouse_compression
Jul 01 03:37:57 ubuntu1804 clickhouse-server[19308]: Logging trace to /var/log/clickhouse-server/clickhouse-server.log
Jul 01 03:37:57 ubuntu1804 clickhouse-server[19308]: Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
Jul 01 03:37:57 ubuntu1804 clickhouse-server[19308]: Include not found: networks
Jul 01 03:37:59 ubuntu1804 clickhouse-server[19308]: Include not found: clickhouse_remote_servers
Jul 01 03:37:59 ubuntu1804 clickhouse-server[19308]: Include not found: clickhouse_compression

Now that the server is running, you can access your ClickHouse server through the command line interface:

# clickhouse-client --password

You will be asked for the password that you created earlier.

root@ubuntu1804:~# clickhouse-client --password
ClickHouse client version 19.9.2.4 (official build).
Password for user (default):
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 19.9.2 revision 54421.

Here’s how you can show your databases in ClickHouse:

ubuntu1804.yourdomain.com :) show databases

SHOW DATABASES

┌─name────┐
│ default │
│ system │
└─────────┘

2 rows in set. Elapsed: 0.002 sec.

And here’s how you can select using ClickHouse.

ubuntu1804.yourdomain.com :) select 1

SELECT 1

┌─1─┐
│ 1 │
└───┘

1 rows in set. Elapsed: 0.002 sec.

As seen above, we can invoke the “show database” and “select” queries with no problems.

Step 3 – Configure ClickHouse

3.1 – Change listening IP address

Once the ClickHouse server is installed, you can only access it from the same server, as it only listens on localhost by default. To change the listening IP address, we need to edit the /etc/clickhouse-server/config.xml file.

# nano /etc/clickhouse-server/config.xml

Find the string listen_host, and uncomment the tag line. If you have several IP addresses and want to set ClickHouse server to listen only on a specific IP address, you can edit the line as follows – make sure that you replace 111.222.333.444 with your actual IP address:

<listen_host>111.222.333.444</listen_host>

3.2 – Enable Tabix

If you want to access the ClickHouse server through http or by using a web browser, you can enable Tabix by editing the same config.xml file as before. If you choose not to do this, you won’t be able to access and manage your databases through a web browser.

# nano /etc/clickhouse-server/config.xml

Find the string http_server_default_response, then uncomment the tag line.

After making changes to the config.xml file, we need to restart our clickhouse-server service.

# systemctl restart clickhouse-server

Now, you should be able to access http://Your_IP_Address:8123 and log in using the default user and password you specified earlier in the installation process.

 

Congratulations! At this point, you should be able to access ClickHouse using port 9000 and Tabix at http://111.222.333.444:8123. For more information about ClickHouse, its features, and configuration, please check their official documentation.


Setting up ClickHouse is easy, but maintaining it is a different story. This is where our Managed Ubuntu Support services can help you save a lot of time and money when running your business. We specialize in fully-managed support for almost any enterprise Linux server. Whether you need help optimizing your ClickHouse instance, or general maintenance and management of any other service, we’re here to help you 24 hours a day, 7 days a week.

If you found this tutorial helpful in setting up ClickHouse on your Ubuntu server, please consider sharing this post on social media with our share shortcuts, or leave a comment telling us how the install went in our comments section. Thanks.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-clickhouse-on-ubuntu-18-04/feed/ 0
How to Install Vanilla Forums on Debian 9 https://linuxhostsupport.com/blog/how-to-install-vanilla-forums-on-debian-9/ https://linuxhostsupport.com/blog/how-to-install-vanilla-forums-on-debian-9/#respond Fri, 14 Aug 2020 17:20:16 +0000 https://linuxhostsupport.com/blog/?p=1251 In this tutorial, we will show you how to install Vanilla Forums on a Debian 9 server or VPS. Vanilla Forums is a modern, lightweight, and open-source forum software written in PHP. Vanilla Forums has many features, settings, and areas that can be customized. The flexibility and free nature of Vanilla Forums (plus its modern […]

The post How to Install Vanilla Forums on Debian 9 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to install Vanilla Forums on a Debian 9 server or VPS.

Vanilla Forums is a modern, lightweight, and open-source forum software written in PHP. Vanilla Forums has many features, settings, and areas that can be customized. The flexibility and free nature of Vanilla Forums (plus its modern design and feature set) makes it an attractive choice for anyone looking to start their own forum to talk to people on. Installing Vanilla Forums on Debian 9 is an easy task if you follow the steps below carefully. Let’s begin with the installation.

Prerequisites

  • A server or VPS running Debian 9.
  • Apache web server 2.0 or higher including the mod_rewrite Apache module. Alternatively, you can use Nginx as a web server with PHP support in place of Apache 2.
  • PHP 7.1 or higher (PHP 7.3 is preferred) with the following PHP extensions enabled: mbstring, cURL, GD, and PDO.
  • MySQL 5.7 or higher (or Percona/MariaDB).
  • Access to the root user account (or access to an admin account with root privileges).

We’ll be covering the installation of all of these prerequisites, so don’t worry if you’re missing some or all of them. You can skip over the ones that you already have installed if needed, but we recommend following along in case something is configured differently from your setup.

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

Log in to your Debian server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address‘ and ‘Port_number‘ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.

Before we can start with the Vanilla Forums installation, we have to make sure that all Debian packages installed on the server are up to date. We can do this by running the following commands:

sudo apt-get update
sudo apt-get upgrade

Once all packages are up to date, we can begin by installing Apache.

Step 2: Apache Web Server Installation

To install the Apache web server, run the following command:

apt-get install apache2

After the installation is complete, enable Apache to start automatically upon server boot with:

systemctl enable apache2

We can also check the status of your Apache service with the following command:

systemctl status apache2

Output:

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-07-24 10:09:17 CDT; 8s ago
  Process: 1204 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 1208 (apache2)
   CGroup: /system.slice/apache2.service
           ├─1208 /usr/sbin/apache2 -k start
           └─1209 /usr/sbin/apache2 -k start

Step 3: Install MariaDB and Create a MariaDB Database

For the purposes of this tutorial, we will install MariaDB to serve as the database server. This is where Vanilla Forums will store its posts and content. Run the following command to install MariaDB 10.1, the latest version available in the official Debian 9 repositories at the time of this article being written, along with some required MariaDB packages:

sudo apt-get install mariadb-common mariadb-client-10.1 mariadb-client-core-10.1 mariadb-server-10.1 mariadb-server-core-10.1

Once the installation is complete, issue the following command to further improve the security of your MariaDB server installation. The command is optional, however we strongly recommend it as it improves the security of your MariaDB server:

mysql_secure_installation

We recommend answering every prompt with  ‘Y’.

Once this is done, create a new MariaDB database and user for the Vanilla Forums installation.

Log in to the MariaDB console as MariaDB user (e.g. root):

sudo mysql -uroot -p

Run the following commands to create a new MariaDB database, user, and grant privileges for the user to access the database:

MariaDB [(none)]> CREATE DATABASE vanilladb character set UTF8 collate utf8_bin;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON vanilladb.* TO 'vanilla'@'localhost' IDENTIFIED BY 'StrongPassword';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> quit

Remember to replace StrongPassword with an actual strong password.

Step 4: Install PHP 7.3 and Required PHP Packages

We will be using the Ondřej Surý repository for PHP to install PHP 7.3. Import the signing key and enable the PPA for PHP 7.3 by using the following commands:

wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list

Install the ca-certificates and apt-transport-https packages by running the following command:

sudo apt-get install ca-certificates apt-transport-https

Once you are done with this, update your package manager once again using the command below:

sudo apt-get update

Install PHP 7.3 and PHP extensions:

apt-get install php7.3 php7.3-cli php7.3-common php7.3-curl php7.3-gd php7.3-intl php7.3-json php7.3-mbstring php7.3-mysql php7.3-zip libapache2-mod-php7.3

Disable PHP 7.0 if it is currently enabled:

sudo a2dismod php7.0

Then, enable PHP 7.3:

sudo a2enmod php7.3

Step 5: Create a new Apache Configuration File

Create a new Apache configuration file for the domain/subdomain name that we will be using to access the Vanilla Forums application. For this tutorial, we will use ‘vanilla.domain.com‘. Be sure to replace any occurrence of that domain name with your own registered domain name.

vi /etc/apache2/sites-available/vanilla.conf

Add the following lines:

<VirtualHost *:80>
ServerName vanilla.domain.com
DocumentRoot /var/www/vanilla/
CustomLog ${APACHE_LOG_DIR}/vanilla.domain.com.access.log combined
ErrorLog ${APACHE_LOG_DIR}/vanilla.domain.com.error.log
<Directory /var/www/vanilla>
DirectoryIndex index.php
Options -Indexes
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

Again, do not forget to replace vanilla.domain.com with your actual domain/subdomain name. Save and close the Apache configuration file.

Create a new directory named ‘vanilla’ in your web server’s directory:

mkdir -p /var/www/vanilla

To enable the newly created configuration file in Apache, run:

sudo a2ensite vanilla

Then, disable the default Apache configuration file using this next line:

sudo a2dissite 000-default

Also, we need to enable the Apache ‘rewrite’ module (if it is not already enabled):

sudo a2enmod rewrite

Check if there are errors with the newly created Apache configuration:

sudo apachectl -t
Syntax OK

If the syntax is OK and there are no errors, we can restart the Apache web service:

sudo systemctl restart apache2.service

Step 6: Install Vanilla Forums

At the time of writing this tutorial, the latest stable version of Vanilla Forums is 3.1. Download the latest stable version of Vanilla Forums and extract it in the /var/www/ directory:

cd /var/www/
wget https://us.v-cdn.net/5018160/uploads/addons/1KCWYE1PTWN7.zip -o vanilla-core-3.1.zip
mv package/* vanilla
mv /var/www/package/.htaccess.dist /var/www/vanilla/.htaccess

Change the owner and set the correct permissions for all files in the /var/www/vanilla/ directory using the following command:

sudo chown -R www-data:www-data /var/www/vanilla

Open http://vanilla.domain.com in your favorite web browser and follow the easy instructions: enter the database name, database username and password and set the username and password for the administrator user account of the Vanilla Forums application.

Then, click on the ‘Continue’ button and we will automatically be logged in to the Vanilla Forums administration back-end:

That’s it! You now have a working Vanilla Forums instance on your Debian 9 VPS.


Of course, you don’t have to install Vanilla Forums on Debian 9 if your server is covered by our Managed Linux Support services, in which case you can simply ask our expert Linux admins to install Vanilla Forums on your Debian VPS for you. They can install it, configure it, and do anything else that you might need. They are available 24×7 and will take care of all of your requests immediately.

PS. If you liked this post on how to install Vanilla Forums on Debian 9, please share it with your friends on the social networks using the share shortcuts, or simply leave a reply in the comments sections. Thanks.

The post How to Install Vanilla Forums on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-vanilla-forums-on-debian-9/feed/ 0
How to Install SOPlanning on Debian 9 https://linuxhostsupport.com/blog/how-to-install-soplanning-on-debian-9/ https://linuxhostsupport.com/blog/how-to-install-soplanning-on-debian-9/#respond Fri, 07 Aug 2020 19:47:36 +0000 https://linuxhostsupport.com/blog/?p=1239 In this article, we will show you how to install SOPlanning on a Debian 9 server. SOPlanning is an open-source and free-to-use online planning tool that is designed to organize tasks and projects easily and efficiently. SOPlanning provides users with many features, such as built-in PDF export, email notifications, .XLS or .CSV export, synchronization with Google […]

The post How to Install SOPlanning on Debian 9 appeared first on LinuxHostSupport.

]]>
In this article, we will show you how to install SOPlanning on a Debian 9 server.

SOPlanning is an open-source and free-to-use online planning tool that is designed to organize tasks and projects easily and efficiently. SOPlanning provides users with many features, such as built-in PDF export, email notifications, .XLS or .CSV export, synchronization with Google Calendar and Outlook, and lots more.

Since SOPlanning is an open source software, we can make modifications, change colors, customize the company logo etc. This application is commonly used in IT Project Management, Industrial Production, Material Reservation, Online booking systems and more.

1. Log in via SSH on the Debian server

Log in via SSH to your server as user root (or user with sudo privileges)

ssh root@Server_IP_Address -p Port_Number

Do not forget to replace the Server_IP_Address and Port_Number fields with your actual server IP address and SSH port number. The default port for SSH is 22, so try that first if you don’t know yours. Also, if you want to connect with a user that has root privileges, simply change the ‘root’ user with the user that you would like to use.

2. Update all Packages

The first thing to do when you are logged in is to make sure that all the installed packages are up to date:

sudo apt update
sudo apt upgrade

That shouldn’t take too long, and it’ll ensure that everything is secure and ready.

3. Install LAMP Server

A LAMP setup is required in order for SOPlanning to work. If you don’t already have a LAMP (Apache, MySQL (or MariaDB) and PHP) server installed on your server or VPS, you can install it with the next few steps. To install Apache and MariaDB, you can execute the following command to install both at the same time:

sudo apt-get install apache2 mariadb-server -y

Once the installation is complete, you will need to add the Ondrej PHP repository to your system so that you can install the required PHP version. We need a third-party repository since the PHP version that we need isn’t included in the built-in repositories:

sudo apt install ca-certificates apt-transport-https 
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list

The latest version of PHP for this application is PHP version 7.3. To install this version of PHP with all of the necessary modules, run the following commands:

sudo apt update
sudo apt-get install php7.3 php7.3-mysql php7.3-curl php7.3-json php7.3-cgi php7.3-recode php7.3-intl libapache2-mod-php7.3 php7.3-xmlrpc php7.3-gd php7.3-mbstring php7.3 php7.3-common php7.3-xmlrpc php7.3-soap php7.3-xml php7.3-intl php7.3-cli php7.3-ldap php7.3-zip php7.3-readline php7.3-imap php7.3-tidy -y

After all packages are installed, run the Apache and MariaDB services and allow them to start on boot with the commands:

sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mariadb
sudo systemctl enable mariadb

4. Create a Database

To create a database, you need to log in to the MySQL console:

mysql -u root -p

By using the following query, you can create a database. We chose the name soplanning, but you can name it however you want:

CREATE DATABASE soplanning;

You then need to add a separate user that will be able to interact with your ‘soplanning’ database with the query:

GRANT ALL PRIVILEGES ON soplanning.* TO 'soplanning'@'localhost' IDENTIFIED BY '5tr0ng_PaS5w0rD';

Please do not forget to change the ‘5tr0ng_PaS5w0rD‘ with an actual strong password.

To apply the privileges that you set, you need to run this command:

FLUSH PRIVILEGES;

After we finish, we can exit from the MySQL session with the command:

quit

5. Install SOPlanning

First, download the latest stable version of SOPlanning in the /opt directory on the server and extract it in the /var/www/html/ directory:

cd /opt
wget https://sourceforge.net/projects/soplanning/files/soplanning/v1.44/soplanning-1-44.zip
unzip soplanning-1-44.zip -d /var/www/html/

Next, you need to set the appropriate ownership and file permissions (in this example it’ll be www-data because you are using the Apache web server) to the files:

sudo chown -R www-data: /var/www/html/soplanning/

6. Configure the Apache Web Server

In this step, you will set up a new virtual host on the web server in order for Apache to be able to serve the SOPlanning directory. To do this, you need to create a new configuration file using your preferred text editor:

sudo nano /etc/apache2/sites-available/soplanning.conf

Now add and modify the following lines:

<VirtualHost *:80>

   ServerName your_domain.com
   ServerAdmin admin@your_domain.com
   DocumentRoot /var/www/html/soplanning/

     <Directory /var/www/html/soplanning/>
       AllowOverride All
       Order allow,deny
       allow from all
     </Directory>

    ErrorLog /var/log/apache2/soplanning_error.log
    CustomLog /var/log/apache2/soplanning_custom.log combined

</VirtualHost>

Do not forget to change all mentions of your_domain.com with your actual domain name. Save and exit.

Enable the Apache SOPlanning configuration by executing this command:

sudo a2ensite soplanning.conf

To disable the Apache default configuration, run this command next:

sudo a2dissite 000-default

Also, make sure that the mod_rewrite Apache module is enabled:

sudo a2enmod rewrite

Once you make all the changes above, you need to restart the Apache web server:

systemctl restart apache2

6. Access SOPlanning

You can now open your favorite web browser and enter the domain you added as your_domain.com in the above configuration file.

http://your_domain.com/

You should be able to see the SOPlanning Installation Assistant page.

 

Enter the information about the database that we created in step 4 of this article.

Mysql server: localhost

Database name: soplanning

Mysql login: soplanning

Once the installation is complete, you can click on ‘Click here’ button and you will be redirected to a login page where you will be able to log in as an administrator user by using ‘admin’ for both username and password.

 

Congratulations, the installation is now complete and you should be able to see the SoPlanning dashboard as shown in the following screen:

 

It is recommended to change the password for the username ‘admin’ and use a strong password. You can do that from the SOPlanning dashboard by modifying your admin profile.

 

Now you can continue to explore this useful application by organizing your time and your projects.


Of course, you don’t have to install SOPlanning on Debian 9 if you use one of our Managed Linux Support services, in which case you can simply ask our expert system administrators to install SOPlanning on your Debian 9 server for you, using the LAMP stack or any other web hosting stack of your choice. They can also help you with almost any other aspect of your server’s functions and maintenance. They are available 24×7 and will take care of any requests immediately.

If you liked this post on how to install SOPlanning on Debian 9, please share it with your friends on the social networks using the share shortcuts, or simply let us know how the installation went in the comments section below. Thank you.

The post How to Install SOPlanning on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-soplanning-on-debian-9/feed/ 0
Install Cockpit on Ubuntu 18.04 https://linuxhostsupport.com/blog/install-cockpit-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/install-cockpit-on-ubuntu-18-04/#respond Fri, 24 Jul 2020 20:04:56 +0000 https://linuxhostsupport.com/blog/?p=1207 In this tutorial, we will show you how to install Cockpit on an Ubuntu 18.04 Server. Cockpit is a web-based system administration service used to manage server services, server storage, configure networks, inspect logs, update server OS packages, and much more. Thanks to its web-based management, keeping track of what’s going on with your server […]

The post Install Cockpit on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to install Cockpit on an Ubuntu 18.04 Server.

Cockpit is a web-based system administration service used to manage server services, server storage, configure networks, inspect logs, update server OS packages, and much more. Thanks to its web-based management, keeping track of what’s going on with your server is easier than ever. Cockpit also makes it easier for users that don’t have much experience with servers to better manage their systems without having to learn to use the command line. Let’s begin with the installation.

Requirements

  • An Ubuntu 18.04 Server
  • Access to the root user account (or access to an admin account with root privileges)

Step 1. Log in to the Server & Update all Server OS Packages

Log in to your Ubuntu 18.04 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 (if using a custom port number). Additionally, replace ‘root’ with the username of the admin account if necessary.

Before we can start with the Cockpit installation, we have to make sure that all Ubuntu OS packages installed on the server are up to date. We can do this by running the following commands:

sudo apt-get update
sudo apt-get upgrade

Step 2. Install Cockpit

Run the following command to install the latest version of Cockpit available in the official Ubuntu repositories:

sudo apt-get install cockpit

In order to access Cockpit only by using your domain name, e.g.  https://your-domain.com, and without the port number 9090 in the URL, we need to install a web server, an SSL certificate on that domain and set Cockpit behind a reverse proxy. Don’t worry, we’ll be covering those steps in this tutorial as well.

Step 3. Install Apache

Check if Apache is already installed and running on the server:

dpkg -l | grep -i apache2
ps aux | grep apache2

If it is not installed, run the following command to install the Apache web server:

apt-get install apache2

Enable Apache service to start automatically upon server boot with:

systemctl enable apache2

We can also check the status of the Apache service with the following command. It should already be running, but let’s check:

systemctl status apache2

The output should look something like this:

● apache2.service – The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Sun 2019-06-30 11:12:05 CDT; 9min ago
Main PID: 9277 (apache2)
Tasks: 7 (limit: 2321)
CGroup: /system.slice/apache2.service
├─ 9277 /usr/sbin/apache2 -k start
├─ 9280 /usr/sbin/apache2 -k start
├─ 9281 /usr/sbin/apache2 -k start
├─ 9282 /usr/sbin/apache2 -k start
├─ 9283 /usr/sbin/apache2 -k start
├─ 9284 /usr/sbin/apache2 -k start
└─22386 /usr/sbin/apache2 -k start

Step 4. Install a Let’s Encrypt SSL certificate

Install Certbot, a program that automates SSL/TLS certificate installation using Let’s Encrypt Free SSL. This allows your website to be secure for free. Run this command to install the necessary packages for Let’s Encrypt:

sudo apt-get install certbot python-certbot-apache

Install a Let’s Encrypt SSL certificate on your domain. Certbot will automatically configure your Apache config file to use SSL:

sudo certbot --apache -d your-domain.com -d www.your-domain.com

Make sure to enter a valid e-mail address as that is where notifications about your certificate status (e.g. an expiring certificate) will arrive. During the installation, choose to redirect HTTP traffic to HTTPS.

Step 5. Set a Reverse Proxy in Apache

We can now set a reverse proxy in Apache. In order to do so, we need to enable some additional proxy modules in Apache. Run the following commands:

a2enmod proxy
a2enmod proxy_http
a2enmod proxy_wstunnel

Restart Apache for the changes to take effect:

systemctl restart apache2

Once mod_proxy, mod_proxy_http and proxy_wstunnel are enabled in Apache, create a new configuration file for your domain with the following command:
NOTE: It’s very important you replace “your-domain.com” at ALL locations where it shows up in the config file and all other locations. If you don’t, your configuration may not work.

nano /etc/apache2/sites-available/your-domain.com.conf

And enter the following lines:

<VirtualHost *:80>

ServerName your-domain.com
ServerAlias www.your-domain.com

RewriteEngine on
RewriteCond %{SERVER_NAME} =www.your-domain.com [OR]
RewriteCond %{SERVER_NAME} =your-domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<IfModule mod_ssl.c>

<VirtualHost *:443>

ServerName your-domain.com
ServerAlias www.your-domain.com

ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>

RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:9090/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://127.0.0.1:9090/$1 [P,L]

ProxyPass / http://127.0.0.1:9090/
ProxyPassReverse / http://127.0.0.1:9090/
<Location />
Order allow,deny
Allow from all
</Location>

SSLCertificateFile /etc/letsencrypt/live/your-domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/your-domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf

</VirtualHost>

</IfModule>

Remember to replace your ‘your-domain.com‘ with your actual domain name. Save the file, close it and disable the default Apache configuration:

a2dissite 000-default

Enable the “your-domain.com.conf” configuration in Apache using:

a2ensite your-domain.com

Optionally, we can use this command to enable it:

ln -s /etc/apache2/sites-available/your-domain.com.conf /etc/apache2/sites-enabled/your-domain.com.conf

Then restart Apache for the changes to take effect:

systemctl restart apache2

Edit the Cockpit configuration file and add the following lines:

[WebService]
Origins = https://your-domain.com http://127.0.0.1:9090
ProtocolHeader = X-Forwarded-Proto
AllowUnencrypted = true

Restart Cockpit and enable it to start on server boot:

sudo systemctl restart cockpit.socket
sudo systemctl enable cockpit.socket

Now we can access Cockpit without needing to use port 9090 in a web browser – we can now access it using https://your-domain.com.

Log in as root, or use an existing system user account on the server.

 

If there are no user accounts created on the server yet, we can create it using this command:

adduser username

Replace username with the actual name of the new user account, and you will be prompted to set and confirm the new user account password. Make sure to use a strong password for the new account.

 

That’s it – you now have a working Cockpit installation running on your Ubuntu 18.04 server.


Of course, you don’t have to install Cockpit on Ubuntu 18.04, if you use one of our Managed Ubuntu Support solutions, in which case you can simply ask our expert Linux admins to setup Cockpit on Ubuntu 18.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 Cockpit on an Ubuntu 18.04 VPS, please share it with your friends on the social networks using the share buttons below, or simply leave a comment down in the comments section. Thanks.

The post Install Cockpit on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/install-cockpit-on-ubuntu-18-04/feed/ 0
How to Install Apache Kafka on Debian 9 https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-debian-9/ https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-debian-9/#respond Wed, 15 Jul 2020 18:58:54 +0000 https://linuxhostsupport.com/blog/?p=1199 In this guide, we will show you how to install Apache Kafka on a Debian 9 VPS. Apache Kafka is a free and open-source distributed streaming software platform that lets you publish and subscribe to streams of records and store streams of records in a fault-tolerant and durable manner. Apache Kafka is written in Scala […]

The post How to Install Apache Kafka on Debian 9 appeared first on LinuxHostSupport.

]]>
In this guide, we will show you how to install Apache Kafka on a Debian 9 VPS.

Apache Kafka is a free and open-source distributed streaming software platform that lets you publish and subscribe to streams of records and store streams of records in a fault-tolerant and durable manner. Apache Kafka is written in Scala and Java. Used in thousands of companies across the world, Apache Kafka provides anyone with the ability to create streaming and stream processing applications that can read and store data in real time. This has a variety of use cases – anything from logging, to messaging, to processing almost any sort of data stream you could imagine. Let’s get started with the installation.

In order to run Apache Kafka on your VPS, the following requirements have to be met:

  • Java 8 or higher needs to be installed
  • ZooKeeper installed and running on the server
  • A VPS with at least 4GB of RAM

If you don’t have Java or ZooKeeper, don’t worry, we’ll be installing them in this tutorial as well.

Step 1 – Update OS Packages

Before we can start with the Apache Kafka installation, we have to make sure that all Debian OS packages that are installed on the server are up to date. We can do this by executing the following commands:

sudo apt-get update
sudo apt-get upgrade

Step 2 – Install JAVA

In order to run Apache Kafka on our server, we’ll need to have Java installed. We can check if Java is already installed using this command:

which java

If there is no output, that means that Java is not installed on the server yet. We can install it using the following command:

sudo apt-get install default-jdk

In order to check the Java version, run the following command on your server:

java -version

We should receive the following output:

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

Step 3 – Install Zookeeper

Kafka uses ZooKeeper to store persistent cluster metadata, so we need to install ZooKeeper. The ZooKeeper service is responsible for configuration management, leader detection, synchronization, etc. ZooKeeper is available in the official Debian package repository, so we can install it using the following command:

sudo apt-get install zookeeperd

ZooKeeper is running on port 2181 and it doesn’t require much maintenance.

Step 4 – Install Apache Kafka

Crate a new system user dedicated for the Kafka service using the following command (we’re using the kafka name for our username, you can use any name you like):

useradd kafka -m

Set a password for the newly created user:

passwd kafka

Use a strong password and enter it twice. Next, add the user to the sudo group with:

adduser kafka sudo

Stop the ZooKeeper service:

systemctl stop zookeeper.service

Log in as the newly created admin user with:

su kafka

Download the latest version of Apache Kafka available at https://kafka.apache.org/downloads and extract it in a directory on your server:

cd ~
wget -O kafka.tgz http://apache.osuosl.org/kafka/2.1.0/kafka_2.12-2.1.0.tgz
tar -xvzf kafka.tgz
mv kafka_2.12-2.1.0/* .
rmdir /home/kafka/kafka_2.12-2.1.0

Edit the ZooKeeper systemd script:

vi /lib/systemd/system/zookeeper.service
[Unit]
Requires=network.target remote-fs.target
After=network.target remote-fs.target

[Service]
Type=simple
User=kafka
ExecStart=/home/kafka/bin/zookeeper-server-start.sh /home/kafka/config/zookeeper.properties
ExecStop=/home/kafka/bin/zookeeper-server-stop.sh
Restart=on-abnormal

[Install]
WantedBy=multi-user.target

Create a systemd unit file for Apache Kafka, so that you can run Kafka as a service on your server:

vi /etc/systemd/system/kafka.service

Add the following lines:

[Unit]
Requires=network.target remote-fs.target zookeeper.service
After=network.target remote-fs.target zookeeper.service

[Service]
Type=simple
User=kafka
ExecStart=/home/kafka/bin/kafka-server-start.sh /home/kafka/config/server.properties
ExecStop=/home/kafka/bin/kafka-server-stop.sh
Restart=on-abnormal

[Install]
WantedBy=multi-user.target

Edit the server.properties file and add/modify the following properties:

vi /home/kafka/config/server.properties
listeners=PLAINTEXT://:9092
log.dirs=/var/log/kafka

After we make changes to a unit file, we should always run the systemctl daemon-reload command:

systemctl daemon-reload

Create a new directory called kafka in the /var/log/ directory on your server:

mkdir -p /var/log/kafka
chown kafka:kafka -R /var/log/kafka

This can be useful for troubleshooting. Then, start the ZooKeeper and  Apache Kafka services:

systemctl start zookeeper.service
systemctl start kafka.service

Enable the Apache Kafka service to automatically start on server boot:

systemctl enable kafka.service

In order to check if ZooKeeper and Kafka services are up and running, run the following command on your VPS:

systemctl status zookeeper.service

We should then receive an output similar to this:

zookeeper.service
Loaded: loaded (/lib/systemd/system/zookeeper.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2018-12-19 06:23:33 EST; 25min ago
Main PID: 20157 (java)
Tasks: 21 (limit: 4915)
CGroup: /system.slice/zookeeper.service
└─20157 java -Xmx512M -Xms512M -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headless=true -Xloggc:/home/kafka/bin/../l

Run this command next:

systemctl status kafka.service

The output of this command should be similar to this one:

kafka.service
Loaded: loaded (/etc/systemd/system/kafka.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2018-12-19 06:46:49 EST; 27s ago
Process: 22520 ExecStop=/home/kafka/bin/kafka-server-stop.sh (code=exited, status=0/SUCCESS)
Main PID: 22540 (java)
Tasks: 62 (limit: 4915)
CGroup: /system.slice/kafka.service
└─22540 java -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headless=true -Xloggc:/home/kafka/bin/../logs/

We can also use netstat command to check if Kafka and ZooKeeper services are listening on ports 9092 and 2181, respectively:

netstat -tunlp | grep -e \:9092 -e \:2181
tcp6       0      0 :::9092                 :::*                    LISTEN      22540/java
tcp6       0      0 :::2181                 :::*                    LISTEN      20157/java

If they are both running, and both ports are open and listening, then that is all. We have successfully installed Apache Kafka.


Of course, you don’t have to install and configure Apache Kafka on Debian 9 if you use one of our Managed Debian Support solutions, in which case you can simply ask our expert Linux admins to setup and configure Apache Kafka on Debian 9 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 Apache Kafka on a Debian 9 VPS, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

The post How to Install Apache Kafka on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-debian-9/feed/ 0
How to Install Kanboard on Debian 9 https://linuxhostsupport.com/blog/how-to-install-kanboard-on-debian-9/ https://linuxhostsupport.com/blog/how-to-install-kanboard-on-debian-9/#respond Mon, 06 Jul 2020 16:42:18 +0000 https://linuxhostsupport.com/blog/?p=1190 In this tutorial, we will show you how to install Kanboard on a Debian 9 Server. Kanboard is a Project Management Software utilizing the Kanban methodology. Kanboard helps teams visualize their workflow by showing projects and tasks in an easy-to-understand format. This helps teams collaborate more efficiently and complete their projects on time and with […]

The post How to Install Kanboard on Debian 9 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to install Kanboard on a Debian 9 Server.

Kanboard is a Project Management Software utilizing the Kanban methodology. Kanboard helps teams visualize their workflow by showing projects and tasks in an easy-to-understand format. This helps teams collaborate more efficiently and complete their projects on time and with as little conflict as possible. We can also use Kanboard to manage multiple projects simultaneously. We can easily move the project or task status by simply dragging and dropping the task into its respective column, each of which represents a stage in the project’s completion. Kanboard supports plugins as well as full integration with external services.

Prerequisites

  • A computer or server running Debian 9
  • SSH access with a root-privileged account, or access to the root user itself

Step 1 – Install Package Updates

Log in to your Debian 9 VPS

ssh root@IP_Address -p Port_number

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

# lsb_release -a

You should get this output:

Distributor ID: Debian
Description: Debian GNU/Linux 9.9 (Stretch)
Release: 9.9
Codename: stretch

Then, run the following command to make sure that all installed packages on the server are updated to the latest available version. This maximizes compatibility and gives you all of the latest features.

# apt update && apt upgrade

Step 2 – Install the Apache Web Server

Kanboard supports Apache, Nginx, Microsoft IIS, and Caddy Server web servers. If you choose Apache, make sure you have the mod_version module installed. Make sure that you do not have the mod_security module installed, because Kanboard is not compatible with mod_security. In this tutorial, we will install and use Apache as a web server.

Let’s install Apache by issuing this command:

# apt install apache2 -y

We would also want to enable it to run on server boot:

# systemctl enable apache2
# systemctl start apache2

2.1. Create an Apache VirtualHost

We can now create our virtual host files. The virtual host configuration files usually end with the .conf extension.
Run the following command to create the virtual host configuration file for our web domain, yourdomain.com:

Make sure you replace all instances of yourdomain.com with your registered domain name in order for the configuration file to work.

# nano /etc/apache2/sites-available/yourdomain.com.conf

And add the following content to the file:

<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /var/www/html/kanboard

ErrorLog ${APACHE_LOG_DIR}/yourdomain.com_error.log
CustomLog ${APACHE_LOG_DIR}/yourdomain.com_access.log combined

<Directory /var/www/html/kanboard/>
    AllowOverride FileInfo Options=All,MultiViews AuthConfig
</Directory>

</VirtualHost>

Once added and saved, we can enable the virtual host by running this command:

# a2ensite yourdomain.com
# systemctl restart apache2

Step 3 – Install a Database Server

Kanboard supports the following types of databases

  • SQLite
  • MySQL
  • PostgreSQL

In this tutorial, we will use MySQL/MariaDB as the database storage engine.

# apt install mariadb-server

To start the MariaDB service and enable it to start on boot, execute the following commands:

# systemctl start mariadb
# systemctl enable mariadb

Now, you can skip the following step if you prefer not to have a MySQL root password.

# mysql_secure_installation

When prompted, answer the questions below by following the guide.

Enter current password for root (enter for none): Just press the [Enter] key, there is no password set by default
Set root password? [Y/n]: Y
New password: Enter password
Re-enter new password: Repeat 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

If you followed the above step, then you will have a password set for your MySQL root user, so you can run this command to access the MySQL shell:

# mysql -u root -p

3.1 Create a Database

Let’s proceed with creating a database for Kanboard. Run these commands one by one to log into the MySQL shell, create a database, create a user and grant access to the new database, and save the changes:

# mysql -u root -p
MariaDB [(none)]> CREATE DATABASE kanboard;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON kanboard.* TO 'kanboard'@'localhost' IDENTIFIED BY 'M0d1fyth15';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Make sure you replace the phrase M0d1fyth15 with a unique and strong password.

After that is done, run the following command to import the database schema to the newly created Kanboard database.

# mysql -u root -p kanboard < /var/www/html/kanboard/app/Schema/Sql/mysql.sql

Step 4 – Install PHP and all Necessary PHP Modules

Since version 1.2, Kanboard requires at least PHP 5.6, and a later or the latest version of PHP is recommended. We will use PHP 7.0 in this tutorial. This command will install PHP and all of the required packages for it to function with Kanboard:

# apt install php php-mbstring php-imap php-mysql libapache2-mod-php7.0 php-gd php-json php-xml php-opcache php-fpm

Now that PHP 7.2 is installed, let’s check and verify it.

# php -v

Here’s the output we expect to see:

PHP 7.0.33-0+deb9u3 (cli) (built: Mar  8 2019 10:01:24) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.33-0+deb9u3, Copyright (c) 1999-2017, by Zend Technologies

Step 5 – Install Kanboard

In this step, we will download and install Kanboard from GitHub. First, let’s make sure that we have the git package installed:

# apt install git -y

From there, let’s switch into the Apache web server directory and clone the Kanboard GitHub project into it:

# cd /var/www/html/
# git clone https://github.com/kanboard/kanboard.git

After that, create a configuration file by copying the example that was included.

# cp kanboard/config.default.php kanboard/config.php

Let’s also make sure that all of the files in the directory are owned by the www-data user, which is the user that belongs to Apache:

# chown -R www-data: /var/www/html/

Now, it is time to modify the database configuration file to match with the database credentials.

# nano /var/www/html/kanboard/config.php

Modify the values as follows (change the values as needed if you used values different from the ones in the tutorial):

// Database driver: sqlite, mysql or postgres (sqlite by default)
define('DB_DRIVER', 'mysql');

// Mysql/Postgres username
define('DB_USERNAME', 'kanboard');

// Mysql/Postgres password
define('DB_PASSWORD', 'M0d1fyth15');

// Mysql/Postgres hostname
define('DB_HOSTNAME', 'localhost');

// Mysql/Postgres database name
define('DB_NAME', 'kanboard');

At this point, Kanboard has been successfully installed – you can navigate to your http://yourdomain.com to start using it. You can use the following credentials to access the Kanboard backend.

Username: admin
Password: admin

You will want to update the default password as soon as possible.

Additionally, if you want your Kanboard installation to use pretty permalinks, you can enable it by enabling the feature in your config.php file

define('ENABLE_URL_REWRITE', true);

Make sure that your Apache mod rewrite is also enabled. You can do so by running this command:

# a2enmod rewrite
# systemctl restart apache2

That’s all there is to it – you should be able to access your Kanboard application at http://yourdomain.com now.


Of course, you don’t have to install Kanboard on Debian 9 if you use one of our Fully Managed VPS Support services, in which case you can simply ask our expert Linux admins to install Kanboard on your Debian VPS 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 Kanboard on Debian 9, please share it with your friends on the social networks using the buttons below or simply leave a reply in the comments sections. Thanks.

The post How to Install Kanboard on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-kanboard-on-debian-9/feed/ 0
How to Install and Configure TaskBoard on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-and-configure-taskboard-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-and-configure-taskboard-on-centos-7/#respond Thu, 18 Jun 2020 20:02:29 +0000 https://linuxhostsupport.com/blog/?p=1181 A need for “a simple, visual way to keep track of what needs to get done” is the main reason why the open-source TaskBoard has been developed. With a minimalistic design approach by the developer and contributors, TaskBoard aims to replicate the basics of commonly used Kanban apps like Trello and LeanKit all within a […]

The post How to Install and Configure TaskBoard on CentOS 7 appeared first on LinuxHostSupport.

]]>
A need for “a simple, visual way to keep track of what needs to get done” is the main reason why the open-source TaskBoard has been developed. With a minimalistic design approach by the developer and contributors, TaskBoard aims to replicate the basics of commonly used Kanban apps like Trello and LeanKit all within a very small and light footprint.

Some of TaskBoard’s main key features are the following:

  • Email notifications
  • Unlimited and customizable boards with items
  • Full history logging
  • Robust privilege system
  • Supports file attachments

TaskBoard is licensed under the MIT License and can be self-hosted on a Linux-based server. For this tutorial, we recommend using a public-facing server with a freshly installed CentOS 7 Linux distribution, along with a registered domain name.

If you follow this guide on how to install and configure TaskBoard on CentOS 7 correctly, the install process won’t take more than 10-15 minutes. Let’s get started!

Requirements

The following are the packages and dependencies required by TaskBoard:

  • Apache Web Server
  • PHP 7.2 and extensions
  • SQLite
  • OpenJDK (optional)

Step 1: Installing Updates and Dependencies

Connect to your publicly available server via SSH using the following commands in your preferred terminal program:

ssh [username]@[server_ip_address]

Replace [username] with the account name of a root-enabled user (or the root user itself), and replace [server_ip_address] with your server’s public IP address.

Before proceeding with the installation, it is best to update the packages to their recent stable versions, if there are any:

yum update -y

We also recommend installing EPEL and the basic dependencies of CentOS 7 to avoid missing out on important packages required during installation (these are useful for other projects, too!):

yum install epel-release -y
yum groupinstall -y "Development Tools"

Step 2: Installing the Apache Web Server

Apache is the official web server supported by TaskBoard as it is reliable, robust, and a battle-tested web server. To proceed with the installation, supply the following command:

yum install httpd -y

Once it shows that the installation is complete, enable the Apache service (httpd) to start at boot, and then start the service.

systemctl enable httpd
systemctl start httpd

Verify the status of the Apache service by:

systemctl status httpd

You should see that the service is “active (running)”:

● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2019-07-22 19:59:59 CDT; 3s ago

Step 3: Installing PHP

The TaskBoard back-end is developed using the PHP programming language. According to its developers and contributors, TaskBoard still has support for the lower-end PHP versions (5.5+), although it is recommended to use the latest stable version for bug fixes and performance improvements. Because of this, we’ll be installing PHP 7.2, a modern and reliable version of PHP.

To proceed with the installation, use the following commands:

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php72
yum update -y
yum install php php-json php-cli php-gd php-sqlite3 libapache2-mod-php -y

These commands will enable the Remi-Release repo first to activate PHP 7.2 repositories then initiate an update. Once updated, we can now install the PHP core package, some extensions, and libapache2-mod, the PHP module for the Apache 2 web server.

Verify if PHP has been successfully installed:

php -v

You should see that the output contains PHP 7.2.x:
PHP 7.2.20 (cli) (built: Jul 2 2019 13:37:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Step 4: Installing a SQLite Database Server

To  achieve the goal of a small footprint application, TaskBoard makes use of SQLite as the platform for its database, which allows all records to be stored in just a single file on the server.

To install, simply enter the command:

yum -y install sqlite

Step 5: Installing TaskBoard

After setting up the software prerequisites, we can now proceed with the download of the TaskBoard files.

First, download and unzip the latest archive file from official TaskBoard Github repository. At the time of this article being written, the latest version of TaskBoard is v.0.3.1. Run these commands to change the directory to the Apache web directory, download the master .zip file, and unzip its contents.

cd /var/www/
wget https://github.com/kiswa/TaskBoard/archive/master.zip
unzip /var/www/master.zip

After unzipping the archive file, it will produce a directory named ‘TaskBoard-master’, which we can rename to something simpler:

mv TaskBoard-master/ taskboard/

Next, it is best to update the PHP Composer which is included in the directory:

cd taskboard/
./build/composer.phar self-update

Once updated, we can now proceed with the initial installation by running this command inside the directory:

./build/composer.phar install

Installation should not take that long. If no issues are encountered, we can now apply the correct permissions to our TaskBoard files.

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

Step 6: Setting Up a Virtual Host for TaskBoard

In order for our TaskBoard application to be accessible with a publicly available domain name, we must set up an Apache virtual host. Make sure that the domain points to your server IP address and has propagated already.

To proceed, create the following virtual host file using:

nano /etc/httpd/conf.d/taskboard.conf

Next is to copy and paste the following syntax. Do not forget to modify taskboard.domain.com with your own domain or subdomain:

<VirtualHost *:80> 
ServerName taskboard.domain.com 
DocumentRoot /var/www/taskboard 

<Directory "/var/www/taskboard"> 
Options -Indexes +FollowSymLinks +MultiViews 
AllowOverride All 
Require all granted 
</Directory>

ErrorLog /var/log/httpd/taskboard.domain.com-error.log 
CustomLog /var/log/httpd/taskboard.domain.com-access.log combined 
</VirtualHost>

Save and exit the file. Finally, restart the Apache service for the changes to take effect:

systemctl restart httpd

Step 7: Accessing TaskBoard

Once the virtual host has been set up and the Apache service has been restarted, you can now access your website at http://taskboard.domain.com

At first, you will see a log in screen which looks like this:

 

By default, the username and password are both admin.

Once logged in, you should see the pretty basic and straightforward dashboard of TaskBoard:

 

Also, do not forget to change your Admin account password after logging in.

That’s it! – you now have a working TaskBoard application on your CentOS 7 powered server.


Of course, you don’t have to Install and Configure TaskBoard on CentOS 7 if you are a Managed VPS Support subscriber. In that case, you can simply ask our support team to install and configure TaskBoard on CentOS 7 for you. They are available 24/7, and they will be able to help you with the installation, along with almost anything else that you would ever need for your VPS.

PS. If you enjoyed reading this blog post on how to install and configure TaskBoard on CentOS 7, feel free to share it on social networks by using the shortcuts below, or simply leave a comment in the comments section. Thanks.

The post How to Install and Configure TaskBoard on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-and-configure-taskboard-on-centos-7/feed/ 0
How to Install Cockpit on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-cockpit-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-cockpit-on-centos-7/#respond Wed, 10 Jun 2020 21:20:59 +0000 https://linuxhostsupport.com/blog/?p=1170 In this article, we will show you how to install Cockpit CMS on a CentOS 7 VPS and help install Apache & PHP on it as well. Cockpit is a free, open source and self-hosted content management system (CMS) application written in PHP. It is a simple content platform used by web developers to create […]

The post How to Install Cockpit on CentOS 7 appeared first on LinuxHostSupport.

]]>
In this article, we will show you how to install Cockpit CMS on a CentOS 7 VPS and help install Apache & PHP on it as well.

Cockpit is a free, open source and self-hosted content management system (CMS) application written in PHP. It is a simple content platform used by web developers to create and manage any structured content. Cockpit stores the data in an SQLite database, so you don’t need to install or configure a database server such as MySQL / MariaDB. All of this combined makes for a pleasant CMS experience that allows you to share your ideas and content with the world without needing almost any technical knowledge whatsoever.

Let’s get started with the installation.

Prerequisites

  • A CentOS 7 VPS with root access enabled (or access to a user account with sudo privileges).
  • Apache web server 2.0 or higher compiled with the mod_rewrite Apache module. Alternatively, we can use Nginx as a web server with PHP support.
  • PHP 7.1 or higher (PHP 7.2 is preferred) with the following PHP extensions enabled: PDO, GD graphics library, Zip and mbstring.

Step 1: Connect via SSH and Update the OS Packages

Log in to the server using SSH as root user (or a user with sudo privileges). You can do that by entering this command:

ssh root@IP_Address -p Port_Number

Remember to replace ‘root’ with your username if you are not using the root user. Also, replace IP_ADDRESS and PORT_NUMBER with your server’s respective IP address and SSH port number (the default is 22).

Once you are logged in, you should update all of your OS packages to their latest available versions.

yum clean all
yum update

Step 2: Install Apache and PHP 7.2

Apache is available within CentOS’s default software repositories, so simply run the following command to install Apache web server:

yum install httpd -y

After installing Apache, start the Apache server and enable it to start at boot time:

systemctl start httpd
systemctl enable httpd

CentOS 7 comes with PHP version 5.4. This is a problem because Cockpit CMS requires PHP version 7.1 or higher. For the purposes of this tutorial, we will install PHP version 7.2 using the Webtatic repository. To enable the Webtatic repository, run the following command:

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Then, run the following command to install PHP 7.2 and all necessary PHP extensions:

yum install php72w php72w-cli php72w-mbstring php72w-pdo php72w-sqlite php72w-gd php72w-zip

After installing PHP 7.2, you can check the PHP version installed on the server with the following command:

php -v

The output should be similar to the one below:

PHP 7.2.19 (cli) (built: Jun 2 2019 09:49:05) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Now we can download and install Cockpit.

Step 3: Download Cockpit CMS

Download and extract the latest version of Cockpit in the default web server document root directory (/var/www/html):

cd /var/www/html
wget https://github.com/agentejo/cockpit/archive/master.zip
unzip master.zip
mv cockpit-master cockpit

Then, run the following commands to set the correct permissions for Cockpit CMS (Apache needs to have ownership of the files in order for it to use them correctly):

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

Step 4: Configure the Apache Web Server

In this part of the tutorial, we will show you how to configure Apache to serve your Cockpit CMS web pages.

Create a new Apache configuration file named cockpit.conf in the /etc/httpd/conf.d/ directory on your server:

nano /etc/httpd/conf.d/cockpit.conf

(We’re using ‘nano’ to edit our text, however you can use your preferred text editor instead).

Add the following lines:

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

Of course, don’t forget to replace your_domain.com with your actual domain name.

Save and close the file, then restart the Apache service for the changes to take effect:

systemctl restart httpd

Step 5: Install Cockpit CMS

Now, you can open your preferred web browser and access http://your_domain.com/install . You should see the Cockpit CMS setup page. Simply follow the onscreen instructions and complete the Cockpit CMS installation.

After that, click on the LOGIN NOW button and provide the default administrator username and password: admin / admin. Once logged in, you should change the default administrator user account password immediately.

 

That’s it. You have successfully installed Cockpit CMS on your CentOS 7 VPS. For more information about how to manage your Cockpit installation, please refer to the official Cockpit documentation.


Of course, you don’t have to Install Cockpit on CentOS 7, if you use one of our Managed VPS Support services, in which case you can simply ask our expert Linux admins to Install Cockpit on CentOS 7 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 Cockpit on CentOS 7, please share it with your friends on the social networks using the share buttons, or simply leave a reply below. Thanks.

The post How to Install Cockpit on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-cockpit-on-centos-7/feed/ 0
How to Install Gitea on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-gitea-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-gitea-on-ubuntu-18-04/#comments Fri, 05 Jun 2020 20:54:22 +0000 https://linuxhostsupport.com/blog/?p=1159 In this article, we will show you how to install and configure Gitea service on Ubuntu 18.04. One of the best alternatives for GitHub is Gitea. Git with a cup of tea, also known as Gitea, is an open-source application that is a fork of Gogs and is functionally very similar to GitHub, Bitbucket, and […]

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

]]>
In this article, we will show you how to install and configure Gitea service on Ubuntu 18.04. One of the best alternatives for GitHub is Gitea. Git with a cup of tea, also known as Gitea, is an open-source application that is a fork of Gogs and is functionally very similar to GitHub, Bitbucket, and Gitlab.

Gitea is written in the Go language and can be run anywhere that Go can be compiled, such as Linux, macOS, Windows, ARM and PowerPC architectures. Gitea has many features such as problems and time tracking, branch repository, file locking, and tagging, merging and more. By following the instructions below, you will install Nginx, MariaDB, Git, create a system user, install Gitea and configure Nginx as a reverse proxy. Lets begin.

Step 1. Connect to your Server

Before we begin, you need to connect to your server via SSH as the root user. To do this, use the following command:

ssh root@IP_Address -p Port_Number

of course, you will need to replace IP_Address and Port_Number with your actual server IP address and SSH port number. The default SSH port is 22, but it may be different for your server.

Once logged in, make sure that your server is up-to-date by running the following commands:

sudo apt update
sudo apt upgrade

Step 2. Install Nginx and Git

First, you need to install a web server to run Gitea. You can choose any web server that is available for Ubuntu 18.04 and install it on your server – however, in this tutorial we will be installing and using Nginx as our web server. It’s a very versatile and extremely popular web server, similar to Apache.

By executing the following command, you can install the Nginx Web server on your VPS.

sudo apt -y install nginx

When the installation will finish you can start Nginx and also enable it to start on server boot with these commands.

sudo systemctl start nginx.service
sudo systemctl enable nginx.service

We can also install a couple of dependencies that we’ll need in order to continue with the Gitea installation.

sudo apt -y install git wget

You can verify the installed git version with the command:

git --version
Output: 
git version 2.17.1

Step 3. Install MariaDB Database Server

Gitea supports the following databases: MariaDB/MySQL, PostgreSQL, SQLite, and TiDB. However, in this tutorial, we will install and use the MariaDB server and client. To install the MariaDB server on your Ubuntu 18.04 Server, run the command:

sudo apt -y install mariadb-server mariadb-client

Once MariaDB is installed on your server, you can use the commands below so you can stop, start, and enable the MariaDB service.

sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

The next command is optional. You can run the command if you want to secure the MariaDB server by disallowing remote root access, removing the test database and creating a root password.

sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.

Enter current password for root (enter for none): Just press the [Enter] key, no password is set
Set root password? [Y/n]: Y
New password: Enter your password
Re-enter new password: Repeat your 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

Restart the MariaDB server so that the changes will take effect.

sudo systemctl restart mariadb.service

Step 4. Create a Database

You should now be able to log in to the MariaDB server with the command:

sudo mysql -u root -p

Then type the password you created above to sign on. Once you are in the MariaDB shell, you can use the following command and create a database called ‘gitea’ for the Gitea application.

CREATE DATABASE gitea;

Next, create a database user called ‘giteauser’ and replace New_Str0n9_Pas$worD with your own password.

CREATE USER 'giteauser'@'localhost' IDENTIFIED BY 'New_Str0n9_Pas$worD';

To grant the user ‘giteauser’ with full access to the database ‘gitea’ run the command:

GRANT ALL ON gitea.* TO 'giteauser'@'localhost' IDENTIFIED BY 'New_Str0n9_Pas$worD' WITH GRANT OPTION;

Now we can use flush privileges operation to reload the grant tables and after that, we can exit from the MariaDB shell.

FLUSH PRIVILEGES;
EXIT;

Step 5. Prepare the Gitea Environment

Now we need to create a git user that can manage Gitea on the system. To do that, run the command below:

sudo adduser \
--system \
--shell /bin/bash \
--gecos 'Git Version Control' \
--group \
--disabled-password \
--home /home/git \
git

With the following commands, we will create the necessary directory structure and give them appropriate permissions.

sudo mkdir -p /var/lib/gitea/{custom,data,indexers,public,log}
sudo chown git:git /var/lib/gitea/{data,indexers,log}
sudo chmod 750 /var/lib/gitea/{data,indexers,log}
sudo mkdir /etc/gitea
sudo chown root:git /etc/gitea
sudo chmod 770 /etc/gitea

Step 6. Install Gitea

The current latest version of Gitea is 1.9, however, you can always check for a newer version so you can download and install it. Download Gitea version 1.9 with the following command:

sudo wget -O gitea https://dl.gitea.io/gitea/1.9/gitea-1.9-linux-amd64

Once the file will be downloaded, make it executable and move it into the /usr/local/bin directory.

sudo chmod +x gitea
sudo mv gitea /usr/local/bin/gitea

Step 7. Create a Service file to Start Gitea Automatically

We’ll also show you how to create a Gitea systemd script. Run the following command to create a new Gitea service:

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

Then copy and paste the content below into the open file.

[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
#After=mysqld.service
#After=postgresql.service
#After=memcached.service
#After=redis.service

[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
# If you want to bind Gitea to a port below 1024 uncomment
# the two values below
###
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

Save and close the file.

In order for the changes to take effect, we’ll need to reload systemd. Start the new Gitea service, and if everything works as expected, you can enable this service:

sudo systemctl daemon-reload
sudo systemctl enable gitea
sudo systemctl start gitea

Step 8. Configure Nginx as a Reverse Proxy

Since Nginx has been installed already, we can continue and show you how to create an Nginx server block with a reverse proxy for your domain that you want to use. In the following command, we will use nano as our editor, but if you do not prefer nano, you can use any editor of your choice and create a new server block called git.conf

sudo nano /etc/nginx/sites-available/git.conf

Then paste the configuration from below into the file, and replace your_domain_name.com with your actual domain name.

upstream gitea {
    server 127.0.0.1:3000;
}

server {
    listen 80 default_server;
    server_name your_domain_name.com;
    root /var/lib/gitea/public;
    access_log off;
    error_log off;

    location / {
      try_files maintain.html $uri $uri/index.html @node;
    }

    location @node {
      client_max_body_size 0;
      proxy_pass http://gitea;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_max_temp_file_size 0;
      proxy_redirect off;
      proxy_read_timeout 120;
    }
}

After you finish editing the file, save and close it.

Once you have configured the Nginx server block, you can enable it by executing the following command:

sudo ln -s /etc/nginx/sites-available/git.conf /etc/nginx/sites-enabled

Remove the default Nginx server block with:

sudo rm /etc/nginx/sites-enabled/default

Restart Nginx so the changes will take effect.

sudo systemctl reload nginx.service

Now, open your preferred web browser and type your domain, and append slash install (/install) to the URL:

http://your_domain_name.com/install

 

Follow the onscreen instructions to complete the Gitea setup.

That’s it! In this article, we showed you how to install Nginx, MariaDB, Git, create a system user, install Gitea and configure Nginx as a reverse proxy. Now you can start exploring this useful application.


Of course, if you are one of our Managed Linux Server Support customers, you don’t have to install Gitea on your Ubuntu 18.04 Server – simply ask our admins, sit back, and relax. Our admins will install and configure Gitea for you immediately.

PS. If you liked this post about how to install Gitea on an Ubuntu 18.04 Server, please share it with your friends on the social networks using the share buttons below, or simply leave a comment in the comments section. Thank you.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-gitea-on-ubuntu-18-04/feed/ 2
How to Add a User to Sudo Group on Debian 9 https://linuxhostsupport.com/blog/how-to-add-a-user-to-sudo-group-on-debian-9/ https://linuxhostsupport.com/blog/how-to-add-a-user-to-sudo-group-on-debian-9/#respond Wed, 20 May 2020 18:06:20 +0000 https://linuxhostsupport.com/blog/?p=1149 In this article, we will show you how to add a user to the sudo group in Debian 9. Every time you install a fresh new operating system, a user named root is being created automatically. This user is extremely powerful and even dangerous because it has a complete access to the server. Typically, the […]

The post How to Add a User to Sudo Group on Debian 9 appeared first on LinuxHostSupport.

]]>
In this article, we will show you how to add a user to the sudo group in Debian 9.

Every time you install a fresh new operating system, a user named root is being created automatically. This user is extremely powerful and even dangerous because it has a complete access to the server. Typically, the root user is only used for administrative tasks, as there are no restrictions present like they are for any other user.

Note that Linux does not have an “undo” command. In order to reduce the risk of irreversible damage to the system, we can create a user who will not have privileges to execute commands that can affect the server. However, having administrative access may still be appropriate for everyday tasks – sometimes we need the power to execute some command as an administrative user. This benefit can be utilized using the sudo command. However, to use the sudo command, the user is required to be present in the sudo group. Let’s get started with the tutorial. This should work in Debian 10 as well as other future versions of Debian, as these commands usually only have small variations over time.

Step 1. Connect to your server via SSH and Update your Server OS packages

NOTE: You will need access to the root account in order to add users to the sudo group.

The first thing we need to do is access the Debian server via SSH as the root user.

ssh root@server_ip_address -p port_number

Do not forget to replace the “server_ip_address” and “port_number” with your actual server IP address and port number.

It’s not a mandatory step for this tutorial, however it’s a good practice to update your server packages frequently. It maximizes security and can introduce new features to your server. Once you have logged in, you can update your Debian 9 packages to the latest version using:

# apt update && apt upgrade

Step 2. Adding a New User

In this step, we’ll be adding a new user. When we add new users to the system, these users are by default not privileged with any administrative access. This means that these users will be able to add or edit files only if they are owners of those files.

Since we are currently logged in as a root user, we can add the new user with the following command:

# adduser testuser

Do not forget to replace testuser with your desired username.

When we run this command it will request to enter information about the new user. Please make sure that the password for the new user is a strong password utilizing at least 10 characters including alphanumeric and grammatical symbols.

Never use passwords based upon dictionary words or significant dates.

Output:

Adding user `testuser' ...
Adding new group `testuser' (1001) ...
Adding new user `testuser' (1001) with group `testuser' ...
Creating home directory `/home/testuser' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

After you set the user password, the home directory will be created for that user and will prompt you to set up information for this new user.

Changing the user information for testuser
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]

Note that you are not required to enter information for the fields you don’t wish to populate. The only exception is the password.

When you enter the desired information just confirm the information by typing Y.

Step 3. Accessing the New User

After we created a new system user account, we can log in with our newly created user through SSH by typing:

$ ssh testuser@server_ip_address -p port_number

There is also a different way to quickly switch to a different user if we are already logged in to the server. This is possible by using the su command. The su command stands for substitute user, and it allows us to enter directly into a different user account without logging out of our currently logged in user. We can use it like this:

$ su - testuser

When executing this command, the password for the testuser will be requested. If we enter the correct password, we will change the current user to our new testuser. If we  want to go back to the previous session, we can do that using the exit command:

$ exit

Step 4. Add the User to the sudo Group

As we mentioned, our new user testuser is created without administrative privileges by default. For example, if we want to execute a command that requires these privileges, it will list the following output:

testuser is not in the sudoers file. This incident will be reported.

If we want our user to have access to these privileges, we need to add it to the sudo group. All users belonging to the sudo group are allowed to use the sudo command for any purpose.

Using the following command executed as root user, we can add our testuser to the sudo group:

# usermod -aG sudo testuser

Now, when we log in as our testuser, we can run commands that require root privileges using sudo.

$ sudo command_name

When we execute the command with sudo, we will be prompted for the password for our testuser (not the root password), and then the command will be executed with elevated access.

The first time we use the sudo command, it will indicate a message:

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for testuser:

We can test the sudo access with the whoami command:

$ sudo whoami

Because we just added our user testuser to sudo group, our output of the whoami command will be root:

Output:
root

Step 5. Remove the User from sudo Group and Delete a User

In our last step, we will also cover how to remove sudo privileges from the user and how to delete a user.

If we no longer need a user to have root privileges, we can remove it from the sudo group with this command:

# deluser testuser sudo

and we will receive the following output

Output:

Removing user `testuser' from group `sudo' ...
Done.

This will only take sudo access away from our user testuser, which will not delete the user itself. But if we no longer need that user, we can delete this user by using this syntax:

# deluser --remove-home testuser

The --remove-home option will delete the home directory that belongs to our user testuser.

Output:

Looking for files to backup/remove ...
Removing files ...
Removing user `testuser' ...
Warning: group `testuser' has no more members.
Done.

Conclusion

In this article, we show you how to add, access, grant sudo privileges, remove sudo privileges, and delete users on a Debian 9 server. These are basic tasks for managing users. By familiarizing yourself with these processes you will be able to configure your Debian 9 server faster and safer.


Of course, you don’t have to add a user to Sudo group on Debian 9, if you use one of our Debian Hosting services, in which case you can simply ask our expert Linux admins to add or remove a sudo user on Debian 9, for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to add a user to Sudo group on Debian 9, 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 Add a User to Sudo Group on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-add-a-user-to-sudo-group-on-debian-9/feed/ 0
How to Install Apache Kafka on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-centos-7/#comments Wed, 29 Apr 2020 19:16:12 +0000 https://linuxhostsupport.com/blog/?p=1139 In this tutorial, we will show you how to install Apache Kafka on CentOS 7. Apache Kafka is an open source messaging system and distributed streaming platform. It’s designed to be scalable, responsive, and provide an excellent experience when dealing with real-time data feeds. It’s great at providing real time analytics and processing of data – […]

The post How to Install Apache Kafka on CentOS 7 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to install Apache Kafka on CentOS 7.

Apache Kafka is an open source messaging system and distributed streaming platform. It’s designed to be scalable, responsive, and provide an excellent experience when dealing with real-time data feeds. It’s great at providing real time analytics and processing of data – and thanks to its rich API support, developers can easily implement Apache Kafka and mold it to their exact needs.

Let’s begin with the installation.

Prerequisites:

Apache Kafka has the following requirements:

  • Java 8 or higher installed on the server
  • ZooKeeper installed and running on the server
  • A server/VPS with a minimum of 4GB RAM.

Step 1. Connect to the Server

Log in to the server via SSH as user root using the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number.

Step 2: Update OS Packages

Once logged in, make sure that your server OS packages are up-to-date by running the following commands:

yum clean all
yum update

Step 3: Install JAVA

Apache Kafka requires Java, so in order to run it on your server, we need to install Java first. We can check if Java is already installed on the server using this command:

which java

If there is no output, it means that Java is not installed on the server yet. We can install Java from a RPM package:

yum install java-1.8.0-openjdk.x86_64

We can check the Java version installed on the server by running the following command:

java -version

The output should be similar to this:

openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

Add the “JAVA_HOME” and “JRE_HOME” environment variables at the end of /etc/bashrc file:

sudo vi /etc/bashrc

Append the following lines to the original content of the file:

export JRE_HOME=/usr/lib/jvm/jre
export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk
PATH=$PATH:$JRE_HOME:$JAVA_HOME

Open the ~/.bashrc file and make sure that the following lines exist:

if [ -f /etc/bashrc ] ; then
  . /etc/bashrc
fi

Run the following command to activate the path settings immediately:

source /etc/bashrc

Step 4: Install Apache Kafka

Create a new system user dedicated for the Kafka service using the following command:

useradd kafka -m

Set a password for the newly created user:

passwd kafka

Use a strong password and enter it twice. Then, run the following command on the server:

sudo usermod -aG wheel kafka

Log in as the newly created user with:

su kafka

Download the latest version of Apache Kafka available at https://kafka.apache.org/downloads and extract it in the home directory of the kafka user account:

cd ~
wget http://apache.osuosl.org/kafka/2.1.0/kafka_2.12-2.1.0.tgz
tar -xvzf kafka_2.12-2.1.0.tgz
mv kafka_2.12-2.1.0/* .
rmdir /home/kafka/kafka_2.12-2.1.0

Apache Kafka uses ZooKeeper to store persistent cluster metadata, so we need to install ZooKeeper. The ZooKeeper files are included with Apache Kafka. ZooKeeper is running on port 2181 and it doesn’t require much maintenance. The ZooKeeper service is responsible for configuration management, leader detection, synchronization, etc.
Create a ZooKeeper systemd unit file so that we can run ZooKeeper as a service:

sudo vi /lib/systemd/system/zookeeper.service
[Unit]
Requires=network.target remote-fs.target
After=network.target remote-fs.target

[Service]
Type=simple
User=kafka
ExecStart=/home/kafka/bin/zookeeper-server-start.sh /home/kafka/config/zookeeper.properties
ExecStop=/home/kafka/bin/zookeeper-server-stop.sh
Restart=on-abnormal

[Install]
WantedBy=multi-user.target

Create a systemd unit file for Apache Kafka:

sudo vi /etc/systemd/system/kafka.service

Add the following lines:

[Unit]
Requires=network.target remote-fs.target zookeeper.service
After=network.target remote-fs.target zookeeper.service

[Service]
Type=simple
User=kafka
ExecStart=/home/kafka/bin/kafka-server-start.sh /home/kafka/config/server.properties
ExecStop=/home/kafka/bin/kafka-server-stop.sh
Restart=on-abnormal

[Install]
WantedBy=multi-user.target

Edit the server.properties file and add/modify the following settings:

vi /home/kafka/config/server.properties
listeners=PLAINTEXT://:9092
log.dirs=/var/log/kafka-logs

After we make changes to a unit file, we should run the ‘systemctl daemon-reload‘ command for the changes to take effect:

systemctl daemon-reload

Create a new directory ‘kafka-logs’ in the ‘/var/log/‘ directory on your server:

sudo mkdir -p /var/log/kafka-logs
chown kafka:kafka -R /var/log/kafka-logs

This can be useful for troubleshooting. Once that’s done, start the ZooKeeper and Apache Kafka services:

sudo systemctl start zookeeper.service
sudo systemctl start kafka.service

Enable the ZooKeeper and Apache Kafka services to automatically start on server boot:

systemctl enable zookeeper.service
systemctl enable kafka.service

In order to check if ZooKeeper and Kafka services are up and running, run the following commands on the VPS:

systemctl status zookeeper.service

We should receive an output similar to this:

zookeeper.service
   Loaded: loaded (/usr/lib/systemd/system/zookeeper.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-01-25 12:42:42 CST; 16s ago
 Main PID: 11682 (java)
   CGroup: /system.slice/zookeeper.service
           └─11682 java -Xmx512M -Xms512M -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.h...
systemctl status kafka.service

The output of this command should be similar to this one:

kafka.service
   Loaded: loaded (/etc/systemd/system/kafka.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-01-25 12:42:50 CST; 42s ago
 Main PID: 11991 (java)
   CGroup: /system.slice/kafka.service
           └─11991 java -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headl...

We can also use the netstat command to check if Kafka and ZooKeeper services are listening on ports 9092 and 2181 respectively:

sudo netstat -tunlp | grep -e \:9092 -e \:2181
tcp6       0      0 :::9092                 :::*                    LISTEN      11991/java
tcp6       0      0 :::2181                 :::*                    LISTEN      11682/java

That is it. We successfully installed Apache Kafka.


Of course, you don’t have to install and configure Apache Kafka on CentOS 7, if you use one of our Fully Managed CentOS Support solutions, in which case you can simply ask our expert Linux admins to setup and configure Apache Kafka on CentOS 7 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 Apache Kafka on a CentOS 7 VPS, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

The post How to Install Apache Kafka on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-centos-7/feed/ 4
How to Install Jupyter on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-jupyter-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-jupyter-on-centos-7/#comments Thu, 23 Apr 2020 15:27:13 +0000 https://linuxhostsupport.com/blog/?p=1117 In this tutorial, we will go over the steps necessary to install Jupyter Notebook on a CentOS server. Jupyter Notebook is a popular and widely used open-source web-based software that allows users to create and share documents that contain live code, equations, visualizations, and narrative text. Jupyter Notebook can be used for data cleaning and […]

The post How to Install Jupyter on CentOS 7 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will go over the steps necessary to install Jupyter Notebook on a CentOS server.

Jupyter Notebook is a popular and widely used open-source web-based software that allows users to create and share documents that contain live code, equations, visualizations, and narrative text.

Jupyter Notebook can be used for data cleaning and transformation, numerical simulations, statistical modeling, data visualization, machine learning, and much more. It has support for over 40 programming languages, including Python, Scala, R, and Julia. Let’s get started with the installation.

Prerequisites

  • CentOS 7 VPS with 2 GB of memory
  • SSH access with root privileges

Step 1. Log in via SSH and Update the System

Login to your CentOS 7 VPS via SSH as a non-root sudo user:

ssh account@IP_Address -p Port_number

Replace “IP_Address” and “Port_number” with your server’s IP and port number. Also, replace “account” with the account you intend to log in with.

Make sure that all installed packages on the server are updated to the latest available version by running the following command:

sudo yum update

Install the bzip2 package with:

sudo yum install bzip2

Step 2. Install Jupyter Notebook using Anaconda

It is recommended to install Python and Jupyter using the Anaconda Distribution, which includes Python, the Jupyter Notebook, and other machine learning and data science related packages.

At the time of writing this article, the latest version of Anaconda was 5.3.0. Before downloading the installation script, you should check the Anaconda Download page for a new version.

Use the following comamnd to download the latest Anaconda installation script:

wget https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh

Once the download is complete, start the Anaconda installation by running the script:

bash Anaconda3-5.3.0-Linux-x86_64.sh
Welcome to Anaconda3 5.3.0

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>

The script will ask you to accept the license. Press ENTER to continue, and then press ENTER to scroll through the license.

Do you accept the license terms? [yes|no]
[no] >>>
Please answer 'yes' or 'no':'

Type ‘yes’ and hit ENTER – you will then be prompted to accept the default Anaconda installation path:

Anaconda3 will now be installed into this location:
/home/rh/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

Press ENTER to confirm, after which the Anaconda installation will begin.

Once the installation is completed, the installer will ask you if you want to prepend the Anaconda install location to the PATH in your ~/.bashrc file.

Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/rh/.bashrc ? [yes|no]

Type ‘yes’ and hit ENTER. This output will follow:

Appending source /home/rh/anaconda3/bin/activate to /home/rh/.bashrc
A backup will be made to: /home/rh/.bashrc-anaconda3.bak


For this change to become active, you have to open a new terminal.

Thank you for installing Anaconda3!

===========================================================================

Anaconda is partnered with Microsoft! Microsoft VSCode is a streamlined
code editor with support for development operations like debugging, task
running and version control.

To install Visual Studio Code, you will need:
  - Administrator Privileges
  - Internet connectivity

Visual Studio Code License: https://code.visualstudio.com/license

Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]

Once the Anaconda installation is completed, the installer will ask you if you want to install Microsoft VSCode. Type ‘no’ and press ENTER. The installer will then quit.

To activate your Anaconda installation, run:

source ~/.bashrc

Verify the Anaconda installation by running the following command:

conda --version
conda 4.5.11

Step 3. Start Jupyter Notebook

Now that you have Anaconda and Jupyter Notebook installed on your CentOS 7 server, you can start the Notebook using the following command:

jupyter notebook

You will see an output similar to the following:

[I 03:24:08.155 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 03:24:08.826 NotebookApp] JupyterLab extension loaded from /home/rh/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 03:24:08.826 NotebookApp] JupyterLab application directory is /home/rh/anaconda3/share/jupyter/lab
[I 03:24:08.837 NotebookApp] Serving notebooks from local directory: /home/rh
[I 03:24:08.839 NotebookApp] The Jupyter Notebook is running at:
[I 03:24:08.839 NotebookApp] http://localhost:8888/?token=5e025ea9fc174fbaaacfb71511152f130cfec017da50d431
[I 03:24:08.839 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 03:24:08.840 NotebookApp] No web browser found: could not locate runnable browser.
[C 03:24:08.840 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=5e025ea9fc174fbaaacfb71511152f130cfec017da50d431

The Jupyter Notebook server by default is listening on localhost port 8888. If this port is not available, you can specify another port using the “–port” flag. If you want to listen on all interfaces use “–ip=’*'”

Jupyter Notebook provides help messages for all available command line arguments. If you need help with using Jupyter, run the following command:

jupyter notebook --help

Open your favorite web browser and navigate to the URL shown above. Once the application is opened, the Notebook Dashboard will be displayed and it will show a list of the notebooks, files, and sub-directories in the directory where you executed the command and the notebook server was started

For detailed information on how to configure and use Jupyter Notebook, please check their documentation.


Of course, you don’t have to Install Jupyter Notetbook on CentOS 7, if you use one of our Fully Managed VPS Support services, in which case you can simply ask our expert Linux admins to install Jupyter Notebook for you, along with anything else that you might need. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on How to Install Jupyter on a CentOS 7, please share it with your friends on the social networks using the share shortcuts, or simply leave a reply in the comments section. Thanks.

The post How to Install Jupyter on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-jupyter-on-centos-7/feed/ 1
How to Install SOPlanning on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-soplanning-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-soplanning-on-ubuntu-18-04/#respond Thu, 16 Apr 2020 17:03:52 +0000 https://linuxhostsupport.com/blog/?p=1103 In this tutorial, we will show you how to install SOPlanning on an Ubuntu 18.04 server along with installing the Apache web server. SOPlanning is a simple and open-source online planning tool designed to efficiently organize projects and tasks. It allows you to easily manage and plan your working tasks and assignments for each person […]

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

]]>
In this tutorial, we will show you how to install SOPlanning on an Ubuntu 18.04 server along with installing the Apache web server.

SOPlanning is a simple and open-source online planning tool designed to efficiently organize projects and tasks. It allows you to easily manage and plan your working tasks and assignments for each person of your team. This tool is very useful for any projects, small businesses, production plants, booking systems, vacation management systems, and so on. Let’s begin with the installation.

Requirements:

  • For the purposes of this tutorial, we will be using an Ubuntu VPS.
  • You will also need a working LAMP (Linux, Apache, MySQL, PHP) stack. If you don’t have one set up already, don’t worry – we will also show you how to install your own LAMP stack as a part of this tutorial.
  • Full SSH root user access – or a user with sudo privileges – is also required.

Step 1: Connect to Your Server

Before we begin, you will need to connect to your server via SSH as the root user or as any other user that has sudo privileges.

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

ssh root@IP_ADDRESS -p PORT_NUMBER

Make sure to 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:

sudo apt update
sudo apt upgrade

Always keep your system updated, as it maximizes compatibility and performance of your server.

Step 2: Install Apache

Apache is a fast and secure web server – in fact, it’s one of the most popular and widely used web servers in the world. Its ease of use and quick and easy setup makes it perfect for this tutorial.

To install Apache on your Ubuntu 18.04 server, run the following command:

sudo apt install apache2

Once the installation is complete, enable the Apache service to start automatically upon system boot. You can do that with the following command:

sudo systemctl enable apache2

To verify that Apache is running, execute the following command:

sudo systemctl status apache2

Output:

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Fri 2019-06-21 15:04:25 CDT; 38s ago
  Process: 716 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 829 (apache2)
    Tasks: 6 (limit: 2321)
   CGroup: /system.slice/apache2.service
           ├─829 /usr/sbin/apache2 -k start
           ├─854 /usr/sbin/apache2 -k start
           ├─855 /usr/sbin/apache2 -k start
           ├─857 /usr/sbin/apache2 -k start
           ├─858 /usr/sbin/apache2 -k start
           └─859 /usr/sbin/apache2 -k start

You can also open your web browser and enter your server’s IP address, (e.g. http://your-ip-address). If Apache was successfully installed, you should see a message in your web browser saying “It works!”.

Step 3: Install MySQL

The next step is to install MySQL. It is one of the most popular database management systems.

To install MySQL on your system, type the following command and enter the character ‘Y’ when prompted:

sudo apt install mysql-server

During the installation, you will be asked to enter a password for the MySQL root user. Make sure to enter a strong password.

To further improve the security of our MySQL installation as well as set up a password for our MySQL root user, we need to run the mysql_secure_installation script and follow the on-screen instructions. Run the command below to configure your system:

sudo mysql_secure_installation

If the program asks you to enter your current MySQL root password, just press your [Enter] key once, as no password is set by default when installing MySQL.

A few more questions will be displayed on-screen – it is recommended that you answer yes to all of them by entering the character ‘Y’:

Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y

Again, we can enable MySQL to start on boot with the following command:

sudo systemctl enable mysql

That’s it – MySQL has been installed and made more secure, and is now ready for use.

Step 4: Install PHP

The last step of our LAMP stack setup is to install PHP. Ubuntu 18.04 comes with PHP 7.2 by default.

We will also include some additional modules in order to help PHP to connect with our Apache and MySQL servers. On top of these, we will install modules that are required by our SOPlanning application.

To do this, type the following command:

sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mysql php7.2-cli php7.2-opcache php7.2-gd php7.2-curl php7.2-cli php7.2-imap php7.2-mbstring php7.2-soap 7.2-xmlrpc php7.2-xml php7.2-zip

To verify that PHP 7.2 is successfully installed, run the following command:

php -v

You should get the following output on your screen:

PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

Step 5: Download SOPlanning

We can now start with our SOPlanning setup and configuration.

We can download the latest SOPlanning version with the following command:

wget https://sourceforge.net/projects/soplanning/files/latest/download -O soplanning.zip

Next, to extract the file in the /var/www directory on your server, execute the following command:

sudo unzip soplanning.zip -d /var/www

The owner of the files needs to be the user of the web server running on your system. In our example, we are using the Apache web server and Apache runs under the “www-data” user on Ubuntu.  To change the owner of the files, you can then run the following command:

sudo chown -R www-data:www-data /var/www/soplanning/

Step 6: Create the Database

Next, we need to create a new database. To do this, log in to your MySQL database server as the root user by typing the following command:

sudo mysql -u root -p

To create a new database and user, run the following commands on the MySQL shell:

CREATE DATABASE soplanning;
CREATE USER soplanning@localhost IDENTIFIED BY 'strong-password';
GRANT ALL PRIVILEGES ON soplanning.* TO soplanning@localhost;
FLUSH PRIVILEGES;

Note: Make sure to replace strong-password with an actual strong password.

To exit the MySQL database server command line, type:

exit

Step 7: Configure Apache

In this step, we will show you how to create a virtual host file for Apache – this is so you can access your SOPlanning installation using your domain name.

Create the virtual host file by executing the following command:

nano /etc/apache2/sites-available/soplanning.conf

And enter the following information:

<VirtualHost *:80>
     DocumentRoot /var/www/soplanning
     ServerName mydomain.com ServerAlias www.mydomain.com <Directory /var/www/soplanning/> Options FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/soplanning_error.log CustomLog ${APACHE_LOG_DIR}/soplanning_access.log combined </VirtualHost>

Make sure to replace mydomain.com with your actual domain name.

To enable the new SOPlanning virtual host, run the following command:

sudo a2ensite soplanning.conf

You should see the following output:

Enabling site soplanning.
To activate the new configuration, you need to run:
systemctl reload apache2

Reload your Apache in order to activate the new configuration:

sudo systemctl reload apache2

Step 8: Install and Access SOPlanning

You can now open your preferred web browser and access your SOPlanning installation at http://mydomain.com (of course, make sure to replace mydomain.com with the actual domain name you used when creating the Apache virtual server block).

 

Enter your database information from Step 6 of the tutorial and click on the ‘Launch install’ button.

After the installation is completed, you will be provided with the default admin login credentials and a link to your admin login page.

Click on the link to login to your admin panel. Also, make sure to update your admin password as soon as you log in.

That’s it! SOPlanning has been successfully installed on your Ubuntu 18.04 server.


Of course, you don’t have to install SOPlanning on Ubuntu 18.04 if you use one of our Managed Server Support Services with us. If you do, you can simply ask our support team to install SOPlanning on Ubuntu 18.04 for you, along with anything else that you might need. They are available 24/7 and will be able to help you with the installation.

PS. If you enjoyed reading this blog post on how to install SOPlanning on Ubuntu 18.04, feel free to share it on social networks using the shortcuts below, or simply leave a comment in the comments section. Thanks.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-soplanning-on-ubuntu-18-04/feed/ 0
How to Set Up and Use Yum Repositories on CentOS 7 https://linuxhostsupport.com/blog/how-to-set-up-and-use-yum-repositories-on-centos-7/ https://linuxhostsupport.com/blog/how-to-set-up-and-use-yum-repositories-on-centos-7/#comments Thu, 19 Mar 2020 22:40:36 +0000 https://linuxhostsupport.com/blog/?p=1085 This tutorial explains how to set up and use Yum repositories on a CentOS 7 VPS. The official CentOS 7 repository has a huge list of packages and it covers almost all bases in terms of software for servers, but sometimes we need some additional packages which are not available in the official repositories. In […]

The post How to Set Up and Use Yum Repositories on CentOS 7 appeared first on LinuxHostSupport.

]]>
This tutorial explains how to set up and use Yum repositories on a CentOS 7 VPS.

The official CentOS 7 repository has a huge list of packages and it covers almost all bases in terms of software for servers, but sometimes we need some additional packages which are not available in the official repositories. In that case, we can simply add new repositories to further expand the catalogue of packages available to us. Let’s begin with the tutorial.

Step 1. Login via SSH

Log in to your CentOS 7 VPS via SSH as the root user, or as an account with sudo privileges:

ssh root@IP_Address -p Port_number

Make sure to replace “IP_Address” and “Port_number” with your server’s IP address and SSH port.

Step 2. Update the OS Packages and Install the yum-utils Package:

Once you are logged in to the server, run the following commands to make sure that all installed packages are up to date:

yum clean all
yum update

Install the yum-utils package using the following command:

yum install yum-utils

We can enable the EPEL (Extra Packages for Enterprise Linux) repository on CentOS 7 / RHEL 7, maintained by a special Fedora Special Interest Group that creates, maintains, and manages high quality additional packages for enterprise Linux versions. This includes Red Hat Enterprise Linux (RHEL), CentOS, Scientific Linux (SL), and Oracle Enterprise Linux (OEL).

Step 3. Install the EPEL repository

To install the EPEL rpm, do so with the following command:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

The output will appear as shown below:

Retrieving https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:epel-release-7-11                ################################# [100%]

Check the newly installed repository. You should be able to find the EPEL repository in the list.

yum repolist

You should receive the following output, or something similar to it:

base                                                                                                            | 3.6 kB  00:00:00
epel/x86_64/metalink                                                                                            |  11 kB  00:00:00
epel                                                                                                            | 3.2 kB  00:00:00
extras                                                                                                          | 3.4 kB  00:00:00
updates                                                                                                         | 3.4 kB  00:00:00
(1/7): base/7/x86_64/group_gz                                                                                   | 166 kB  00:00:00
(2/7): base/7/x86_64/primary_db                                                                                 | 5.9 MB  00:00:00
(3/7): epel/x86_64/group_gz                                                                                     |  88 kB  00:00:00
(4/7): epel/x86_64/updateinfo                                                                                   | 934 kB  00:00:00
(5/7): updates/7/x86_64/primary_db                                                                              | 6.0 MB  00:00:00
(6/7): extras/7/x86_64/primary_db                                                                               | 204 kB  00:00:00
(7/7): epel/x86_64/primary                                                                                      | 3.6 MB  00:00:00
epel                                                                                                                       12739/12739
repo id                                         repo name                                                                      status
base/7/x86_64                                   CentOS-7 - Base                                                                9,901+10
epel/x86_64                                     Extra Packages for Enterprise Linux 7 - x86_64                                   12,739
extras/7/x86_64                                 CentOS-7 - Extras                                                                   432
updates/7/x86_64                                CentOS-7 - Updates                                                             1,543+71
repolist: 24,615

In order to see all of the packages available in the EPEL repository, run the following command:

yum --enablerepo=epel list | less

The output of this command will show you the list of packages.

Note: Other CentOS repositories that can be useful are located in /etc/yum.repos.d directory. When enabling some repository manually by editing the .repo file, make sure that the main version for CentOS is used in the repo file, in this case, it is CentOS 7.

For example, edit the CentOS-Base.repo file and add/modify these lines:

[base]
name=CentOS $releasever – Base
baseurl=http://mirror.centos.org/centos/7/os/$basearch/
gpgcheck=0
enabled=1

[updates]
name=CentOS $releasever – Updates
baseurl=http://mirror.centos.org/centos/7/updates/$basearch/
gpgcheck=0
enabled=1

[extras]
name=CentOS $releasever – Extras
baseurl=http://mirror.centos.org/centos/7/extras/$basearch/
gpgcheck=0
enabled=1

Listing all repositories

To list all repositories, including all enabled and disabled repositories, run:

yum repolist all

Enabling a Yum Repository

To enable a Yum repository, run the following command as root:

yum-config-manager --enable repository <repository name>

Disabling a Yum Repository

To disable a Yum repository, run the following command as root:

yum-config-manager --disable repository <repository name>

Do not forget to replace <repository name> with the actual repo name.

If for some reason we cannot find the software package we need in the official and EPEL repositories, we can extend the capabilities of the server with even more software by adding additional repositories, like the Remi RPM repository, which is not an official repository of CentOS distribution but is well maintained and always up to date.

Remi Collet maintains a large collection of RPM packages, including the latest versions of PHP, etc. Please note that this repo does not always play nicely with other third party CentOS repos, so check the list of repositories using yum repolist and disable additional repositories if there are any package conflicts.

We can install the Remi repository using this next command:

rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

If for example we want to enable PHP 7.2 , we can edit the /etc/yum.repos.d/remi-php72.repo file and change enabled=0 to enabled=1 :

# This repository only provides PHP 7.2 and its extensions
# NOTICE: common dependencies are in "remi-safe"

[remi-php72]
name=Remi's PHP 7.2 RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/php72/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/7/php72/httpsmirror
mirrorlist=http://cdn.remirepo.net/enterprise/7/php72/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Another good unofficial CentOS repository is the Webtatic Repo. This repository provides updated packages with later versions of PHP, MySQL, and other packages. With this information, you can now install any repository of your choosing and expand the functionality of your server in any way that you need to.


Of course, you don’t have to setup and configure additional repositories on CentOS 7, if you use our Fully Managed VPS Support solutions, in which case you can simply ask our expert Linux admins to configure additional repositories on CentOS 7 for you, along with anything else that you might need. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to set up and use Yum repositories on a CentOS VPS, please share it with your friends on the social networks using the sharing shortcut, or simply leave a reply below. Thanks.

The post How to Set Up and Use Yum Repositories on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-set-up-and-use-yum-repositories-on-centos-7/feed/ 3
How to Install GCC on Debian 9 https://linuxhostsupport.com/blog/how-to-install-gcc-on-debian-9/ https://linuxhostsupport.com/blog/how-to-install-gcc-on-debian-9/#comments Sat, 14 Mar 2020 20:50:44 +0000 https://linuxhostsupport.com/blog/?p=1076 In this guide, we will walk you through the steps of installing GCC on a server running Debian 9 using two different methods: using the APT package manager (Advanced Package Tool), and installation from source. GCC, also known as the GNU Compiler Collection, is developed by Richard Stallman and was released by the Free Software Foundation. GCC […]

The post How to Install GCC on Debian 9 appeared first on LinuxHostSupport.

]]>
In this guide, we will walk you through the steps of installing GCC on a server running Debian 9 using two different methods: using the APT package manager (Advanced Package Tool), and installation from source.

GCC, also known as the GNU Compiler Collection, is developed by Richard Stallman and was released by the Free Software Foundation. GCC is a very useful and widely-used collection of programming compilers, such as C, C++, Objective-C, Fortran, Objective-C++, Java, Go, and Ada. GCC is an official compiler of the GNU operating system, but it is also a standard compiler on many Unix operating systems such as Linux. Let’s get started with the installation.

Prerequisites

  • VPS hosting plan with Debian 9 OS
  • System user with root privileges. (All our VPS hosting plans come with full root access)
  • Build-essential package, which contains several packages essential for building Debian packages including gcc compiler, make and other required tools.

Step 1. Log in and Update the Server

Login to your Debian 9 VPS via SSH as user root

ssh root@IP_Address -p Port_Number

Replace IP_Address and Port_Number with the actual IP and SSH port for your server.

Update all installed packages on the server by running the following command:

apt update &&  apt upgrade

It is recommended to always keep your services updated whenever a new version comes out. This maximizes security and compatibility between packages.

Step 2: Install GCC

Method 1: Install GCC from a Repository

GCC is available in the official Debian 9 repositories and it can be easily installed using the APT package manager. To install GCC on your server, run the following command:

apt -y install gcc

This will install GCC and all its necessary dependencies. Once the installation completes, you can execute the following command to check the version of GCC installed on your server

gcc --version

Output:

gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

As you might see from the output, GCC version 6.3.0 is installed, which is not the latest release. The current stable version of GCC at the time of the article being written is version 8.2, and if you want to install it on your server, you can check the next step.

Method 2: Install GCC from Source

If you need a more recent version of GCC than 6.3.0 which at the moment of writing this article is the latest one distributed with Debian 9, you can install GCC from source. Download the archive of GCC version 8.2 to your server. This version has some prominent changes, new features, and improvements over its predecessors.

cd /opt
wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-8.2.0/gcc-8.2.0.tar.gz

Unpack the downloaded tarball and change the working directory:

tar zxf gcc-8.2.0.tar.gz
cd gcc-8.2.0

Execute the following script to download some prerequisites required by GCC

./contrib/download_prerequisites

You should get an output similar to this one:

ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 [2383840] -> "./gmp-6.1.0.tar.bz2" [1]
ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2 [1279284] -> "./mpfr-3.1.4.tar.bz2" [1]
ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz [669925] -> "./mpc-1.0.3.tar.gz" [1]
ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2 [1658291] -> "./isl-0.18.tar.bz2" [1]
gmp-6.1.0.tar.bz2: OK
mpfr-3.1.4.tar.bz2: OK
mpc-1.0.3.tar.gz: OK
isl-0.18.tar.bz2: OK
All prerequisites downloaded successfully.

At this point, we are ready to configure GCC 8.2. Install the build-essential package and run the following command to start configuring GCC for the install process:

apt -y install build-essential
./configure --disable-multilib

After the configuration completes, compile the source code by running the following command. NOTE: Depending on the server’s resources, the compiling may take a while:

make -j 4
make install

Once the compilation is completed, execute the following command verify that GCC version 8.2 is properly installed on your server:

gcc --version

gcc (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

With this step, the process of installing the latest version of GCC on your Debian 9 server has been completed. If you need more information about GCC, its usage, configuration, and features, you can check GCC’s official documentation.


Of course, you don’t have to install GCC on Debian 9 if you use one of our Managed Server Support services, in which case you can simply ask our expert Linux admins to install and configure GCC for you, along with anything else that you might need. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to install GCC on Debian 9, please share it with your friends on the social networks using the share shortcuts, or simply leave a reply in the comments section. Thanks.

The post How to Install GCC on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-gcc-on-debian-9/feed/ 1
What is the Wait Command in Linux? (With Examples) https://linuxhostsupport.com/blog/what-is-the-wait-command-in-linux-with-examples/ https://linuxhostsupport.com/blog/what-is-the-wait-command-in-linux-with-examples/#respond Wed, 04 Mar 2020 21:19:00 +0000 https://linuxhostsupport.com/blog/?p=1066 In this tutorial, we will explain what the wait command is, as well as providing a few usage examples so that you can better understand how to use it on a Linux VPS. wait is a versatile tool which you can use in Linux to determine when a given process or job is completed. It will return […]

The post What is the Wait Command in Linux? (With Examples) appeared first on LinuxHostSupport.

]]>
In this tutorial, we will explain what the wait command is, as well as providing a few usage examples so that you can better understand how to use it on a Linux VPS.

wait is a versatile tool which you can use in Linux to determine when a given process or job is completed. It will return its termination status as a result, with which you can understand whether the process completed successfully or if it failed for some reason. While this command looks similar to the sleep command, they fulfill different purposes. Let’s get into it.

wait is different from sleep. Many users which are new in Linux find it difficult to understand the difference between these two. In general, these two commands are quite different and are used for different types of tasks. As we mentioned earlier, the wait command waits for a process to finish and it returns the termination status. On the other hand, sleep is typically used to delay a certain job for a specified amount of time. You will often need to use these two commands in your custom bash shell scripts, so it is important to understand the difference. Let’s get into that.

To test how the wait command works, you will need to connect to your Linux server via SSH. Log in to your server and start a simple process in the background. Run the following command in your terminal to do so:

sleep 60 &

The command above will start a process in the background. That process will run for 60 seconds, after which it will be terminated. The output of the command will be the PID of the process, so you will see something like this on your screen:

# sleep 60 &
[4] 4455

In this case 4455 is the PID of the process. In order to find the PID of a different process, you can use the following command:

ps axuwf | grep "sleep 60" | grep -v grep | awk {'print $2'}

where "sleep 60" is the name of the command/process. In our example, it will return the following:

# ps axuwf | grep "sleep 60" | grep -v grep | awk {'print $2'}
4455

Now that you know the PID of the process, you can run wait and wait for the process to complete in order to see the termination status.

wait 4455

Once the process finishes, you will see the following in your terminal:

# wait 4455
[3]   Done                    sleep 60

The output tells you that the sleep 60 process is done and no longer running on your Linux VPS.

As you can see in the example above, you need to pass the process ID as the argument to wait. Basically, wait will return the termination status for any and all specified processes. You can specify multiple processes at once by providing the process ID or a job specification. If you provide a job specification, all processes in that job’s pipeline are waited for and considered.

The wait command comes in handy when you need to run a specific command after some or all of the processes are finished. You will find this useful when writing shell scripts or other programs. The example below shows you how to use wait in a shell script.

Create a new shell script in the /opt directory:

cd /opt
nano wait.sh

You can use a text editor of your choice, we are using nano in our example. Paste the following lines in the file:

#!/bin/bash
echo "Process 1 is running for 5 seconds ..." && sleep 5 &
PID=$!
echo "Process 2 is running for 15 seconds ..." && sleep 15 &
wait $PID
echo "Process 1 exited with status $?"
wait $!
echo "Process 2 exited with status $?"

Save the file and close it. Once you close the file, make it executable using the following command:

chmod a+x wait.sh

To run the shell script that you just created, use the following command:

./wait.sh

Once you run the shell script, you will see the following output in your terminal:

Process 1 is running for 5 seconds ...
Process 2 is running for 15 seconds ...
Process 1 exited with status 0
Process 2 exited with status 0

As you can see in the example, both processes are started and running for the specified number of seconds. Once they are finished, the output with their termination status will be echoed on the screen. Of course, you can modify the script and try different tasks to better learn how the wait command works. Hopefully, you will find it useful.


If you are one of our Managed Linux Hosting Support customers, you can always ask our expert Linux system admins to help you with any aspect of using or configuring your server. They are available 24/7 and can take care of your request immediately.

PS. If you liked this post on what the Linux wait command is, please share it with your friends on the social networks using the share shortcuts, or simply leave a reply below. Thanks.

The post What is the Wait Command in Linux? (With Examples) appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/what-is-the-wait-command-in-linux-with-examples/feed/ 0
How to Install Apache Kafka on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-ubuntu-16-04/#respond Thu, 16 Jan 2020 13:13:15 +0000 https://linuxhostsupport.com/blog/?p=1031 In this tutorial, we will show you how to install and configure Apache Kafka on an Ubuntu 16.04 VPS. Apache Kafka is one of the most popular open-source stream processing software platforms available. Developed by the Apache Software Foundation, Apache Kafka is written in Scala and Java. The project aims to provide a unified, high-throughput, […]

The post How to Install Apache Kafka on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to install and configure Apache Kafka on an Ubuntu 16.04 VPS.

Apache Kafka is one of the most popular open-source stream processing software platforms available. Developed by the Apache Software Foundation, Apache Kafka is written in Scala and Java. The project aims to provide a unified, high-throughput, low-latency platform for handling real-time data feeds. It’s a scalable, fault-tolerant, publish-subscribe messaging system that allows you to build distributed applications. Let’s begin with the installation.

Prerequisites:

  • A server with a minimum of 4GB of RAM is required. This tutorial focuses on installing Apache Kafka on a VPS running Ubuntu 16.04 Server, but this may work with other distrubutions, or newer versions of Ubuntu Server.
  • SSH root access to the server, or a user account with administrative access.

Step 1. Getting Started

First, you need to log in to your server via SSH as the root user or as an admin account:

ssh root@IP_ADDRESS -p PORT_NUMBER

and replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number.

Before we begin with the installation, let’s make sure that your Ubuntu 16.04 server is up-to-date by running the following commands:

apt-get update
apt-get upgrade

Step 2. Install Java

Kafka is a Java based application, so we will need to install OpenJDK 8 on our server. To do this, run the following command:

apt-get install openjdk-8-jdk

To verify if the installation is completed, you can execute the following command:

java -version

The following output should be displayed on your screen:

openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.16.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

Step 3. Install ZooKeeper

ZooKeeper is an open-source service for maintaining configuration information, providing distributed synchronization, naming and providing group services, and so on. We will be using this service to manage the Kafka cluster state.

We can install ZooKeeper from the Ubuntu’s default repository with the following command:

apt-get install zookeeperd

The service should be running on port 2181 by default. To confirm if the installation is completed and if the service is running, we can run the following command:

netstat -tnlp | grep :2181

The following output confirms that the service is running:

tcp6 0 0 :::2181 :::* LISTEN

You can also use the following command to check the status of the service:

systemctl status zookeeper

To stop the service, you can run:

systemctl stop zookeeper

And to start the service:

systemctl start zookeeper

Step 4. Create a Kafka User

For security reasons, it is recommended that we create a dedicated user for our Kafka service.

To create a new user with a dedicated home directory, execute the following command:

useradd kafka -m

Once the user is created, you can set a new password for it with:

passwd kafka

Make sure you enter a strong password and press [Enter]. Next, add the user to the sudo group with:

adduser kafka sudo

And log in as the kafka user with:

su kafka

Step 5. Install Apache Kafka

Let’s create a new directory for our Apache Kafka installation with:

mkdir ~/kafka

You can then navigate to this directory with:

cd ~/kafka

Next, find the download link of the latest Apache Kafka installation from this page: https://kafka.apache.org/downloads

You can use the wget command to download the file. The command below might be an older version of Apache Kafka:

wget http://www.trieuvan.com/apache/kafka/2.1.0/kafka_2.11-2.1.0.tgz

Extract the archive in the current directory with:

tar -xvzf kafka_2.11-2.1.0.tgz --strip 1

You can also delete the original installation file with:

rm kafka_2.11-2.1.0.tgz

To create a systemd startup service for Kafka, run the following command:

nano /etc/systemd/system/kafka.service

Enter the following content and save the file:

[Unit]
Requires=zookeeper.service
After=zookeeper.service

[Service]
User=kafka
ExecStart=/home/kafka/kafka/bin/kafka-server-start.sh /home/kafka/kafka/config/server.properties
ExecStop=/home/kafka/kafka/bin/kafka-server-stop.sh
[Install]
WantedBy=multi-user.target

The service will also check and make sure that the ZooKeeper service we have set up previously is also up and running before it attempts to start the Kafka service.

You can now try to start the Kafka service with the following command:

systemctl start kafka

To check the status of the Kafka service and make sure it is properly started, run the following command:

systemctl status kafka

You should see the following output on your screen:

● kafka.service
Loaded: loaded (/etc/systemd/system/kafka.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2018-11-28 12:31:10 CST; 9s ago
Main PID: 10583 (java)
CGroup: /system.slice/kafka.service

To make sure that the Kafka service gets started automatically after a server reboot, run the following command:

systemctl enable kafka

That’s it. Apache Kafka has been installed and it is now running on your server.


Of course, you don’t have to install Apache Kafka on Ubuntu 16.04 if you use one of our Managed VPS Support services, in which case you can simply ask our expert Linux admins to install and configure Apache Kafka for you, as well as set up any additional software that you might need. They are available 24×7 and will take care of your request immediately.

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

The post How to Install Apache Kafka on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-ubuntu-16-04/feed/ 0
How to Install Nagios Core on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-nagios-core-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-nagios-core-on-ubuntu-16-04/#comments Wed, 11 Dec 2019 21:01:44 +0000 https://linuxhostsupport.com/blog/?p=1013 This tutorial explains how to install Nagios Core on an Ubuntu 16.04 server. Nagios is an open source enterprise-class software that is used to monitor network infrastructures, servers and applications. With Nagios you can monitor Linux and Windows servers as well as web applications, Linux and Unix applications and Windows applications. The features include parallelized […]

The post How to Install Nagios Core on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
This tutorial explains how to install Nagios Core on an Ubuntu 16.04 server. Nagios is an open source enterprise-class software that is used to monitor network infrastructures, servers and applications. With Nagios you can monitor Linux and Windows servers as well as web applications, Linux and Unix applications and Windows applications. The features include parallelized service checks, plugin system, notifications via email, pager or user defined service, web interface for viewing status, log files, problem history and notifications and much more.

This guide should work on other Linux VPS systems as well, such as the latest versions of Ubuntu, but it was tested and written for Ubuntu 16.04.

Step 1. Update your Ubuntu 16.04 server and Install the Necessary Packages

Log in to your VPS via SSH as a sudo user:

ssh userame@IP_Address

Once you are logged in, issue the following commands to update the packages list and upgrade all installed packages:

sudo apt update
sudo apt upgrade

Next, install the install the prerequisite packages necessary for building Nagios and Nagios plugins with the following command:

sudo apt install autoconf gcc libc6 make wget unzip libgd2-xpm-dev

Step 2. Install Apache and PHP 7

To install Apache, PHP 7, and all the necessary modules on your Ubuntu 16.04 server, run the following command:

sudo apt install apache2 php libapache2-mod-php7.0

When the Apache installation is complete, run the following command to enable Apache to start on boot with:

sudo systemctl enable apache2.service

Step 3. Download and Install Nagios

Download the latest stable version of the Nagios tar archive in the /tmp directory on your server by running the following wget command:

wget https://github.com/NagiosEnterprises/nagioscore/releases/download/nagios-4.4.2/nagios-4.4.2.tar.gz -O /tmp/nagioscore.tar.gz

When the download is completed navigate to the /tmp directory extract the archive by issuing following command:

cd /tmp
sudo tar xf nagioscore.tar.gz

Once the Nagios Plugins archive is extracted, change to the nagios-4.4.2 directory:

cd /tmp/nagios-4.4.2

Next step is to run the ./configure script which will check your system for missing libraries and binaries and prepare the Nagios source code for the build process:

sudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled

The output will look like the following:

*** Configuration summary for nagios 4.4.2 2018-08-16 ***:

 General Options:
 -------------------------
        Nagios executable:  nagios
        Nagios user/group:  nagios,nagios
       Command user/group:  nagios,nagios
             Event Broker:  yes
        Install ${prefix}:  /usr/local/nagios
    Install ${includedir}:  /usr/local/nagios/include/nagios
                Lock file:  /run/nagios.lock
   Check result directory:  /usr/local/nagios/var/spool/checkresults
           Init directory:  /lib/systemd/system
  Apache conf.d directory:  /etc/apache2/sites-enabled
             Mail program:  /usr/bin/mail
                  Host OS:  linux-gnu
          IOBroker Method:  epoll

 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/nagios/
                  CGI URL:  http://localhost/nagios/cgi-bin/
 Traceroute (used by WAP):  /usr/sbin/traceroute


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the main program and CGIs.

Now that the configuration is completed start the compilation process using the make all command:

make all

Once completed the command will print the following output:

*** Support Notes *******************************************

If you have questions about configuring or running Nagios,
please make sure that you:

     - Look at the sample config files
     - Read the documentation on the Nagios Library at:
          library.nagios.com

before you post a question to one of the mailing lists.
Also make sure to include pertinent information that could
help others help you.  This might include:

     - What version of Nagios you are using
     - What version of the plugins you are using
     - Relevant snippets from your config files
     - Relevant error messages from the Nagios log file

For more information on obtaining support for Nagios, visit:

       support.nagios.com

*************************************************************

Enjoy.

Run the following command to create the Nagios user and group and add Apache to the Nagios group:

sudo make install-groups-users
sudo usermod -a -G nagios www-data

The next step is to install Nagios using the make install command:

sudo make install

Run the following command to install the Nagios sample configuration files:

sudo make install-config

Install the initialization script so that you can manage your Nagios service using the systemctl command :

sudo make install-daemoninit

Next, install the Apache web server configuration files with:

sudo make install-webconf

Restart apache service:

sudo systemctl restart apache2

Run the following command to create a user account called nagiosadmin

sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Next run the following command to install and configure the external command directory:

sudo make install-commandmode

Step 4. Install Nagios Plugins

Install the following dependencies necessary for downloading and compiling Nagios plugins:

sudo apt install autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext

Download the latest stable version of the Nagios tar archive in the /tmp directory on your server with:

wget --no-check-certificate -O /tmp/nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.2.1.tar.gz

When the download is completed change to the tmp directory extract the archive with the following commands:

cd /tmp
sudo tar xf nagios-plugins.tar.gz

Once the Nagios Plugins archive is extracted, change to the nagios-plugins-release-2.2.1 directory:

cd /tmp/nagios-plugins-release-2.2.1

The following commands will check your system for missing libraries and binaries and prepare the Nagios Plugins source code for the build process:

./tools/setup
./configure

When the configuration is complete start the compilation process using the make command:

make

Install the Nagios Plugins using the make install command:

sudo make install

Step 5. Access Nagios

Now that you have both Nagios and Nagios Plugins installed on your Ubuntu system, start the Nagios service with the following command:

systemctl start nagios

Check the service status with:

systemctl status nagios

The output will look something like bellow:

● nagios.service - Nagios Core 4.4.2
   Loaded: loaded (/lib/systemd/system/nagios.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-12-08 09:56:26 CST; 5s ago
     Docs: https://www.nagios.org/documentation
  Process: 16101 ExecStart=/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg (code=exited, status=0/SUCCESS)
  Process: 16098 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (code=exited, status=0/SUCCESS)
 Main PID: 16102 (nagios)

Open your browser and navigate to http://your-domain-or-ip/nagios and you will be presented with the login pop-up.

Enter the login credentials that you created earlier with the htpasswd command and you will be redirected to the Nagios home page as shown on the image below:

 

That’s it. You have successfully installed Nagios on Ubuntu 16.04. For more information about how to manage your Nagios installation, please refer to the official Nagios documentation.


Of course, you don’t have to install Nagios on Ubuntu 16.04 if you use one of our Fully-Managed Server Support services, in which case you can simply ask our expert system administrators to install Nagios 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 Nagios on Ubuntu 16.04, or if you found it helpful, please share it with your friends on the social networks using the sharing buttons, or simply leave a comment in the comments section. Thanks.

The post How to Install Nagios Core on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-nagios-core-on-ubuntu-16-04/feed/ 2
How to Install Moodle on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-moodle-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-moodle-on-ubuntu-18-04/#comments Wed, 13 Nov 2019 16:43:21 +0000 https://linuxhostsupport.com/blog/?p=966 In this tutorial, we will be installing Moodle on an Ubuntu 18.04 server. Moodle is a well-known open-source learning management system written in PHP. With its customizable features, people all over the world are using Moodle to create websites to run and manage their online courses. Moodle enables us to conduct face-to-face online learning and […]

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

]]>
In this tutorial, we will be installing Moodle on an Ubuntu 18.04 server.

Moodle is a well-known open-source learning management system written in PHP. With its customizable features, people all over the world are using Moodle to create websites to run and manage their online courses. Moodle enables us to conduct face-to-face online learning and training, as well as grading and testing. We can create assignments, quizzes, homework, and so on.

Moodle was originally released in 2002 and has been translated to over 100 languages ever since, making it accessible to as many students and teachers as possible. The installation process shouldn’t take much time, so let’s get started.

Moodle comes with a lot of useful features, such as:

  • A modern and easy-to-use interface
  • Personalized Dashboard
  • Collaborative tools and activities
  • All-in-one calendar
  • Simple text editor
  • Track progress
  • Notifications
  • and lots more…

Prerequisites:

  • Ubuntu 18.04
  • Apache/Nginx for the web server
  • PHP 7.0 or newer for Moodle itself
  • MySQL/MariaDB for the database server

Step 1. Log in via SSH and Update the System

Log in to your Ubuntu 18.04 VPS with SSH as the root user (or as an account with sudo privileges)

ssh root@IP_Address -p Port_number

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:

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

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

# apt update && apt upgrade

Step 2. Install a Web Server

In this tutorial, we will go over installing both of the most popular web server platforms available. Apache is more user-friendly, while Nginx is more customizable.

Both will do the job just fine, so you are free to pick either one. Make sure to not install both web servers.

Installing Apache

Run the following command to install Apache and other dependencies needed to proceed with the Moodle installation:

# apt install apache2 libapache2-mod-php mysql-server php-mysql php-gd php-intl php-xmlrpc php-soap php-cli php-zip php-mbstring php-curl php-xml php-pear php-bcmath php-fpm

Then, we need to enable the rewrite module in Apache.

# a2enmod rewrite
# systemctl restart apache2

Create an Apache virtual host

Make sure to replace “yourdomain.com” with your registered domain name. Create a new file using a text editor of your choice:

# nano /etc/apache2/sites-available/yourdomain.com.conf

Then enter the following content:

<VirtualHost *:80>
DocumentRoot /var/www/html/moodle/
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ServerAdmin admin@yourdomain.com

<Directory /var/www/html/moodle/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>

ErrorLog /var/log/apache2/yourdomain.com-error.log
CustomLog /var/log/apache2/yourdomain.com-access.log combined
</VirtualHost>

Save and close the file, then run the following to enable the configuration that we just created.

# a2ensite yourdomain.com

Then restart Apache:

# systemctl restart apache2

Nginx

If you prefer Nginx to Apache, you can skip the section above and invoke the following instead:

apt install nginx mysql-server php-mysql php-gd php-intl php-xmlrpc php-soap php-cli php-zip php-mbstring php-curl php-xml php-pear php-bcmath php-fpm

Then, let’s create an Nginx server block.

# nano /etc/nginx/sites-available/yourdomain.com.conf
server {
    listen 80;
    root /var/www/html/moodle;
    index index.php index.html index.htm;
    server_name yourdomain.com www.yourdomain.com;

    location / {
        try_files $uri $uri/ =404;
    }

    location /dataroot/ {
        internal;
        alias /var/www/html/moodledata/;
    }

    location ~ [^/]\.php(/|$) {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

Save the file then exit.

The server block is not enabled yet, we can enable it by running this command:

# ln -s /etc/nginx/sites-available/yourdomain.com.conf /etc/nginx/sites-enabled/

Then, restart nginx

# systemctl restart nginx

Step 3. Create database

We are going to use MySQL, and we installed MySQL server in the very first step of this tutorial

Now, you can skip the following step if you prefer not to have a MySQL root password.

# mysql_secure_installation

When prompted, answer the questions below by following the guide.

Enter current password for root (enter for none): Just press the [Enter] key, as no password is set by default
Set root password? [Y/n]: Y
New password: Enter password
Re-enter new password: Repeat 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

If you followed the above step, then you would have a password for MySQL root user, so you can run this command to access the MySQL shell.

# mysql -u root -p

Let’s proceed with creating a database for Moodle

mysql> create database moodle;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on moodle.* to moodle@localhost identified by 'm0d1fyth15';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit

Please change the password ‘m0d1fyth15‘ above to your desired one.

Step 4. Install Moodle

Before installing Moodle, we will download the latest stable version (at the time of writing this article) from Moodle’s official download page. You can check for the latest version at https://download.moodle.org/releases/latest/ .

# wget https://download.moodle.org/download.php/direct/stable36/moodle-3.6.2.tgz

Once downloaded, run the following command to extract the downloaded file.

# tar -xvf moodle-3.6.2.tgz

Modify the directory permission and restart apache.

# chown -R www-data: /var/www/html/moodle/

systemctl restart apache2

Finally, go to the domain http://yourdomain.com to complete the Moodle installation.

Choosing a Language for Moodle

Click on the ‘Next’ button to continue.

 

Modify the data directory, make sure the webserver has proper permission to access it, then click ‘Next’

Choosing Database Driver for Moodle

There are several options, but this time we are going to choose MySQL, click on ‘Next’ button to continue.

Setting the Database Settings for Moodle

In this step, make sure you are filling the database information that you created earlier, you can leave the database port and Unix socket blank, click on ‘Next’ button to continue.

Confirming Server Requirements are Met

 

You will see success messages – click on the ‘Continue’ button to proceed.

Creating an Admin Account

Complete all the required fields above then finish the installation.

Once installation is finished, click on continue to create the main administrator account. Then , click on update profile button.
Now, we need to configure the front page option.

Creating the Front Page

Congratulations! At this point Moodle has been successfully installed, and you can access it at http://yourdomain.com. For more information about Moodle, its features and configuration, please check their official documentation.


Of course, you don’t have to know how to install Moodle on Ubuntu 18.04 if you use one of our Managed VPS Support and Management services with us. You can simply ask our support team to install Moodle on an Ubuntu 18.04 server for you. They are available 24/7, and will be able to help you with the installation of Moodle on Ubuntu 18.04 at any time.

PS. If you enjoy reading this blog post on how to install Moodle on Ubuntu 18.04, feel free to share it on social networks using the share shortcuts, or simply leave a comment. Thank you.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-moodle-on-ubuntu-18-04/feed/ 4
How to Install MediaWiki on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-mediawiki-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-mediawiki-on-ubuntu-18-04/#comments Thu, 07 Nov 2019 21:38:18 +0000 https://linuxhostsupport.com/blog/?p=958 In this tutorial, we will show you how to install MediaWiki on Ubuntu 18.04 server. MediaWiki is a free and open-source application that allows anyone to create a wiki website of their own on a self-hosted server. MediaWiki is one of the most popular wiki platforms in the world, thanks to its ease of use and […]

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

]]>
In this tutorial, we will show you how to install MediaWiki on Ubuntu 18.04 server.

MediaWiki is a free and open-source application that allows anyone to create a wiki website of their own on a self-hosted server. MediaWiki is one of the most popular wiki platforms in the world, thanks to its ease of use and great customizability. MediaWiki is written in the PHP programming language, which leads to excellent performance as well. Let’s get started with the installation.

Step 1: Connect to Your Server

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

ssh root@IP_ADDRESS -p PORT_NUMBER

Then replace “IP_ADDRESS” and “PORT_NUMBER” with the actual server IP address and SSH port number (if necessary).

Step 2: Update the OS Packages

Before we can start with the MediaWiki installation, we have to make sure that all Ubuntu OS packages installed on the server are up to date. We can do this by running the following commands:

sudo apt-get update
sudo apt-get upgrade

Step 3: Install the Nginx Web Server

Check whether Apache is installed and running on your server:

ps aux | grep apache2

If Apache is already installed on the server, stop it and disable it from starting on server boot:

systemctl stop apache2.service
sudo systemctl disable apache2.service

Install Nginx:

sudo apt-get install nginx

Start the Nginx service and enable it to start on boot:

sudo systemctl start nginx.service
sudo systemctl enable nginx.service

Step 4: Install PHP 7.2 and Required PHP Extensions

Install PHP 7.2 and all the PHP extensions required to run MediaWiki.

sudo apt-get install imagemagick php7.2-fpm php7.2-intl php7.2-xml php7.2-curl php7.2-gd php7.2-mbstring php7.2-mysql php7.2-mysql php-apcu php7.2-zip

Edit the PHP-FPM configuration file:

nano /etc/php/7.2/fpm/php.ini

Add/modify the following lines:

file_uploads = On
allow_url_fopen = On
upload_max_filesize = 64M
memory_limit = 256M
max_execution_time = 600
date.timezone = America/Chicago

Restart the PHP-FPM service for the changes to take effect:

sudo systemctl restart php7.2-fpm.service

Step 5: Install MariaDB and Create a New Database

We will use MariaDB as a database engine. We can install the MariaDB server from the Ubuntu base repository using the following commands:

sudo apt-get update
sudo apt-get install mariadb-server-10.1 mariadb-server-core-10.1

Once the MariaDB installation is complete, run the following commands to start the MariaDB service and enable it to run on server boot:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Log in to the MariaDB server as root user, create a new database and assign a MariaDB user with privileges for accessing and modifying the newly created MediaWiki database:

mysql -uroot
MariaDB [(none)]> create database mediawikidb;
MariaDB [(none)]> grant all privileges on mediawikidb.* to mediawiki@'localhost' identified by '5tr0ngPa55w0rd';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> quit;

Do not forget to replace ‘5tr0ngPa55w0rd’ with a strong password (a combination of letters and numbers and ideally more than 10 characters in length).

Step 6: Install a New SSL Certificate

We can automatically enable HTTPS on the MediaWiki website with Certbot:

sudo add-apt-repository ppa:certbot/certbot
sudo apt install python-certbot-nginx
certbot --nginx certonly -d your-domain.com -d www.your-domain.com

Do not forget to replace ‘your-domain.com‘ with your actual domain name.

Step 7: Create an Nginx Virtual Block

In order to access the MediaWiki instance with a domain name, we need to create a virtual host. To do this, create a new Nginx configuration file named ‘your-domain.com.conf’ on the virtual server:

nano /etc/nginx/sites-available/your-domain.com.conf

Add the following lines:

server {
     listen 80;
     server_name your-domain.com www.your-domain.com;
     return 301 https://$host$request_uri;
 }
 
 server {
 
     listen 443 ssl http2;
     
     server_name your-domain.com www.your-domain.com;
     root /var/www/mediawiki;
 
     index index.php;
 
     ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
     ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
 
     client_max_body_size 5m;
     client_body_timeout 30;

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

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.ht {
          deny all;
         }
 
     location ~ \.php$ {
         fastcgi_pass unix:/run/php/php7.2-fpm.sock;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         include fastcgi_params;
         include snippets/fastcgi-php.conf;
     }
 
     location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
         try_files $uri /index.php;
         expires max;
         log_not_found off;
     }
 
     location = /_.gif {
         expires max;
         empty_gif;
     }
 
     location ^~ ^/(cache|includes|maintenance|languages|serialized|tests|images/deleted)/ {
         deny all;
     }
 
     location ^~ ^/(bin|docs|extensions|includes|maintenance|mw-config|resources|serialized|tests)/ {
         internal;
     }
 
     # Security for 'image' directory
     location ~* ^/images/.*.(html|htm|php|shtml)$ {
         types { }
         default_type text/plain;
     }
 
     # Security for 'image' directory
     location ^~ /images/ {
         try_files $uri /index.php;
     }
 
 }

Enable the Nginx virtual block:

ln -sf /etc/nginx/sites-available/your-domain.com.conf /etc/nginx/sites-enabled/your-domain.com.conf

Check if everything is OK with the Nginx configuration:

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

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

systemctl restart nginx

Step 8: Download and Install MediaWiki

Download MediaWiki from the official MediaWiki website and extract it in a directory on your server ( e.g. /var/www/mediawiki):

cd /opt
wget -O mediawiki.tar.gz https://releases.wikimedia.org/mediawiki/1.32/mediawiki-1.32.0.tar.gz
sudo tar -zxvf mediawiki.tar.gz
sudo mkdir -p /var/www/mediawiki
sudo mv mediawiki*/* /var/www/mediawiki

Change the owner of the MediaWiki directory to the ‘www-data’ user and group:

chown -R www-data:www-data /var/www/mediawiki

Open https://your-domain.com in your preferred web browser and follow the simple instructions.

Choose a language and click ‘Continue’, perform environment checking. If everything is OK, click ‘Continue’. Enter ‘mediawikidb’ in the ‘Database name’ field, type the database user ‘mediawiki’ and password of the ‘mediawiki’ MySQL user, then click ‘Continue’. On the next page, create an administrator user account. Type your admin username, password, and email address. Download the ‘LocalSettings.php’ file in the /var/www/mediawiki directory on your server. Change the owner and group of LocalSettings.php file:

chown www-data:www-data /var/www/mediawiki/LocalSettings.php

That is it. We successfully installed MediaWiki with nginx web server on an Ubuntu 18.04 VPS. We can now proceed to the admin panel and configure MediaWiki, install additional extensions, etc.

 


Of course, you don’t have to install and configure MediaWiki on Ubuntu 18.04 if you use one of our Fully-Managed VPS Support solutions, in which case you can simply ask our expert Linux admins to setup and configure MediaWiki on Ubuntu 18.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 MediaWiki on an Ubuntu 18.04 VPS, please share it with your friends on the social networks using the share shortcut buttons, or simply leave a reply below. Thanks.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-mediawiki-on-ubuntu-18-04/feed/ 5
How to Install Jenkins on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-jenkins-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-jenkins-on-ubuntu-18-04/#respond Thu, 24 Oct 2019 18:42:05 +0000 https://linuxhostsupport.com/blog/?p=937 In this article, we will show you how to install Jenkins on Ubuntu 18.04. Jenkins is an open-source automation server written in Java. In a nutshell, this software helps to automate the repetitive technical tasks during the software development process. Jenkins can provide you with many plugins to support building, deploying and automating any project. […]

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

]]>
In this article, we will show you how to install Jenkins on Ubuntu 18.04.

Jenkins is an open-source automation server written in Java. In a nutshell, this software helps to automate the repetitive technical tasks during the software development process. Jenkins can provide you with many plugins to support building, deploying and automating any project.

Jenkins can be installed on Windows, macOS and on most of the Unix-like operating systems, such as Ubuntu. Let’s get started with installing this useful piece of software.

Prerequisites:

In order to follow this tutorial, you will need:

  • For the purposes of this tutorial, we will be using an Ubuntu 18.04 VPS.
  • Full SSH root access (or a user with sudo privileges) is also required.
  • Web server (in this tutorial we will use Apache2 as the web server)

Step 1. Connect to Your Server

Before we begin, you need to connect to your server via SSH as the root user. To do this, use the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

of course, you will need to replace IP_ADDRESS and PORT_NUMBER with your actual server IP address and SSH port number (if necessary).

Once logged in, make sure that your server is up-to-date by running the following commands:

sudo apt update
sudo apt upgrade

Step 2. Install Java

Since Jenkins is based on Java, we need to have installed Java in order to run the application. In this step, we will install Java 8 OpenJDKby using the following command:

sudo apt install openjdk-8-jdk

The current Jenkins version might not be fully compatible with the higher versions of Java JDK (for example Java JDK 9,10 or 11). That’s why we are using Java 8 in this tutorial.

Step 3. Add Jenkins Repository

By using the wget command, we will import the GPG keys of the Jenkins repository:

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -

When we execute the command above, we should receive the output “OK”, which means that the key has been imported successfully – all of the packages from this repository are considered as trusted from now on.

And now with the following command, we will add the Jenkins repository to the system:

sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

Step 4. Install Jenkins

Once the previous step is finished and we have enabled the Jenkins repository in our system, we can proceed with the updating of the apt package list and install the latest version of Jenkins:

sudo apt update
sudo apt install jenkins

After the installation is completed, the application will automatically start. To verify that Jenkins is running on our system, we can run the status command:

sudo systemctl status jenkins

We should see a similar output to this:

● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; generated)
Active: active (exited) since Sun 2019-02-10 16:55:11 CST; 59s ago
Docs: man:systemd-sysv-generator(8)
Process: 1389 ExecStop=/etc/init.d/jenkins stop (code=exited, status=0/SUCCESS)
Process: 1445 ExecStart=/etc/init.d/jenkins start (code=exited, status=0/SUCCESS)

Step 5. Setting up an Apache Proxy

In this tutorial, we will use Apache as a web server. Apache is an extremely popular and customizable web server, so setting it up will be very straightforward. We’re going to assume that you have already installed Apache on your server. If you’re not sure if you have Apache installed, you can check the Apache status with the command:

sudo systemctl status apache2

we can also disable the default virtual host with:

sudo a2dissite 000-default

Now we will create a new virtual host configuration file so that we can access the Jenkins application with a domain name.

sudo nano /etc/apache2/sites-available/domain_name.conf

add the following content to the file:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName domain_name.com
    ServerAlias www.domain_name.com
    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
    ProxyPreserveHost on
    ProxyPass / http://localhost:8080/ nocanon
    AllowEncodedSlashes NoDecode
</VirtualHost>

of course, you will need to replace domain_name.com with your actual registered domain name. When you finish with editing the configuration file, save the file and exit.

Please do not forget that the following Apache modules must be installed and enabled:

a2enmod proxy
a2enmod proxy_http
a2enmod headers

In order to enable the virtual host we have just created, run the a2ensite command:

sudo a2ensite domain_name

For the changes we made to take effect, we need to restart Apache:

sudo apache2ctl restart

Step 6. Adjusting the Firewall

If you are using a firewall, you will need to open ports 80,443 and 8080 so you will be able to access Jenkins. We will assume that you are using UFW to manage the firewall, so you can open the ports with the commands below:

sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow 8080

We can verify the changes with the following command:

sudo ufw status

Output:

Status: active

To                         Action      From
--                         ------      ----
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
8080                       ALLOW       Anywhere
OpenSSH                    ALLOW       Anywhere
80 (v6)                    ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)
8080 (v6)                  ALLOW       Anywhere (v6)
OpenSSH (v6)               ALLOW       Anywhere (v6)

Step 7. Setting up Jenkins

To finish the installation of Jenkins, you need to open your favorite browser and type your domain name or your server IP address followed by port 8080.

For example, http://domain_name.com or http://server_IP_address:8080 and you should see a screen that is similar to the following:

The Jenkins installer creates an initial long alphanumeric password with a length of 32 characters. To unlock Jenkins and continue with the web installation, you need to set up the required admin password. We will use the cat command so that we can display the password in our terminal:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Copy the displayed password from your terminal and paste it into the Administrator password field in the web browser, then click Continue.

On the next screen, you can choose between the options of installing suggested plugins or selecting specific plugins:

Customizing Jenkins

In this case, we will select the first option offered, but if you need specific plugins, you can freely choose the second option offered.

Once the installation is complete, you will be prompted to set up the first admin user. Fill out all the information required and click Save and Continue.

Creating the First Admin User

On the next screen, you will see an Instance Configuration page. You will need to verify with your domain_name.com or with the IP address of your server.

Configuring the Instance

After your confirmation with appropriate information, you can continue by clicking the Save and Finish button. Finally, you should be able to see the confirmation page that is confirming that “Jenkins is ready!”.

Jenkins is now Ready

When you proceed with ‘Start using Jenkins’, you will be redirected to the Jenkins dashboard, and you will also be logged in as the administrator user you just created.

The Jenkins Dashboard

Congratulations! You have successfully installed Jenkins on your server.

In this article, we showed you how to install Java needed to run Jenkins, install Jenkins using the packages provided by the repository, set up an Apache Proxy, customize the firewall, and create an admin user. Now you can continue exploring this incredible application.


Of course, if you are one of our Managed Linux Server Support customers, you don’t have to install Jenkins on your Ubuntu 18.04 VPS – simply ask our admins, sit back, and relax. Our admins will install Jenkins on Ubuntu 18.04 for you immediately.

PS. If you liked this post about how to install Jenkins on an Ubuntu 18.04 VPS, please share it with your friends on the social networks using the share shortcuts, or simply leave a comment in the comments section. Thank you.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-jenkins-on-ubuntu-18-04/feed/ 0
How to Install Shopware CE on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-shopware-ce-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-shopware-ce-on-centos-7/#respond Wed, 02 Oct 2019 14:50:40 +0000 https://linuxhostsupport.com/blog/?p=918 In this article, we will show you how to install the Shopware Community Edition (CE) on CentOS 7 server. Shopware is an e-commerce platform written in PHP and is used for running online businesses and selling products and services online. This application is very easy to install and set up and does not require any […]

The post How to Install Shopware CE on CentOS 7 appeared first on LinuxHostSupport.

]]>
In this article, we will show you how to install the Shopware Community Edition (CE) on CentOS 7 server.

Shopware is an e-commerce platform written in PHP and is used for running online businesses and selling products and services online. This application is very easy to install and set up and does not require any sort of coding knowledge. Shopware CE is free and open-source, and has a user-friendly interface that allows for the use of drag and drop throughout the eCommerce platform. Let’s begin with the install process.

Prerequisites:

We will be using a managed CentOS 7 VPS for this tutorial. Please make sure that you have met the following prerequisites:

  • A publicly-accessible VPS with CentOS 7 installed.
  • A domain or subdomain name pointing to your server public IP address.
  • Access to the root user or user with sudo privileges.

Step 1: Connect to Your Server

Log in to your public server via SSH using the following commands on your preferred terminal:

ssh [username]@[server_ip_address] -p [port_number]

If you want to check the version of CentOS installed on your machine, you can run the following command:

cat /etc/redhat-release

The output should look like this:

CentOS Linux release 7.5.1804 (Core)

By running the command below, you can update your server:

yum update -y

Step 2: Install PHP v7.2

This application needs a version that’s higher than PHP 5.6.4 in order to work. However, the YUM repository contains PHP 5.4, which does not meet the requirements of this application. That’s why in this step, we will install PHP version 7.2. Run this command to add the REMI repository to your system:

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Now enable the REMI repo with the command:

yum-config-manager --enable remi-php72
yum update -y

Run the following command to install PHP and all required PHP extensions:

yum install -y php72 php72-cli php72-fpm php72-common php72-mysql php72-curl php72-json php72-zip php72-gd php72-xml php72-mbstring php72-opcache php72-php-mysqlnd php-pecl-zip unzip zip php72-php-fpm php72-php-gd php72-php-mbstring php72-php-opcache php72-php-xml php72-php-xmlrpc

To verify your installed PHP version you can type the following:

php -v

You should see the following output:

PHP 7.2.18 (cli) (built: Apr 30 2019 15:26:52) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

We also need to make several changes to the PHP configuration file required by the Shopware application. Open the php.ini configuration file with your preferred text editor (in our example we will use nano).

nano /etc/php.ini

Find the following lines in the configuration file and change the value from 128MB to 256MB.

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M

Find the following lines in the configuration file and change the value from 2MB to 6MB.

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

Save and Exit from the editor. In order for our changes to take effect, we will restart the Apache web server using this command:

systemctl restart httpd

Step 3: Install MariaDB and Set Up a Database

To install MariaDB 10.1 on the server, we need to add the MariaDB YUM repository file, MariaDB.repo. Create the MariaDB.repo file with the command:

nano /etc/yum.repos.d/MariaDB.repo

Add the following lines of code:

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Save and Exit.

Use the following commands to update your system and install MariaDB.

yum update -y 
yum install MariaDB-server MariaDB-client -y

Upon the installation, you can start and enable the MariaDB service with this command:

systemctl start mariadb
systemctl enable mariadb

To verify that the MariaDB service is running, we will run the command:

systemctl status mariadb

The next command is optional. You can run the command if you want to secure the MariaDB server by disallowing remote root access, removing the test database, and creating a root password.

mysql_secure_installation

It will first ask to replace the root password. It will then ask some questions – you can answer the prompts with “Y” for YES. We recommend answering with Yes to all of these, as they all will help improve the security of your database server:

Enter current password for root (enter for none): Just press the [Enter] key, as no password is set by default
Set root password? [Y/n]: Y
New password: Enter your password
Re-enter new password: Repeat your 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

Restart the MariaDB server, so the changes will take effect.

systemctl restart mariadb

You can verify the MariaDB version by typing the command:

mysql --version

You should get an output similar to:

mysql Ver 15.1 Distrib 10.1.38-MariaDB, for Linux (x86_64) using readline 5.1

Now you should be able to log in to the MySQL shell with the command:

mysql -u root -p

Then type the password you created above to sign in. Once you are in the MySQL shell, you can use the following command and create a database called ‘shopware’ for the Shopware application.

CREATE DATABASE shopware;

To grant the user ‘shopware’ with full access to the ‘shopware’ database, run the next command:

GRANT ALL PRIVILEGES ON shopware.* TO 'shopware'@'localhost' IDENTIFIED BY '$tr0ng_pa55worD';

Please do not forget to change the $tr0ng_pa55worDwith your strong password.

Now you can use the flush privileges operation to reload the grant tables. After this, exit from the MySQL shell.

FLUSH PRIVILEGES;
\q

Step 4: Install Shopware

In this step, we will download the latest version of Shopware (that is 5.5.8 at the time of writing – you can always visit their website and check for a new or specific version you need). To download Shopware, run the following command:

cd /var/www/ && wget https://releases.shopware.com/install_5.5.8_d5bf50630eeaacc6679683e0ab0dcba89498be6d.zip?_ga=2.267606606.1339280706.1556195384-1042632852.1556195384 -O shopware.zip

Use the unzip command to unpack the application:

unzip shopware.zip -d shopware/

as well as change the ownership of the application:

chown -R apache:apache shopware/

Step 5: Configure Apache

To configure Apache, we will begin by checking whether Apache is running on our server.

systemctl status httpd

Now that you know that Apache2 is running on your server, you can continue with creating a virtual host for your domain.

nano /etc/httpd/conf.d/domain_name.conf

add the following content to the file:

<VirtualHost *:80>
    ServerAdmin webmaster@yourdomain.com
    DocumentRoot /var/www/shopware
    ServerName yourdomain.com ServerAlias www.yourdomain.com ErrorLog "/var/log/httpd/yourdomain.com-error_log" CustomLog "/var/log/httpd/yourdomain.com-access_log" combined <Directory "/var/www/shopware/"> DirectoryIndex index.html index.php Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>

Please do not forget to change yourdomain.comwith your actual registered domain name. Once you have finished with editing, you can save and close the configuration file.

Make a quick syntax error check with the following command:

httpd -t

Restart the Apache2 server, so the changes will take effect.

systemctl restart httpd

Step 6: Log in to Shopware

Since the installation is completed, you should be able to access the Shopware CE on your web browser. Open your favorite browser and type your domain. http://yourdomain.com is the domain that we used.
You should be able to see the Shopware installer page:

 

Now you can choose your language and finish the web installation by following the installation wizard.

Congratulations! If you carefully followed our instructions in this tutorial, then you will have successfully installed Shopware CE on your CentOS 7 VPS. Now you can start to explore this amazing application and build your online shop.

You can also check our tutorial on how to install Shopware CE on Ubuntu 18.04, and how to install Shopware CE on Debian 9.


Of course, you don’t have to install Shopware CE on your CentOS 7 VPS if you use one of our Managed Linux Support Services, in which case you can simply ask our team of expert Linux admins to install and configure Shopware CE on your server 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 Shopware CE, please share it with your friends on the social networks using the share shortcuts, or simply leave a comment in the comments section. Thank you.

The post How to Install Shopware CE on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-shopware-ce-on-centos-7/feed/ 0
How to Install Dotclear on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-dotclear-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-dotclear-on-centos-7/#respond Thu, 12 Sep 2019 13:05:52 +0000 https://linuxhostsupport.com/blog/?p=890 In this tutorial, we will guide you through the steps of installing Dotclear on a CentOS 7 server, with Apache web server, PHP and MySQL. Dotclear is a free and open-source PHP-based web publishing platform. This software allows you to spread your words to the internet easily with an intuitive user-interface and an extensive feature […]

The post How to Install Dotclear on CentOS 7 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will guide you through the steps of installing Dotclear on a CentOS 7 server, with Apache web server, PHP and MySQL.

Dotclear is a free and open-source PHP-based web publishing platform. This software allows you to spread your words to the internet easily with an intuitive user-interface and an extensive feature set. It is very fast, stable, and easy to use. The installation is pretty simple and straightforward.

Dotclear comes with a lot of handy features out of the box, such as:

  • Fast and easy publication system
  • Fully customizable themes, without changing or editing any code
  • User-friendly administrative panel
  • Flexible template system
  • Built-in anti spam system
  • Lots of themes and plugins
  • Complete trackback support
  • SEO friendly
  • and many more… 

Requirements

  • For the purposes of this tutorial you will need a server running CentOS 7.
  • System user with root privileges
  • PHP version 5.6 or newer with mbstring, iconv, simpleXML, SPL PHP extensions enabled
  • MySQL, PostgreSQL or SQLite database server
  • Apache or Nginx web server

Step 1. Log in and Update the System

In order to start installing Dotclear on your CentOS 7 server, you have to login to the server via SSH as user root

ssh root@IP_Address -p Port_Number

Don’t forget to replace ‘IP_Address‘ and ‘Port_Number‘ with your server’s actual IP address and SSH port number.

Once you are in, run the following command to update all installed packages on your server

yum -y update

Step 2. Install the Apache Web Server

A web server is required to serve the Dotclear files, so in the next step we will install Apache web server, which is the most popular web server in the world. It can easily be installed from the official CentOS 7 repositories using the ‘yum’ package manager. Run this command to install Apache:

yum -y install httpd

After the installation is completed, run the following commands to start the Apache web server and enable it to automatically start after a server reboot

systemctl start httpd
systemctl enable httpd

To verify that the installation is OK and that the web server is properly running, issue the following command:

systemctl status httpd

Output

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-04-25 04:18:22 CDT; 39s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 703 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ââ703 /usr/sbin/httpd -DFOREGROUND
           ââ883 /usr/sbin/httpd -DFOREGROUND
           ââ884 /usr/sbin/httpd -DFOREGROUND

Step 3. Install the MariaDB Database Server

Dotclear uses a databse to store and retrieve the website information. For this purpose we will install and use MariaDB database server which is a drop-in replacement for MySQL. The installation of MariaDB is easy and it can be done using the following commands

yum -y install mariadb mariadb-server

Once the MariaDB database server is installed, start it and enable it to automatically start after a server reboot

systemctl start mariadb
systemctl enable mariadb

Check if MariaDB is up and running:

systemctl status mariadb

The output will look something like this:

mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-04-26 06:09:18 CDT; 33s ago
  Process: 22143 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
  Process: 22110 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
 Main PID: 22141 (mysqld_safe)
   CGroup: /system.slice/mariadb.service
           ââ22141 /bin/sh /usr/bin/mysqld_safe --basedir=/usr

Next, run the mysql_secure_installation post-installation script provided by MariaDB to strengthen the security of the database server and set a root password. You can use the following options:

Set root password? [Y/n] Y
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

If it at any point asks you to enter the current MySQL/MariaDB root password, just press the [Enter] key, as no password is set by default.

Step 4. Create a MariaDB User and Database

In this step, we will create a new MariaDB user and database which will be used for the Dotclear installation. Log in to the MariaDB server CLI as the root user and issue the following commands

mysql -u root -p

MariaDB [(none)]> CREATE DATABASE dotclear;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON dotclear.* TO dotclearuser@localhost IDENTIFIED BY 'PASSWORD';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

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

Step 5. Download Dotclear

Go to Dotclear’s download page and download the latest stable release of the application. At the moment of writing this article it is version 2.14.3. We’ve included the download link in the command below for you:

wget http://download.dotclear.org/latest.zip

Unpack the downloaded ZIP archive to the document root directory of your web server:

uunzip latest.zip -d /var/www/html/

All Dotclear files will be extracted in a new ‘dotclear’ directory. Make sure that the Apache user has access to the Dotclear files:

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

Step 6. Create an Apache Virtual Host

Next, we will create Apache virtual host directive in order to be able to access Dotclear with a domain name. We will use yourdomain.com as a domain name. You have to replace all occurrences of this domain name in the configuration file.

Create Apache configuration with the following content

nano /etc/httpd/conf.d/dotclear.conf

<VirtualHost *:80>
    ServerAdmin admin@yourdomain.com
    ServerName yourdomain.com ServerAlias www.your_domain.com DocumentRoot /var/www/html/dotclear <Directory /var/www/html/dotclear> Options Indexes FollowSymLinks AllowOverride All </Directory> ErrorLog ${APACHE_LOG_DIR}/yourdomain.com_error.log CustomLog ${APACHE_LOG_DIR}/yourdomain.com_access.log combined </VirtualHost>

Save the configuration file and restart the Apache web server for the changes to take effect

systemctl restart httpd

Step 7. Complete the Installation

Finally, all the requirements are installed on the server and we can continue with the installation through Dotclear’s web-based installation wizard. Open your preferred web browser, navigate to http://yourdomain.com and follow the on-screen instructions in order to complete the Dotclear installation and configuration. The installation wizard will check if your server meets all the requirements and you will be prompted to enter the details of the MariaDB database we have created earlier in this tutorial.

For more details on how to configure and use Dotclear, please check their official documentation.


Of course, you don’t have to install Dotclear on CentOS 7 if you use one of our Managed Linux Support services. You can simply ask our support team to install Dotclear on your CentOS 7 server for you. They are available 24/7 and will be able to help you with the installation.

PS. If you enjoyed reading this blog post on how to install Dotclear on CentOS 7, feel free to share it on social networks using the share shortcuts, or simply leave a comment in the comments section. Thank you.

The post How to Install Dotclear on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-dotclear-on-centos-7/feed/ 0
How to Deny File Permissions to Everyone Except Yourself in Linux https://linuxhostsupport.com/blog/how-to-deny-file-permissions-to-everyone-except-yourself-in-linux/ https://linuxhostsupport.com/blog/how-to-deny-file-permissions-to-everyone-except-yourself-in-linux/#respond Fri, 29 Mar 2019 17:35:29 +0000 https://linuxhostsupport.com/blog/?p=848   The role of permissions and files is much clearer in Linux when compared to Windows. Most people find it easier to understand compared to the complex system of groups and users that we find in Windows’ concept of permissions. For example, each file in a Linux-based operating system has three sets of permissions – […]

The post How to Deny File Permissions to Everyone Except Yourself in Linux appeared first on LinuxHostSupport.

]]>
 

The role of permissions and files is much clearer in Linux when compared to Windows. Most people find it easier to understand compared to the complex system of groups and users that we find in Windows’ concept of permissions. For example, each file in a Linux-based operating system has three sets of permissions – the first being the permissions of the owner, the second being for a specific group of users, and the last group’s permissions are responsible for the rest of the system.

The levels of access to reading, writing, and executing are then described with a scale, ranging from 1 to 7. A value of ‘1’ allows for execution of the file, ‘2’ allows writing access, and ‘4’ allows the file to be read. To combine several permissions, you just add the numbers together. For example, if you want read and write access for a file, but no access to executing this file, the value to set for permissions would be 2 + 4, which is 6.

In this tutorial, we’ll see how to create a file in such a way that only the owner has full permissions over it. We’ll also see what happens when another user tries to read or modify that file. Finally, we’ll look at the role of “sudo” users who take on the root role for themselves, and how we can implement ironclad file security by hiding contents even from root if necessary.

Creating a File with “Owner Only” Permissions

Let’s say we have a file whose contents we want to have hidden from everyone else. In essence, others would be able to see that the file exists, and that’s about it. We don’t want them to see what’s inside it, or be able to modify it in any way. We do this using the following command:

chmod 700 test.txt

Where test.txt is the name of the file that I want to protect. Once we run this command, the file turns “green” when you list it in a command like “ls”, and it displays the new file permissions with the “ls -l” command, like this:

Only Owner can Access the File
Only the Owner can Access the File

Here, you can see the file permissions are restricted only to the first group – the owner – who has “rwx”, or read, write, and execute permissions. And the third column of “ls -l” is the owner name, which in this case is “root”.

For convenience sake, we’ve created this file in the home directory of another user called “testuser”. Here’s what happens when we log in as the new user and try and read the contents of test.txt:

Permission Denied to Other User
File access is Denied to the Other User

As you can see, testuser is denied the ability to access the file in any way. Any other user who tries to open this file will get the same error message. In this way, you can ensure that your important files are kept hidden from other users.

Allowing Others to ONLY Read the File

Perhaps there’s an important document or set of rules that you want others to be able to read, but not modify. We can achieve this using the following command:

chmod 744 test.txt

Here, “744” instead of “700” gives everyone else the permission to read the file, but nothing else. Here you can see that “testuser” is able to access the contents of the file after it has been assigned its “744” permissions:

Allowing Users to Read FIle
Allowing Other Users to Only Read the FIle

However, if they then try and modify the file using a file editor, like “vi”, they get the warning you expect as shown here:

File Cannot be Edited
The File is Read-only – It Can’t be Edited

Use this variant of the chmod command when you need others to see the file, but not modify it in any way.

Root or “Sudo” Users Still Have Access

Unfortunately, file permissions don’t apply to root or sudo users. For this example, I’ve added “testuser” to the sudoers file so they can use execute root commands using sudo. And when they do this, they can access the protected file as shown here:

Root Users have Full Access
Root Users have Complete Control Over the File

There’s no way around this using file permissions. Root, and users belonging to the “wheel” group can simply use “sudo” to get around these restrictions. Of course, it’s good practice to be wise with the capabilities you give your users – handing out sudo permissions to everyone is not a good idea. Since this is common practice, well-configured Linux systems shouldn’t have this problem.

True File Security – Even from Root

Ultimately, the only way to hide your files from everyone – including root users – is to use passphrase-based encryption. No other method can hide your information with 100% security from everyone, including the root and sudo users!


Of course, you don’t have to do any of this if you use one of our Outsourced Server Support Services, in which case you can simply ask our expert Linux admins to set up your file permissions for you. Just sit back, relax, and let our admins take care of the issue for you. They are available 24×7 to help you with your requests.

PS. If you liked this post on denying file permissions to everyone except yourself, please share it with your friends on the social networks by using the share shortcut buttons, or simply leave a comment in the comments section below. Thanks.

The post How to Deny File Permissions to Everyone Except Yourself in Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-deny-file-permissions-to-everyone-except-yourself-in-linux/feed/ 0
How to Efficiently Manage Large Text Files in Linux https://linuxhostsupport.com/blog/how-to-efficiently-manage-large-text-files-in-linux/ https://linuxhostsupport.com/blog/how-to-efficiently-manage-large-text-files-in-linux/#respond Wed, 13 Mar 2019 16:06:19 +0000 https://linuxhostsupport.com/blog/?p=831   Linux is an operating system of text files. Unlike Windows, the Linux philosophy and core concept is that “everything is a file”. Sure, there are databases and binary structures, but nothing like Windows’ “Registry” exists. Even devices, partitions, and sockets are represented either by real or virtual files. Given all of this, some text […]

The post How to Efficiently Manage Large Text Files in Linux appeared first on LinuxHostSupport.

]]>
 

Linux is an operating system of text files. Unlike Windows, the Linux philosophy and core concept is that “everything is a file”. Sure, there are databases and binary structures, but nothing like Windows’ “Registry” exists. Even devices, partitions, and sockets are represented either by real or virtual files.

Given all of this, some text files can get pretty big. And often we’re not talking about dozens of MB, but possibly hundreds, or even a few gigabytes in size in rare occasions. And all of it can be text! In fact, something as innocuous as a log file can continue to grow if left unchecked. Let’s say you have a file recording every visit to your website, along with the date, IP, user-agent, etc. For even a medium-sized website, that file can grow pretty large if not dealt with.

In this article, we’ll look at how to view these large files without slowing down your system. Sometimes you might even need to edit these large files, which is far more difficult to deal with when the files are of this magnitude. Luckily, it’s quite unheard of for a configuration file to be large enough to make it problematic to edit! Let’s begin.

Listing the Largest Files on your Linux System

Let’s say you need to clean out some space on your hard drive and want a list of the biggest culprits eating up your disk space. To get a list of the top 10 largest files, use this command:

find / -type f -exec du -sh {} 2>/dev/null + | sort -rh | head -n 10

This will give you an output like this. Note that it may take a while for the results to appear onscreen:

Large Text Files
List of Large Text Files

As you can see, most of these are binary files or databases that you can’t open directly. But often you’ll find mail logs that keep a record of even spam attempts to access your server. And if your IP address is hit often, that mail spool will just keep getting bigger and bigger, reaching hundreds of MB in a matter of a few months.

Trying to Open Large Files the Traditional Way

For this example, we’re going to create an example text file and bloat its size using the “truncate” command like this:

truncate --size=20M testfile

Where “testfile” is the sample file. This command will set its size to 20MB and fill the extra space with null characters. We can get the size of all the files in the current directory in MB using this command:

ls -l --block-size=M

Here’s the output:

Creating 20MB Test File
Creating a 20MB Test File in the Directory

We will use the traditional text editor called “vi” to open the file and close it as soon as it’s loaded. To know how long the entire operation lasted, we use the “time” command, like this:

time vi testfile

And when we exit vi after “testfile” has displayed its contents, it gives us the duration of the entire operation like this:

Opening and Closing File Using vi
Opening and Closing the File Using vi

So in this case, it takes us almost 6 seconds for a file that’s just 20 MB! That’s an absurd amount of time for a powerful processor. What happens when we increase the size to 40 MB?

Execution Time Increases Non-Linearly
The Execution Time Increases Non-Linearly

It now takes us 23 seconds! So the time increases non-linearly. When the file is larger, it takes exponentially longer to open.

The “cat” command is even worse:

Cat Command Has Similar Performance
The Cat Command Offers Similar Performance

15 seconds just to open a 10MB file!

Using “Less” is More Efficient

Luckily for us, we have a command called “less” which reads the contents of the file one block at a time, and thus spares us the problem of loading it all at once. The syntax is simple:

less [filename]

Where [filename] is the name of the large file you want open. You can see in the screenshot below that it opens a huge file in less than a second:

Less Command Opens Files Instantly
The Less Command Opens Files Almost Instantaneously

Most of that time is used by having to manually quit the program. So it’s pretty much instantaneous! We can navigate to the next “block” in the file by pressing “f” and we can go back by pressing “b”. We can also use “j” and “k”, or the arrow keys, to navigate between lines.

So the next time you see a file of hundreds of MB and need to view it, use “less” instead of “vi” or “cat”. Your system resources will thank you for it, and you’ll save time as well!


Of course, you don’t have to do any of this if you use one of our Outsourced Server Support Services, in which case you can simply ask our expert Linux admins to manage your large text files for you. Just sit back, relax, and let our admins take care of the issue for you. They are available 24×7 to help you with your requests.

PS. If you liked this post on managing your text files in Linux, please share it with your friends on the social networks by using the share shortcut buttons, or simply leave a comment in the comments section below. Thanks.

The post How to Efficiently Manage Large Text Files in Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-efficiently-manage-large-text-files-in-linux/feed/ 0
How to Change the Color of your Linux Prompt https://linuxhostsupport.com/blog/how-to-change-the-color-of-your-linux-prompt/ https://linuxhostsupport.com/blog/how-to-change-the-color-of-your-linux-prompt/#comments Thu, 07 Mar 2019 17:57:37 +0000 https://linuxhostsupport.com/blog/?p=823   By default, all Linux installations have plain black and white color prompts. Specific commands are coded to have color combinations under certain circumstances. For example, directories in the “ls” command are coded blue by default, and scripts are colored green. Similarly, the frequently used “grep” command is also color-coded to highlight matches. However, the […]

The post How to Change the Color of your Linux Prompt appeared first on LinuxHostSupport.

]]>
 

By default, all Linux installations have plain black and white color prompts. Specific commands are coded to have color combinations under certain circumstances. For example, directories in the “ls” command are coded blue by default, and scripts are colored green.

Similarly, the frequently used “grep” command is also color-coded to highlight matches. However, the Linux prompt itself is rather innocuous. In this article, we’ll show you how to change it to anything you want – a single color, or even a combination of them. Let’s get started.

Getting your Current Prompt Defaults

Every Linux prompt consists of a few key details, allowing the user to keep track of where they are. By default, most have at least the username and the hostname separated by an “@” symbol. This is encoded in a special way using an environment variable called “PS1”. To see what your current variable is, type in the following command:

echo $PS1

This will give you an output similar to this:

[\u@\h \W]\$

Here, “u” stands for the username, and “h” stands for the hostname.

Enclosing Your Prompt in Color Codes

Now, we’re going to enclose this output in color codes with the following opening and closing tags:

\e [colorcode $PS1 \e[m

Here, “colorcode” represents a specific color. These codes are represented by a series of numbers, separated by a semi-colon (;). For example, the following color represents yellow, with bold text:

0;33;1m

The following represents bold text in red:

0;31;1m

The last “1” before the “m” means that the text will be displayed in bold. If you want your text to be purely yellow, it is as follows:

0;33m

To make something bold, we add a “1” separated from the rest by a semi-colon. As you can see, different numbers represent different colors. Here’s a small list of numbers, along with the colors they represent:

30 Black 

31 Red 

32 Green 

33 Yellow 

34 Blue 

35 Magenta 

36 Cyan 

37 Light gray 

90 Dark gray 

91 Light red 

92 Light green 

93 Light yellow 

94 Light blue 

95 Light magenta 

96 Light cyan 

97 White

Creating a New PS1 Variable

Now that we know how to create colors, we can enclose the PS1 variable within the opening and closing tags of the colors. To re-iterate, the format is:

\e [colorcode[PS1 Variable] \e[m

Since our PS1 variable is:

[\u@\h \W]\$

And the color code for bold yellow is:

0;33;1m

The final value for a bold yellow color prompt is:

\e[0;33;1m[\u@\h \W]\$ \e[m

And we assign it to the PS1 variable like this:

export PS1="\e[0;33;1m[\u@\h \W]\$ \e[m"

When we run this command, we get the following output as expected:

Change Prompt to Yellow Bold Text
Changing the Prompt to Yellow Bold Text

If we want, we can even have the username and hostname in different colors. To do this, we enclose the “u” and the “h” in different color codes.

For example, the following code converts the username to bold yellow and the hostname to bold red:

export PS1="\e[0;33;1m[\u\e[m@\e[0;31;1m\h\e[m \W]\$"

Making the Changes Persistent

The disadvantage of changing everything ad-hoc like this is that your changes will be lost when you reload the bash environment. To make our terminal remember our configuration, we need to add the command to our .bashrc file, found in our home directory. Open it with your preferred text editor:

nano ~/.bashrc

Simply open it in the editor, and add your export command to the end, like this:

Modify .bashrc
Modify .bashrc to Make Changes Persistent

Save your changes. Now when you log in, you should have your customized prompt for your commands!

New Color Scheme Persists After Rebooting
The New Color Scheme Persists Even After Rebooting

To have the changes take effect immediately instead of having to log out and log in, run the following command to reload the .bashrc file:

source ~/.bashrc

While this might not be the most user-friendly user interface for changing your prompt colors, it is the most common way to change the colors. If you followed the guide correctly, you should now have a command prompt in the color of your choosing. 


Of course, you don’t have to do any of this if you use one of our Outsourced Server Support Services, in which case you can simply ask our expert Linux admins to configure the appearance of your command prompt for you. Just sit back, relax, and let our admins take care of the issue for you. They are available 24×7 to help you with your requests.

PS. If you liked this post on changing the color of your linux command prompt, please share it with your friends on the social networks by using the share shortcut buttons, or simply leave a comment in the comments section below. Thanks.

The post How to Change the Color of your Linux Prompt appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-change-the-color-of-your-linux-prompt/feed/ 1
Using Hard and Symbolic Links in Linux https://linuxhostsupport.com/blog/using-hard-and-symbolic-links-in-linux/ https://linuxhostsupport.com/blog/using-hard-and-symbolic-links-in-linux/#respond Thu, 28 Feb 2019 20:18:46 +0000 https://linuxhostsupport.com/blog/?p=800 Back when Linux was in earlier development, it used to utilize a “flat” directory structure. This meant that unlike the hierarchical “tree-link” folders we have today, everything was located inside of a single folder. No subdirectories existed. It also meant that each file had to have a unique filename, without exceptions! All of that changed […]

The post Using Hard and Symbolic Links in Linux appeared first on LinuxHostSupport.

]]>
Back when Linux was in earlier development, it used to utilize a “flat” directory structure. This meant that unlike the hierarchical “tree-link” folders we have today, everything was located inside of a single folder. No subdirectories existed. It also meant that each file had to have a unique filename, without exceptions!

All of that changed when Linux baked “hard links” into its kernel. The special character sequence “..” was defined to mean the parent directory, and it’s now the backbone of the modern Linux filesystem as we know it today. With that, we can see the importance of hard links – and in this tutorial, we’ll explain the difference between symbolic links and hard links, and the use-case scenarios, as well as when to use each type of link.

What Are Symbolic Links?

A symbolic link is a link to a specific file that gets treated by applications and programs as the file itself. It does not copy the file – it’s a pointer, pointing back to the original file instead. It doesn’t take up any extra space, and it can be moved around just like any other file.

It’s a convenient way to have a single file in multiple directories. Linux packages use this all the time – they commonly create symbolic links to their scripts in the global environment paths for the system. This makes it easy to execute these scripts without having to specify the full path.

The key concept around symbolic links is that there’s only one “real” copy of the file, despite it being mentioned in several locations. So if you make a change, that modification will propagate to all other symbolic links (and the original file) everywhere else.

We can create a symbolic link to a file by using the following syntax:

ln -s [originalfile] [symlinkoriginal]

This can be seen in this screenshot here:

Create Symbolic Link to File
Creating a Symbolic Link to a File

As you can see, the new file “symlinkoriginal” shows up with the “ls -l” command as a separate color. It also shows that it’s pointing to the first file.

Inode Counters

With the “ls -l” command, look at the second column in the previous screenshot. This is the number of pointers to the data, represented by the inode number. A regular file has a single pointer to the inode. With a symlink, that number doesn’t change because the symlink is pointing to the file and not the underlying data.

Deleting the Original File With a Symbolic Link

In the following screenshot, we’ll remove the original file with the symlink still pointing to it:

Data Gone if Original File Removed
The Data is Gone if the Original File is Removed

As you can see here, once the original file is gone, the symbolic link no longer works. When we try to read it, the system says “No such file or directory”. And when we list the file with “ls”, it shows up in red with an arrow pointing to the deleted file.

This shows that symbolic links are subservient to the actual file.

What are Hard Links?

A hard link, on the other hand, points to the actual inode containing the data instead of the original file. This has all sorts of implications. Firstly, a hard link is treated on an equal footing when compared to the original file name. The operating system can’t tell the difference.

Secondly, when you delete the original file, the hard link’s connection to the inode remains and the data can still be accessed unlike with symbolic links.

Creating a Hard Link

To create a hard link, use the following (without the “-s” option, which was used to create a symbolic link):

ln [originalfile] [symlinkoriginal]

It should look like this:

Create Hard Link to File
Creating a Hard Link to a File

This time after creating the hard link, we list the files again. Now, the hard link shows up as just a regular file, no different from any other. Also, note that the inode counter in the second column shows “2”, instead of “1”, which is unlike the symbolic link. This means that there are two pointers to the inode data – the original file, and the hard link.

Deleting the original file has no impact on the hard link:

Data Still There if Original File Removed
The Data is Still There, Even When the Original File is Removed

As you can see, once the original file has been deleted, the inode count is decreased by one, and all that’s left is the hard link. In a way, we have “moved” the file. In fact, this is why moving a file to another location is so much faster than copying it. The system creates a hard link in the new directory and deletes the original filename.

The uses of hard links are varied. Most of the time, symbolic links will be enough for most use cases. Using hard links can create confusion as to which file is the original and which isn’t, while symbolic links are clearly marked.

Occasionally, we’ll come across a package like ioquake3 for example, which doesn’t support symbolic links to pk3 files. However, these are likely bugs, and in these sorts of situations, we can fix the problem with hard links, since they’re the same as file names. 


Of course, you don’t have to do any of this if you use one of our Outsourced Server Support Services, in which case you can simply ask our expert Linux admins to set up symbolic links or hard links for you. Just sit back, relax, and let our admins take care of the issue for you. They are available 24×7 to help you with your requests.

PS. If you liked this post on using symbolic links and hard links, please share it with your friends on the social networks by using the share shortcut buttons, or simply leave a comment in the comments section below. Thanks.

The post Using Hard and Symbolic Links in Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/using-hard-and-symbolic-links-in-linux/feed/ 0
How to Reveal All “Install” Commands Using Yum https://linuxhostsupport.com/blog/how-to-reveal-all-install-commands-using-yum/ https://linuxhostsupport.com/blog/how-to-reveal-all-install-commands-using-yum/#respond Thu, 21 Feb 2019 17:05:25 +0000 https://linuxhostsupport.com/blog/?p=786 Sometimes, working with YUM – the default CentOS package manager – can feel unintuitive and cumbersome. Sure, it’s better than using the even more barebones RPM package manager, but it still leaves a lot to be desired. Take YUM’s “history” command, for instance. The idea of that command is to give you a general idea […]

The post How to Reveal All “Install” Commands Using Yum appeared first on LinuxHostSupport.

]]>
Sometimes, working with YUM – the default CentOS package manager – can feel unintuitive and cumbersome. Sure, it’s better than using the even more barebones RPM package manager, but it still leaves a lot to be desired. Take YUM’s “history” command, for instance. The idea of that command is to give you a general idea of what package operations you’ve carried out recently. So if you’ve been installing stuff, upgrading older packages, or updating CentOS itself, YUM will keep a record of it all.

Getting a List of Manually Installed Packages

We can often install stuff that only ends up getting used a handful of times, which then ends up getting forgotten about being installed in the first place. This results in packages accumulating over a period of time, using up space, and cluttering our system files. It’s a good practice to clean them out every now and then. But how do we know which packages we installed manually?

If we use the history feature built into YUM by typing the following:

yum history

We get an output similar to this:

No Commands are Shown

This tells us the following:

  1. The transaction ID
  2. The Username
  3. The Date
  4. The Actions that were carried out
  5. The Number of files and/or packages altered

Unfortunately, this doesn’t tell us which specific packages were installed, nor does it give us the commands used or options used in conjunction with the commands. Without these two crucial pieces of information, we can’t know what was installed.

Luckily, YUM allows us to specify the “setopt” parameter, which will give us the command name. We use it like this:

sudo yum --setopt=history_list_view=commands history

We can now get the history together with the commands as well:

List of Commands
List of Commands

This is definitely an improvement over the previous output – we now at least know which packages we were working with.

However, it isn’t close enough to what we’re looking for. For one, the package names are often cut off (because they can get really long in Linux and not fit in the output), and second, there’s no filter for us to only display the commands related to installing packages with “install”.

Luckily, this information is available, but we can’t access it directly through the yum command. Instead, we have to go to the backend database where YUM stores its transaction history, and extract it from there.

Accessing the Yum SQLite Database

Instead of a text file, YUM stores its transaction data in an SQLite file. This data is located in the directory /var/lib/yum/history.

When we list the files found at this location, we can see the one with the “SQLite” extension, like this:

SQLite3 Database Location

Just like with a regular database, we can query it using the built-in sqlite3 package that comes pre-installed with Linux. What we want is to find all rows where the “cmdline” contains the word “install”. Here’s the command:

sqlite3 /var/lib/yum/history/history-2013-01-26.sqlite "select tid, cmdline from trans_cmdline WHERE cmdline LIKE '%install%'"

Replace history-2013-01-26.sqlite with the name of the SQLite file you got in the previous screenshot. Upon running this command, we see the following:

List the Installed Packages

And that’s all that we need – this gives us all of the commands executed that manually installed a package. Using this, you can get an idea of what packages you’re still using, and which ones you no longer need. You can also check any other SQLite files if needed in case there’s more than one. 

The downside of this method is that there’s no way to tell if these packages are still being used. You may already have uninstalled them, or some other package might have done it for you. Of course, you can cross-reference the packages with the “remove” command, but it can become a hassle.

That’s why YUM is now being replaced with DNF – the new package manager that’s already well entrenched in the Fedora environment. With it, you can get a list of user-installed packages as well as a lot of other cool features that you can’t yet get with YUM.

But for now, if you’ve been using YUM, this tutorial will help you get a grip on the user-installed-packages in CentOS.


Of course, you don’t have to do any of this if you use one of our Outsourced Server Support Services, in which case you can simply ask our expert Linux admins to find out which packages were installed manually through YUM for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to see your installed package history, please share it with your friends on the social networks using the share shortcut buttons on the left, or simply leave a comment in the comments section below. Thanks.

The post How to Reveal All “Install” Commands Using Yum appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-reveal-all-install-commands-using-yum/feed/ 0