Miscellaneous | LinuxHostSupport https://linuxhostsupport.com/blog/category/miscellaneous/ Linux Tutorials and Guides Sun, 02 Aug 2020 16:48:39 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 Introduction to Bash Aliases https://linuxhostsupport.com/blog/introduction-to-bash-aliases/ https://linuxhostsupport.com/blog/introduction-to-bash-aliases/#respond Wed, 01 Apr 2020 20:26:14 +0000 https://linuxhostsupport.com/blog/?p=1093 In this article, we will show you how to make use of the alias command through some useful examples. We’ll cover creating aliases, show you a few useful examples, and show you how to delete aliases as well. If you are working on the command line a lot of the time, you may have noticed […]

The post Introduction to Bash Aliases appeared first on LinuxHostSupport.

]]>
In this article, we will show you how to make use of the alias command through some useful examples. We’ll cover creating aliases, show you a few useful examples, and show you how to delete aliases as well.

If you are working on the command line a lot of the time, you may have noticed that most of the commands you use are extended commands with flags, or options, along with piping the output of commands into other programs.

Imagine that every time you needed to change directory, you would have to type “change-directory” instead of “cd” or if every time you needed to list the contents of a directory, you’d have to type “list” instead of “ls“. That’s why the makers of most commands attempt to eliminate the long names of the commands and replace them with shortened names. It reduces the amount of typing you have to do to get things done, and also makes the commands easier to remember as a bonus, thanks to the shorter name.

Basically, bash aliases are just shortcuts for the longer commands. The alias command allows us to run any command or even a group of commands (which includes options and filenames) by typing a custom phrase (which can even be just a single word) into the command line.

How to List Bash Aliases

You can list the bash aliases by typing alias on the command line.

alias

The output may look like an example below.

alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'
alias sl="ls"
alias apt='sudo apt'

How to Create a Bash Alias

There are two types of declaring a bash alias.

All user-defined aliases should go into the ~/.bashrc file – this way they will persist through restarts as well as logging out and back in. You can run them in the command line interface, but the aliases will only apply in your current bash session.

You can use the following syntax to create a bash alias:

alias [alias_name]="[alias_command]"

When you want to add a new alias, it should always be on a new line and it needs to start with the alias keyword. After you type the word alias, you leave a blank space and define the alias name followed by an equal sign. Finally, you can set the full command after the equal sign between the quotation marks, as in the example shown above.

You need to edit the .bashrc file if you wish to create permanent aliases. Go to the end of the file and add the aliases to a new line. You can also add a comment so you can easily see where all the aliases are. For example:

#############
# Aliases
#############

alias df="df -h"

Before you add new aliases, you can always check that they have already been added from your Linux distribution, since many of the distributions come with a configuration with already added aliases. After you have added the aliases you can save and close the file.

All new aliases when added will be available for use the next time you start a new shell session. However, if you want to view the changes without doing this, you can run the following command so that bash will read the file again in your current session:

source ~/.bashrc

Useful Alias Examples

Since we know how to create our own aliases, now is when we will show you some popular aliases that can make your typing and system administration experience a little nicer. We can start with some simple aliases for navigation.

The most common command that is used for listing is ‘ll‘ alias. With this alias, you can list all the files along with the hidden files in a human-readable size.

alias ll="ls -lahF"

If you want a short version of navigation to different directories you can add this:

alias ..='cd ..'
alias ...='cd ../..'

You can use the process status command so it can display more information about the active processes:

alias ps="ps -aux"

Another useful alias for displaying statistics about the amount of free disk space is the ‘df‘ command. This alias displays the sizes in a more human-readable format:

alias df='df -h'

You can easily find files in the current directory by setting this alias:

alias fhere="find . -name "

Temporarily Stop Using Aliases

There are situations that you need to use the actual command instead of the alias that already exists. But you do not want to remove the alias and then define it again. Sounds annoying right? That’s why you can use a small trick that will allow you to temporarily use the original command.

\aliasname

For example, alias cp=“cp -iv”, will constantly be asking about confirmation to overwrite the file. Imagine that you need to copy a lot of files and you know that all the files need to be overwritten. In this case, you might want to use the regular cp command. You can see a small example shown below:

\cp * /backup/directory/

Removing an Alias

As the last part of this article, we will show you the opposite of adding which is removing and unsetting aliases.

You can remove/unset aliases with the following command:

unalias ll

ll

-bash: ll: command not found

If you want to remove/unset all set aliases, you can just type:

unalias -a

We hope that with this article you now have an idea on how to create your own aliases and maximize your command line efficiency. Using aliases you can make your time in the shell more enjoyable – not to mention faster.


Of course, you don’t have to create bash aliases if you use one of our Fully Managed VPS Support Services, in which case you can simply ask our expert Linux admins to create bash aliases for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked our post on an intro to bash aliases, please share it with your friends on the social networks using the buttons, or simply leave a reply below with your favorite bash aliases. Thanks.

The post Introduction to Bash Aliases appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/introduction-to-bash-aliases/feed/ 0
How to Enable SSH on Debian 9 https://linuxhostsupport.com/blog/how-to-enable-ssh-on-debian-9/ https://linuxhostsupport.com/blog/how-to-enable-ssh-on-debian-9/#respond Thu, 13 Feb 2020 21:19:07 +0000 https://linuxhostsupport.com/blog/?p=1044 In this article, we will show you how to enable root access for SSH on a Debian 9 server. Before we start with setting up our SSH service, we need to know what SSH actually is. SSH stands for Secure Shell and it is a UNIX-based command interface and protocol which usually is used to […]

The post How to Enable SSH on Debian 9 appeared first on LinuxHostSupport.

]]>
In this article, we will show you how to enable root access for SSH on a Debian 9 server.

Before we start with setting up our SSH service, we need to know what SSH actually is. SSH stands for Secure Shell and it is a UNIX-based command interface and protocol which usually is used to gain secure access to a remote machine. Luckily, SSH is turned on by default on a Debian 9 Server install. While SSH is turned on, we also know that a fresh installation of Debian 9 comes with root access disabled, which means you will not be able to log in directly to your server via SSH as the root user. However, you will be able to run commands with the same authority as the root user when using the ‘sudo’ prefix on your commands. If you are constantly working on your server and you need root access, it’s more comfortable to log in directly as a root user instead of using the ‘sudo’ command all the time.

We can also configure SSH to allow specific users or groups, as well as blacklisting certain users or groups from having access which can make server management a lot easier. Let’s get started.

Several requirements should be met before we can continue.

Requirements:

  • A server running Debian 9 or later
  • Access via SSH to your VPS
  • A regular user that can use ‘su’ or ‘sudo’ to gain root privileges

Log in to your Debian VPS via SSH as a user with ‘sudo’ privileges:

ssh user_name@Server_IP_Address -p Port_Number

Enable SSH Root Login

We need to edit the main SSH configuration file ‘sshd_config‘ so we can enable logging directly as root. In this tutorial, we will use nano as our text editor, but you can freely use any editor you want.

sudo nano /etc/ssh/sshd_config

Find the following line in the file.

#PermitRootLogin prohibit-password

There are two steps to enable the root login.

In the first step, uncomment the line by removing the # character at the beginning of the line, like the following example:

PermitRootLogin prohibit-password

In the second step, simply change the ‘prohibit-password’ to ‘yes’ like in the example shown below:

PermitRootLogin yes

When you finish editing the SSH configuration file, save it and restart the SSH service for the changes to take effect. You can do that by running the following command:

sudo systemctl restart ssh.service

Now when you try to log in as a root user, you should receive an output like this:

login as: root
root@Server_IP_Address password:
Linux hostname 2.6.32-042stab131.1 #1 SMP Wed Jun 20 16:32:07 MSK 2018 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@hostname:~#

Controlling SSH User Logins

If your system has a large number of user accounts, then you can use this section and see how you can limit the remote access to your server.

Open the SSH configuration file/etc/ssh/sshd_config

sudo nano /etc/ssh/sshd_config

There are several options used which will allow or deny access to your server via SSH.

Allowing Users

The first option is to allow a specific user to have remote access to your server via SSH.

Go to the bottom of the SSH configuration file and add AllowUsers on a new line. You can add multiple users by specifying their usernames using a space between them. For example, we will configure users ‘test1’ and ‘test2’ to have access via SSH using:

AllowUsers test1 test2

Once the changes have been made, you need to restart the SSH service.

sudo systemctl restart ssh

Note that all other users who are not in the AllowUsers list will not be able to access the system via SSH.

Allowing Groups

The second option is to allow the entire group to have remote access to your server via SSH.

Go to the bottom of the SSH configuration file and add/edit AllowGroups on a new line. You can add the allowed groups by using a space between them. For example, group ‘root’ and ‘test_group’ will have access to remote SSH if we configure SSH like this:

AllowGroups root test_group

Only those who are in the groups ‘root’ and ‘test_group’ will now be able to connect to the server remotely via SSH.

Restart the SSH service to take effect the changes.

sudo systemctl restart ssh

Denying Users

The third option is to disable or deny SSH access to certain users. This is quite similar to allowing a user or group, with only the keyword changing between them.

Open your SSH configuration file and add/edit DenyUsers on a new line. You can add the denied users by using a space between their usernames. In the next example, user ‘test1’ and ‘test2’ will not have access to remote SSH:

DenyUsers test1 test2

All other users not specified in the DenyUsers list will be able to access the server via SSH.

Restart SSH service to take effect the changes.

sudo systemctl restart ssh

Denying Groups

The fourth option is to disable or deny SSH access to an entire group. Just like denying a user, denying a group can be done with just a simple keyword in the configuration file.

Open your SSH configuration file and add/edit DenyGroups as a new line. You can add the denied groups by using a space between. For example, group ‘root’ and ‘test_group’ will not have access to remote SSH.

DenyGroups root test_group

Only those who are not in the groups ‘root’ and ‘test_group’ will be able to connect to the server remotely via SSH.

That’s it! In this tutorial, we’ve learned how to enable root login on SSH on your server, and we also showed you how to configure your server’s SSH permissions for individual users or for an entire group.


If you use one of our Managed VPS Support services, you can simply ask our system administrators to enable root login through SSH on your Debian server, or allow/deny users and groups access. They are available 24/7 and will take care of your request immediately, along with any other requests that you may have.

PS. If you find this blog post useful, please share it with your friends via social media networks, or if you have any questions please leave a comment below and we will reply to it. Thanks!

The post How to Enable SSH on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-enable-ssh-on-debian-9/feed/ 0
How to Install GCC on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-gcc-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-gcc-on-ubuntu-18-04/#comments Sat, 30 Nov 2019 19:58:27 +0000 https://linuxhostsupport.com/blog/?p=1000 In this article, we will show you how to install GCC on an Ubuntu 18.04 server. If we use the apt command to install GCC from a repository, we will have the default GCC version (GCC 7.4). However, if you want the latest version of GCC, you will need to install it from source. Version 8 […]

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

]]>
In this article, we will show you how to install GCC on an Ubuntu 18.04 server.

If we use the apt command to install GCC from a repository, we will have the default GCC version (GCC 7.4). However, if you want the latest version of GCC, you will need to install it from source. Version 8 of GCChas complete C++11, C++14 support, partial C++17 support, and experimental C++2a support. With GCC 8, C11 and C++14 support are enabled by default, and there is no need to add -std=c11 or -std=c++14. Let’s get started.

Step 1. Update the Server

Like always, we need to make sure that we have an up-to-date system. This ensures compatibility between packages:

sudo apt update && sudo apt upgrade

Step 2. Install GCC

Method 1: Install GCC from Source

Before we start with the installation, it is highly recommended to start a screen session. This will ensure that all actions that we perform will persist on the server even if our connection times out.

Run the following command:

screen -U -S gcc

Now, we will install the default GCC toolchain with this command:

sudo apt install build-essential

Next, from the official documentation for GCC 8 at https://gcc.gnu.org/mirrors.html we will download the prerequisites and the source code.

cd ~
wget https://ftpmirror.gnu.org/gcc/gcc-8.2.0/gcc-8.2.0.tar.gz
tar xf gcc-8.2.0.tar.gz
cd gcc-8.2.0
contrib/download_prerequisites

In this step, we will configure the construction parameters. The best way to keep the system clean is to use /usr/local/gcc-8.2 for the installation directory and add the suffix -8.2 to the GCC compilers. We do not want to mess the system’s default GCC because other packages may depend on the default version. Of course, if you’re installing a version newer than 8.2, you can rename the folders to the correct version number.

cd ~
mkdir build && cd build
../gcc-8.2.0/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-8.2 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-8.2

Again, rename the version number if necessary. The above command runs a script that prepares the program to compile the source code specifically for your server.

We are ready to build GCC. At this point, it is very important to know that the build may take a long time. To speed up the process we can use as twice the number of our computer cores. In our example, we will use 8 parallel jobs to build GCC:

make -j 8

Build phase depends on the speed of your server. This may take from a few minutes to a few hours to complete the build, depending on your server’s hardware capabilities.

Once the build is finished, we can continue to actually installing GCC with the following command:

sudo make install

With adding the following lines at the end of the .bashrc file, we will permanently add the compilers to the system’s path.

nano /root/.bashrc

Add this to the end of that file:

export export PATH=/usr/local/gcc-8.2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/gcc-8.2/lib64:$LD_LIBRARY_PATH

With this command, we will reload .bashrc without restarting the machine:

. .bashrc

Method 2: Install GCC from Repository

As we mentioned at the beginning of this tutorial, we can easily install GCC compiler on Ubuntu 18.04 by typing the following command:

sudo apt install gcc gcc-8 g++-8

However, there is another way to install GCC through the build-essential package. This package will also install additional libraries as well as g++ compiler.

sudo apt install build-essential

Step 3. Verify GCC Installation

We can check if GCC is properly installed with the command below:

sudo whereis gcc make

Output:

gcc: /usr/bin/gcc /usr/lib/gcc /usr/share/man/man1/gcc.1.gz
make: /usr/bin/make /usr/share/man/man1/make.1.gz /usr/share/man/man1/make.1posix.gz

Alternatively, we can run

sudo gcc-8 --version

Output:

gcc-8 (Ubuntu 8.2.0-1ubuntu2~18.04) 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.

To get the version of make, you can use these commands:

make -v

or

make --version

and we will have an output similar to this:

GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Step 4. Installation of dev Man Pages

If we want to install the dev man pages just we need to execute the command:

sudo apt-get install manpages-dev man-db manpages-posix-dev

If we want to view the library cells, we can run:

man 3 scanf

Output:

man 2 execve

Output:

man 2 fork

Output:

After we finished and confirmed that we have installed the compilers and all the main components, it’s time to test the GNU GCC compiler.

Step 5. Test GCC compilers

In order to test our compilers, we will run a few very simple C++ programs.

Open your favorite editor (in our example we are using nano as editor)

nano hello_world.cpp

and enter the code inside.

// Simple C++ "Hello World" program

// Header file for input output functions
#include

using namespace std;

// main function -
// where the execution of program begins

int main()
{
// prints hello world
cout<<"Hello World ! \n";

return 0;
}

After we save our project, we can compile it with the following command:

g++ hello_world.cpp -o hello

When the compiling process is done, there should be a file called hello in the current directory. We can check this if we list the files and directories with this command:

ls -lah

Now we can test our project with:

./hello

By executing the hello command we will receive the following output:

Hello world !

In the following example, we can test the generalized lambda capture, also known as init capture that was introduced in the C++ 14 standard.

nano test.cpp
// C++14 standard could use "auto" for the type of a parameter
#include

int main() {
std::cout << [](auto a, auto b) { return a + b; } (4, 3) << std::endl;
std::cout << [](auto a, auto b) { return a + b; } (4.23, 6.25) << std::endl;
return 0;
}

Paste the code inside the test.cpp and save it. Now we can compile our code with the command:

g++-8 -Wall -pedantic test.cpp -o test

When the compiling process is complete, we can execute:

./test

And we will receive the following output:

7
10.48

And that’s it. In this article we managed to install the GCC compiler from source and repository, we also verified the installation of GCC. We installed the dev man pages, and at the end, we tested the GCC compilers with two very simple examples.


Of course, you don’t have to install GCC on Ubuntu 18.04 if you use one of our Managed VPS Support services, in which case you can simply ask our expert Linux admins to install GCC on your Ubuntu 18.04 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 GCC on Ubuntu 18.04, or if you found it helpful, please share it with your friends on the social networks using the share shortcuts, or simply leave a reply below. Thanks.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-gcc-on-ubuntu-18-04/feed/ 1
How to Install PrestaShop on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-prestashop-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-prestashop-on-ubuntu-18-04/#comments Wed, 20 Nov 2019 20:22:07 +0000 https://linuxhostsupport.com/blog/?p=986 In this article, we will show you how to install PrestaShop on Ubuntu 18.04 LTS. PrestaShop is a free shopping cart platform written in the PHP programming language with support for the MySQL database management system. PrestaShop is used to build and run an online store and it is very easy to use. With PrestaShop, […]

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

]]>
In this article, we will show you how to install PrestaShop on Ubuntu 18.04 LTS.

PrestaShop is a free shopping cart platform written in the PHP programming language with support for the MySQL database management system. PrestaShop is used to build and run an online store and it is very easy to use. With PrestaShop, you can share your ideas and products and sell them on the internet. Let’s get started.

Step 1: Log in via SSH on the Ubuntu server:

Log in via SSH to your server as the root user (or as a user with sudo privileges)

ssh root@Server_IP_Address -p Port_number

Replace “Server_IP_Address” and “Port_number” with the respective values from your Ubuntu server.

Step 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

Step 3: Install LAMP (Apache, MySQL and PHP 7.2) Server Stack

In this step, we will install some of the requirements for the PrestaShop installation. To install the LAMP server and all of the required PHP extensions, run the following commands:

sudo apt install apache2 libapache2-mod-php mysql-server 
sudo apt install php7.2-cli php7.2-common php7.2-curl php7.2-zip php7.2-gd php7.2-mysql php7.2-xml php7.2-mbstring php7.2-json php7.2-intl

In order to enable the Apache mod_rewrite module, type the next command:

sudo a2enmod rewrite

Run the command below to locate the PHP configuration file:

php -i | grep -i php.ini

Edit the PHP configuration file:

nano /etc/php/7.2/cli/php.ini

Then set the following values as shown:

memory_limit = 128M
upload_max_filesize = 32M

For changes to take effect, we need to restart the web server:

sudo systemctl restart apache2

Step 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, we will create our database:

CREATE DATABASE prestashop;

We will then add a separate user that will be able to interact with the PrestaShop database:

GRANT ALL PRIVILEGES ON prestashop.* to 'prestashop'@'localhost' IDENTIFIED BY '5tr0ng_Pa55w0rD';

Please do not forget to change ‘5tr0ng_Pa55w0rD‘ with an actual strong password.

To apply the privileges that we set, we will run this command:

FLUSH PRIVILEGES;

After we finish, we can exit from the MySQL session with the command:

quit

Step 5: Install PrestaShop

First, we will download the latest stable version of PrestaShop in the /opt directory on the server and extract it in the /var/www/html/ directory:

cd /opt
wget https://download.prestashop.com/download/releases/prestashop_1.7.5.0.zip
unzip prestashop_1.7.5.0.zip
unzip prestashop.zip -d /var/www/html/prestashop/

We will set appropriate file permissions and ownership to the files (in this tutorial it is the www-data user and group because we are using the Apache web server on Ubuntu):

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

Step 6: Configure the Apache Web Server

In this step, we will set a new Virtual Host on the web server so it can serve the PrestaShop directory. To do that we need to create a new Apache configuration file by using your preferred text editor:

sudo nano /etc/apache2/sites-available/prestashop.conf

Now we can modify it and add the following lines:

<VirtualHost *:80>
    ServerAdmin admin@your_domain.com
    ServerName your_domain.com
    ServerAlias www.your_domain.com
    DocumentRoot /var/www/html/prestashop

    <Directory /var/www/html/prestashop>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /var/log/apache2/prestashop-error_log
    CustomLog /var/log/apache2/prestashop-access_log common
</VirtualHost>

Do not forget to change ‘your_domain.com‘ with your actual registered and configured domain name. Save the file and exit.

We can enable the Apache PrestaShop configuration by running this command:

sudo a2ensite prestashop.conf

We will also remove the default Apache configuration file:

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

Once we make all the changes above, we will restart the Apache web server for the changes to take effect:

sudo systemctl restart apache2

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 PrestaShop Installation Assistant page:

PrestaShop Install Screen

You can select the installation language and continue with the installation by clicking on the ‘Next’ button.

Make sure to read the License Agreements. You can continue with the installation upon agreeing to the License Agreements.

PrestaShop License Agreement

In this stage, you will check the PrestaShop compatibility with your system’s environment. Continue by clicking on the ‘Next’ button.

PrestaShop System Compatibility

In the fourth stage of the web installation, enter all of the necessary information about your store and then proceed to the next step.

PrestaShop Settings

Enter the information about the database that we created in step 4 of this article.

Database server address: 127.0.0.1

Database name: prestashop

Database login: prestashop

Database password: <The password you set earlier in the database setup>

PrestaShop Database Setup

Congratulations! The installation is now complete.

PrestaShop Installation Finished

 

The last step we need to do is to remove the ‘install’ directory from the server. We can do this with the following command:

rm -rf /var/www/html/prestashop/install/

If you carefully followed the steps in this tutorial, you should have a working PrestaShop instance on your Ubuntu 18.04 VPS. For more details about PrestaShop configuration and usage, please check their official documentation.


Of course, you don’t have to install PrestaShop on Ubuntu 18.04 if you use one of our Fully Managed Linux Server Support services, in which case you can simply ask our expert system administrators to install PrestaShop on Ubuntu 18.04 for you, using the LAMP 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 PrestaShop on Ubuntu 18.04, or if you found it helpful, please share it with your friends on the social networks using the share buttons, or simply leave a comment in the comments section. Thanks.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-prestashop-on-ubuntu-18-04/feed/ 3
How to Install Docker on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-docker-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-docker-on-ubuntu-18-04/#respond Thu, 10 Oct 2019 13:59:20 +0000 https://linuxhostsupport.com/blog/?p=927 In this tutorial, we will cover the steps needed for installing Docker on Ubuntu 18.04. Docker is mainly a software development platform and a kind of virtualization technology that makes it easy to develop and deploy apps inside of neatly packaged virtual containerized environments. Docker containers can be deployed to any machine without any compatibility […]

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

]]>
In this tutorial, we will cover the steps needed for installing Docker on Ubuntu 18.04.

Docker is mainly a software development platform and a kind of virtualization technology that makes it easy to develop and deploy apps inside of neatly packaged virtual containerized environments. Docker containers can be deployed to any machine without any compatibility issues, so the software stays system agnostic, simpler to use, less work to develop and easy to maintain and deploy.

Docker is a form of virtualization but, unlike a Virtual Machine, the resources are shared directly with the host. Let’s begin with the installation.

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. Connect via SSH

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

Once the upgrade is completed we can move on to the next step.

Step 2. Install Docker on Ubuntu 18.04

To get the latest version of Docker, we will install it from the official Docker repository. We will add a new package source, and add the GPG key from Docker to be able to verify that the downloads are valid.

We need to install a few prerequisite packages with the following command:

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Now, we will add the GPG key for the official Docker repository and add the Docker repository to APT sources with the following commands:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"

Next, we will update the package database with the Docker packages:

sudo apt update

and make sure that we will install Docker from the Docker repo instead of the Ubuntu repo:

apt-cache policy docker-ce

The output should be similar to this:

docker-ce:
Installed: (none)
Candidate: 5:18.09.5~3-0~ubuntu-bionic
Version table:
5:18.09.5~3-0~ubuntu-bionic 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
5:18.09.4~3-0~ubuntu-bionic 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
5:18.09.3~3-0~ubuntu-bionic 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
5:18.09.2~3-0~ubuntu-bionic 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
5:18.09.1~3-0~ubuntu-bionic 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
5:18.09.0~3-0~ubuntu-bionic 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
18.06.3~ce~3-0~ubuntu 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
18.06.2~ce~3-0~ubuntu 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
18.06.1~ce~3-0~ubuntu 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
18.06.0~ce~3-0~ubuntu 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
18.03.1~ce~3-0~ubuntu 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages

Finally, we will install Docker with the following command:

sudo apt install docker-ce

To check that Docker is installed, daemon started and the process enabled execute the following command:

sudo systemctl status docker

The output should be similar to the following:

 docker.service - Docker Application Container Engine
       Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
       Active: active (running) since Wed 2019-05-01 11:06:05 UTC; 10s ago
             Docs: https://docs.docker.com
Main PID: 4234 (dockerd)
       Tasks: 8
    CGroup: /system.slice/docker.service
                    └─4234 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

We successfully installed Docker. Now in the next steps, we will show you how to use the docker command.

Step 3. Using the Docker Command

The syntax of the Docker CLI command takes this form:

docker [option] [command] [arguments]

To list all available commands we need to run the docker command with no parameters:.

docker

The output should be similar to the following:

A self-sufficient runtime for containers

Options:
--config string Location of client config files (default "/root/.docker")
-D, --debug Enable debug mode
-H, --host list Daemon socket(s) to connect to
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem")
--tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem")
--tlskey string Path to TLS key file (default "/root/.docker/key.pem")
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit

Management Commands:
builder     Manage builds
config      Manage Docker configs
container   Manage containers
engine      Manage the docker engine
image       Manage images
network     Manage networks
node        Manage Swarm nodes
plugin      Manage plugins
secret      Manage Docker secrets
service     Manage services
stack       Manage Docker stacks
swarm       Manage Swarm
system      Manage Docker
trust       Manage trust on Docker images
volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

If you want to see the options available to a specific command, execute the following command:

docker docker-subcommand --help

To view information about Docker:

docker info

Step 4. The Docker Command Line Interface

To search for an image from Docker Hub registry, we can use the following command:

docker search ubuntu

To download the official Ubuntu 18.04, we can do this by using the image pull subcommand:

docker image pull ubuntu

If there is no tag specified, Docker will pull the latest image.

We can list the images by using the following command:

docker image ls

If you want to remove the image for some reason, you can use the following command:

docker image rm ubuntu

If you need to start, stop, remove and manage a container you can do this with the docker container subcommand.

With the following command, we can start a Docker container:

docker container run ubuntu

If you need to interact the container via the command line, you can do this executing the following command:

docker container run -it ubuntu /bin/bash

To list all active containers, type:

docker container ls

but if you want to view both active and inactive containers, type:

docker container ls -a

To remove docker containers execute the following command:

docker container rm [container_id]

Those are just some of the things you can do with Docker – it’s a very versatile program.

In this tutorial, we learned how to install Docker on Ubuntu 18.04 and how to use the docker commands and command line interface.


Of course, you don’t have to install Docker on Ubuntu 18.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 Docker on Ubuntu 18.04 for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this tutorial on installing Docker on Ubuntu 18.04, or if you found it helpful, please share it with your friends on the social networks by using the share shortcuts below, or simply leave a comment in the comments section. Thank you.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-docker-on-ubuntu-18-04/feed/ 0
How to Install Apache Cassandra on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-apache-cassandra-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-apache-cassandra-on-ubuntu-18-04/#respond Fri, 20 Sep 2019 15:39:30 +0000 https://linuxhostsupport.com/blog/?p=905 In this article, we will show you how to install Apache Cassandra on Ubuntu 18.04. Apache Cassandra is an open-source NoSQL database manager which offers high availability and scalability by providing fault-tolerant multi-level cloud setup. It is useful for applications that will require a lot of data with redundancy but without compromising performance and security. There are […]

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

]]>
In this article, we will show you how to install Apache Cassandra on Ubuntu 18.04.

Apache Cassandra is an open-source NoSQL database manager which offers high availability and scalability by providing fault-tolerant multi-level cloud setup. It is useful for applications that will require a lot of data with redundancy but without compromising performance and security. There are several advantages that we’ll go over down below. Let’s begin with the installation.

The main advantages of the Apache Cassandra database software against competing options are the following:

  • Distributed Nodes
  • Replication Support
  • Scalable
  • Fault-Tolerant
  • Data Consistency and Redundancy
  • In-house Query Language (Cassandra Query Language)

Apache Cassandra is developed by Apache Software Foundation using Java.

It is licensed under Apache License 2.0. As of writing, the latest stable version of Apache Cassandra is 3.11.

Hardware Requirements

For this tutorial, we will be using an Ubuntu VPS. Before continuing, make sure that your server meets the following minimum or recommended hardware configuration.

The basic rule for every application requirement is the more, the better, especially for busy databases. Apache Cassandra database software is CPU and RAM resource-intensive, and will perform better on CPUs with more cores, and servers with a greater capacity of RAM. It also requires RAM with ECC capability to avoid any memory-related code corruption. The minimum hardware requirement for a production server installation is 2 CPU cores and 8GB of RAM with ECC. The recommended amount of resources would be 8 CPU cores and 32GB of RAM or more with ECC.

For disk setup, it is recommended to use a RAID 0 configuration to make use of the additional throughput that the setup can provide.

Step 1: Checking for Updates and Dependencies

To start with the installation, log in first to your server via SSH using your favorite terminal:

ssh [username]@[server_ip_address] -p [Port_Number]

Modify the [username]variable with the account name of a root-privileged user found on the server (or the root user itself), and replace the [server_ip_address] and [Port_Number] variables with the public facing IP address and SSH port number of your server.

Before starting with the installation, it is best to update and upgrade all installed Ubuntu packages with their latest versions:

apt-get update
apt-get upgrade

It is also best to install Linux common libraries and dependencies to ensure we will not encounter any missing library or dependency issues during and for future installations.

apt-get install software-properties-common build-essential -y

Step 2: Installing OpenJDK

To begin, we will need to install Java on our server since Apache Cassandra makes use of the Java VM. Currently, Apache Cassandra is not stable on the latest version of Java which is Java 11. For this, we will install Java 8 which is a reliable and stable version of Java.

Fortunately, OpenJDK version 8 is included by default in Ubuntu’s repository. To proceed, type the following command:

apt-get install openjdk-8-jdk -y

Once the Java 8 package and requirements have been installed, verify our current active Java version:

java -version

The prompt should then output the following text:
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)

OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)

Step 3: Installing Apache Cassandra

Apache Cassandra repository is not available in Ubuntu by default. For this, we will need to download and activate its repository.

First, we will need to add the GPG keys using the following command:

wget -q -O - https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -

Second, use the following command to add and enable the Apache Cassandra repository. Please note that at the time of writing, the latest version of Apache Cassandra is v3.11.

sh -c 'echo "deb http://www.apache.org/dist/cassandra/debian 311x main" > /etc/apt/sources.list.d/cassandra.list'

To get the latest package from the repository, supply the Ubuntu update command:

apt-get update

Finally, install Apache Cassandra and additional packages and libraries it requires using this next line:

apt-get install cassandra -y

Verify the Apache Cassandra service is installed and running:

systemctl status cassandra

● cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; generated)
Active: active (exited) since Sun 2019-05-19 18:36:31 CDT; 1min 50s ago
Docs: man:systemd-sysv-generator(8)

Make sure Apache Cassandra is enabled at boot/startup:

systemctl enable cassandra

Step 4: Configuring Apache Cassandra

The main configuration file for Apache Cassandra is located at

/etc/cassandra/cassandra.yaml

Here are the parameters that can be modified:

  • cluster_name: your preferred cluster name
  • seeds: set of IP address of nodes separated by a comma
  • storage_port: the data storage port, must be allowed in the firewall
  • listen_address: sets the port where Apache Cassandra should listen
  • native_transport_port: port for clients to connect with Cassandra, must also be allowed in the firewall

Step 5: Testing Apache Cassandra

Check if we can see the status using built-in nodetool from the Apache Cassandra package. Nodetool is used for managing Apache Cassandra clusters. You can learn more about nodetool here.

nodetool status

Almost the same output should be produced as Apache Cassandra settings is at default.

To check the connection to our default cluster (Test Cluster), we will utilize Apache Cassandra’s built-in command line shell called cqlsh. It is used to interact with Apache Cassandra using its own query language called CQL (Cassandra Query Language)

To get into the shell, type the following:

cqlsh

You should see almost the same output.

That’s ityou now have a working Apache Cassandra cluster powered by Ubuntu 18.04. To learn more about setting up Apache Cassandra, check their official online documentation here.


Of course, you don’t have to install Apache Cassandra on Ubuntu 18.04if you use or have one of our Managed Linux VPS Support services, in which case you can just ask our support team to install Apache Cassandra on your Ubuntu 18.04 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 Apache Cassandra on Ubuntu 18.04, feel free to share it on social networks using the share shortcuts, or simply leave a comment in the comments section. Thanks.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-apache-cassandra-on-ubuntu-18-04/feed/ 0
How to install Easy Hosting Control Panel on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-easy-hosting-control-panel-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-easy-hosting-control-panel-on-ubuntu-16-04/#comments Wed, 21 Mar 2018 08:34:03 +0000 https://linuxhostsupport.com/blog/?p=496 Easy Hosting Control Panel (EHCP) is a free and open source control panel written in PHP, which can be used to host your websites on your virtual private server. Easy Hosting Control Panel provides a simple and easy to use interface, for creating and managing users, websites,  MySQL databases, DNS management, ftp and email accounts, and much more. […]

The post How to install Easy Hosting Control Panel on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
Easy Hosting Control Panel (EHCP) is a free and open source control panel written in PHP, which can be used to host your websites on your virtual private server. Easy Hosting Control Panel provides a simple and easy to use interface, for creating and managing users, websites,  MySQL databases, DNS management, ftp and email accounts, and much more. In this tutorial, we will show you how to install the Easy Hosting Control Panel on Ubuntu 16.04. Let’s get started.

1. Log in via SSH and update the system

Before we begin, you will need to login to your server via SSH as user root:

ssh root@IP_ADDRESS -p PORT_NUMBER

and replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number.

Let’s also make sure that your Ubuntu 16.04 server is up-to-date by running the following commands:

apt-get update
apt-get upgrade

2. Download EHCP

You can download the latest EHCP version from the official website with the following command:

wget -O ehcp.tgz ehcp.net/ehcp_yeni.tgz

and then extract the archive by executing:

tar -zxvf ehcp.tgz

3. Install EHCP

Next, we can enter the ehcp directory with:

cd ehcp

and run the installation script in order to start the EHCP installation:

./install.sh

The installation script will install all the necessary packages and services.

We will go through all the required steps and make sure the installation is completed properly.

During the installation process please read and follow all the instructions carefully.

Let’s start by pressing Enter to continue.

STAGE 1
=====================================================================

--------------------EHCP PRE-INSTALLER 0.38.5.b -------------------------
-----Easy Hosting Control Panel for Ubuntu, Debian and alikes--------
-------------------------www.ehcp.net--------------------------------
---------------------------------------------------------------------

Now, ehcp pre-installer begins, a series of operations will be performed and main installer will be invoked.
If any problem occurs, refer to www.ehcp.net forum section, or contact us, mail:
info@ehcp.net
Please keep in mind, Ehcp 0.38.3 and later is for Ubuntu 16.04 and later. Ehcp is specifically tested for Ubuntu, but should also work on many Debian based distros.

For automated installs, use ./install.sh unattended (passwords are default in this case)
Please be patient, press enter to continue

Press Enter one more time:

Note that ehcp can only be installed automatically on Debian based Linux OS'es or Linux'es with apt-get enabled..(Ubuntu, Kubuntu, debian and so on) Do not try to install ehcp with this installer on redhat, centos and non-debian Linux's... To use ehcp on no-debian systems, you need to manually install..
This installer is for installing onto a clean, newly installed Ubuntu/Debian. If you install it on existing system, some existing packages will be removed after prompting, if they conflict with packages that are used in ehcp, so, be careful to answer yes/no when using in non-new system
Note that, this is just a utility.. use at your own risk.
Ehcp also sends some usage data to developer for statistical/improvement purposes

Outline of install process:
1- Update apt-get repo info (apt-get update)
2- Install Php (That will run Main installer)
3- Run Main installer (Run install_1.php and install_2.php to install other server related software, such as mysql/mariadb, apache, nginx, etc.)

Press enter to continue

 

The main installer will show you which EHCP version you are installing. You can press Enter again in order to continue:

-----------------------EHCP MAIN INSTALLER---------------------------
------Easy Hosting Control Panel for Ubuntu, Debian and alikes ------
--------------------------www.ehcp.net-------------------------------

---------------------------------------------------------------------
ehcp version 0.38.5.b
ehcp installer version 0.38.5.b
Unattended:

Starting Ehcp install, please read prompts/questions carefully !
Some install/usage info and your name/email is sent to ehcp developers for statistical purposes and for improvements
Ehcp now also has professional version and support, as described at http://ehcp.net/?q=node/1518

press enter to continue:
--------------

 

You will then be asked to either enter a new or leave the password for the MySQL “root” user unchanged.

You will also be asked to enter your name, email address and set up the MySQL and admin user password for the “ehcp” account. Make sure you replace STRONGPASSWORD with an actual strong password.

EHCP INSTALL - INPUTS/SETTINGS SECTION:

THIS SECTION IS VERY IMPORTANT FOR YOUR EHCP SECURITY AND PASSWORD SETTINGS.
PLEASE ANSWER ALL QUESTIONS CAREFULLY

Please enter your name:rosehosting
Please enter your/admin email (used to send your panel info, ehcp news)- Enter an already working email:admins@example.com
mysql root pass being checked ...

Your mysql root pass is identified as empty. Enter NEW PASSWORD for mysql user of `ehcp` (default 1234): 
Please pay attention that, you cannot use sign # in your password: STRONGPASSWORD
Enter ehcp panel admin NEW PASSWORD (default 1234): STRONGPASSWORD
Enter ehcp panel admin NEW PASSWORD AGAIN: STRONGPASSWORD

============== MYSQL PASSWORD SETTINGS COMPLETE ... see troubleshoot if your ehcp does not work ==============

 

Next, you will be asked for your Hostname, IP address and preferred language. You can just leave them all to the default settings by pressing Enter on each of the questions:

Enter your hostname, IP address, preferred language etc. If you want to leave defaults, just press Enter. In my case, I go with defaults.

Your hostname seems to be host, if it is different, enter it now, leave blank if correct

Hostname is set as host
Your ip seems to be 111.222.333.444, if it is different or you want to use a different (external) ip, enter it now, leave blank if correct

LANGUAGE SELECTION:

ehcp currently supports English,Turkish,German,Spanish,French (some of these partial) except installation
enter language file you want to use (en/tr/german/spanish/nl/fr/lv/pt_br [default en]):

Do you want to install some additional programs which are not essential but useful for a hosting environment, such as ffmpeg,... etc.. ? Answer no if you have small ram or you need a light/fast system (y/[n])

At some point during the installation you will be asked to configure the roundcube database. Press “Yes” and then enter a password for the roundcube database user.

The database for phpmyadmin also needs to be configured. When asked about it, select “Yes” and then enter a password for the phpmyadmin database user.

After you enter the password you will also be asked to choose the web server which will be configured to run phpMyAdmin. Since we have an Apache web server on our VPS we chose the “apache2” option (you can press SPACE on your keyboard to choose which server you would like and then press OK).

Next, we need to select the mail server configuration type based on our needs. In our case, we went with the default one “Internet Site” option.

We also need to enter the mail name of the server. This name should be a fully qualified domain name (FQDN).

Lastly, you will be asked to create directories for web-based administration. Select “Yes” to continue.

With this last step, the installation should be completed. The following output should appear on your screen:

ehcp run/restart complete..

if your server is behind a router/modem in your network, you need to Open/redirect necessary ports on your modem/router:
these ports need to be opened/redirected :
20,21,22,25,53,80,110,143 (tcp+udp)

ehcp install finished up to now. we are continuing on simplifying the install process.
sory for any inconvenience. you can contact email/msn: info@ehcp.net
you may join us in developing this control panel.

You may visit http://www.ehcp.net
You may support by donating cash, buying a pro license, doing php coding, html design, graphic design...
You may support by donating free dedicated or virtual servers for this project...

CURRENTLY WE NEED A DEDICATED SERVER WITH 8 CORE, 8GRAM, 500G hdd at least (or, you may consider to buy a pro license or donate..)

ehcp : Finished all operations.. go to your panel at http://yourip/ now...

3. Access EHCP dashboard

After the installation is complete, you can access the control panel through your browser with “http://your-ip-address”

install Easy Hosting Control Panel on Ubuntu 16.04

Once you open this page you can then click the link that says’ “Click here for the control panel on your server!”
This will take you the EHCP login screen. You can log in using “admin” as username and the password you have set during the installation. If you haven’t set any password you will need to use the default one “1234”.

That’s it. EasyHosting Control Panel has been successfully installed on your Ubuntu 16.04  server.

We can install, configure, set up and optimize Easy Hosting Control Panel on Ubuntu 16.04 for you if you are one of our Linux server support customer.  Our expert Linux administrators are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to install Easy Hosting Control Panel on Ubuntu 16.04, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

 

The post How to install Easy Hosting Control Panel on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-easy-hosting-control-panel-on-ubuntu-16-04/feed/ 10
How To Change Your Hostname on Debian https://linuxhostsupport.com/blog/how-to-change-your-hostname-on-debian/ https://linuxhostsupport.com/blog/how-to-change-your-hostname-on-debian/#respond Wed, 21 Feb 2018 08:29:09 +0000 https://linuxhostsupport.com/blog/?p=448 In this tutorial, we will show you how to change your hostname on a Debian operating system. Changing the hostname of your Debian server is a very easy task and if you carefully follow the instructions provided in this tutorial it will take you no longer than 5 minutes to do it. What is a […]

The post How To Change Your Hostname on Debian appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to change your hostname on a Debian operating system. Changing the hostname of your Debian server is a very easy task and if you carefully follow the instructions provided in this tutorial it will take you no longer than 5 minutes to do it.

What is a hostname?

The hostname is a label that is assigned during the initial server setup and it is used to identify and easily distinguish one server from another. When choosing your hostname you should also make sure to use a Fully Qualified Domain Name (FQDN) and it should be pointed to your server IP address so you can access your server by using it.

Connect to your server

Before you change your hostname, you will first need to connect to your Debian server via SSH.

Once you have successfully connected to your server, you can use the following command to check your current hostname:

hostname

And to check your Fully Qualified Domain name (FQDN) you can run the following command instead:

hostname -f

Change your hostname

To change your hostname, we can simply run the following command:

hostname new.hostname.com

Make sure you replace “new.hostname.com” with the hostname you would like to use. This will change your hostname but only until next server reboot.

On Debian based systems, the hostname of the system is stored in the /etc/hostname file. Upon server boot, the hostname contained in this file is assigned to the system by the init script located at /etc/init.d/hostname.sh.

So in order to change our hostname permanently, you will need to update this file. You can open it with your favorite text editor, for example:

nano /etc/hostname

Change the hostname, save the file and exit the text editor.

You can now execute the init script in order to make the change active immediately:

/etc/init.d/hostname.sh start

This will also permanently update our hostname even after a server reboot.

Change hostname with hostnamectl command

Another alternative way to change your hostname is to use the hostnamectl command. You can run the following command in order to permanently update the hostname of your system:

hostnamectl set-hostname new.hostname.com

You can also check the current hostname status with:

hostnamectl status

You should get an output similar to this:

Static hostname: new.hostname.com
Icon name: computer-container
Chassis: container
Machine ID: ****
Boot ID: ***
Operating System: Debian GNU/Linux 9 (stretch)
Kernel: Linux 2.6.32-042stab127.2
Architecture: x86-64

For more information about the hostnamectl command use the –help flag:

hostnamectl --help

hostnamectl [OPTIONS...] COMMAND ...

Query or change system hostname.

 -h --help Show this help
    --version Show package version
    --no-ask-password Do not prompt for password
 -H --host=[USER@]HOST Operate on remote host
 -M --machine=CONTAINER Operate on local container
    --transient Only set transient hostname
    --static Only set static hostname
    --pretty Only set pretty hostname

Commands:
 status Show current hostname settings
 set-hostname NAME Set system hostname
 set-icon-name NAME Set icon name for host
 set-chassis NAME Set chassis type for host
 set-deployment NAME Set deployment environment for host
 set-location NAME Set location for host

 

If you use one of our Linux Support Services, you don’t have to change your hostname yourself, you can simply ask our expert Linux admins to change the hostname 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 Change Your Hostname on Debian, 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 Change Your Hostname on Debian appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-change-your-hostname-on-debian/feed/ 0
Speed Up SSH Connections in Linux https://linuxhostsupport.com/blog/speed-up-ssh-connections-in-linux/ https://linuxhostsupport.com/blog/speed-up-ssh-connections-in-linux/#respond Wed, 03 Jan 2018 08:16:10 +0000 https://linuxhostsupport.com/blog/?p=318 We’ll show you, how to speed up SSH connections in Linux. SSH is a very secure method for managing Linux servers. Sometimes it can be very slow especially if you need to open multiple SSH connections to your server. One such scenario would be if you use Git for your development work, as Git uses […]

The post Speed Up SSH Connections in Linux appeared first on LinuxHostSupport.

]]>
We’ll show you, how to speed up SSH connections in Linux. SSH is a very secure method for managing Linux servers. Sometimes it can be very slow especially if you need to open multiple SSH connections to your server. One such scenario would be if you use Git for your development work, as Git uses multiple SSH connections to transfer files and if your server is not configured correctly it will add unnecessary overhead by re-establishing a connection for every file transferred. In today’s tutorial we are going to learn how to speed up SSH connections in Linux. Let’s get started!

1. Disable DNS lookup on the server

The OpenSSH server has DNS lookups enabled by default, this means that the OpenSSH server will first look up the host name of the connecting host and then will check if the resolved host name’s IP address is the same as the connecting IP address.To disable DNS lookups, add the ‘UseDNS’ directive at the end of the ‘/etc/ssh/sshd_config’ file and set the value to ‘no’:

# nano /etc/ssh/sshd_config

# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

# Disable DNS lookups
UseDNS no

2. Re-use existing SSH connection

If you open multiple SSH connections to your server frequently, it would be best to configure your SSH client to use the existing connection when creating a new SSH session.This can speed up the sessions opened after the initial connection as it avoids the overhead of establishing a new connection.

Open the ‘~/.ssh/config’ file with nano and add the following lines in it:

# nano ~/.ssh/config

Host *
ControlMaster auto
ControlPath  ~/.ssh/sockets/%r@%h-%p
ControlPersist 600

The ‘Host *’ directive above tells the SSH client to re-use the initial connection for all remote servers.

3. Setting up a password-less SSH login

Setting up a password-less SSH login is pretty easy and saves you time because you don’t have to enter a password when you open a new SSH connection.This can be done in three easy steps.

1.Generate the public/private key pair using this command:

# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): Press Enter.
Enter passphrase (empty for no passphrase): Press Enter.
Enter same passphrase again: Press Enter.
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:/LEFoGKAt/qC9NeEfIfWm988IUqJaAuYBDvuDuu/jk8 root@test
The key's randomart image is:
+---[RSA 2048]----+
| ..     .        |
|o ..   . .       |
|.o .o .   .      |
|o... . .   .     |
|ooo . o S o .    |
|.= . = * * = .   |
|=..Eo * o * . .  |
|+o+. o . +  o.   |
|+=+=o     .. o.  |
+----[SHA256]-----+

2.Copy the public key to the remote server using this command:

# ssh-copy-id -i ~/.ssh/id_rsa.pub remote-server
root@remote-server's password:
Now try logging into the machine, with "ssh 'remote-server'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

3.Log in to the remote server to check if the password-less login is working:

# ssh remote-server

Last login: Thu Dec 28 20:10:38 2017 from 10.20.30.4


root@remote-server$

If everything goes well you should see the output displayed above.

4. Changing the encryption used by the OpenSSH server

Changing the default cipher order for the SSHv2 protocol on the OpenSSH server can further speed up SSH connections as some ciphers can encrypt data faster than others.
For Ubuntu 16.04 the default order according to ‘man ssh_config’ is:

The default is:

	chacha20-poly1305@openssh.com,
	aes128-ctr,aes192-ctr,aes256-ctr,
	aes128-gcm@openssh.com,aes256-gcm@openssh.com,
	aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc

If you do have a server which supports the new AES-NI instructions it would be better to change this order and add it to the end of the ‘/etc/ssh/sshd_config’ file like this:

# nano /etc/ssh/sshd_config

# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

# Disable DNS lookups
UseDNS no

# Change the order of the ciphers used
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,chacha20-poly1305@openssh.com,3des-cbc

According to several benchmarks available online, aes128-ctr is twice as fast as chacha20-poly1305 on processors that support the AES-NI instructions so if you have a high-bandwidth connection to your server the file transfer speed should increase significantly after making the change.

That’s it, now your SSH connections should be a lot faster.

Of course, you don’t have to Speed Up SSH Connections in Linux, all by yourself, if you use one of our outsourced linux support services, in which case you can simply ask our expert Linux admins to speed up the SSH connections on your Linux 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 speed up SSH connections in Linux, please share it with your friends on the social networks using the buttons on the right or simply leave a reply below. Thanks.

The post Speed Up SSH Connections in Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/speed-up-ssh-connections-in-linux/feed/ 0
How to Setup Reverse SSH Tunnel on Linux https://linuxhostsupport.com/blog/how-to-setup-reverse-ssh-tunnel-on-linux/ https://linuxhostsupport.com/blog/how-to-setup-reverse-ssh-tunnel-on-linux/#respond Wed, 20 Dec 2017 14:44:33 +0000 https://linuxhostsupport.com/blog/?p=302 We’ll explain to you, how to set up reverse SSH tunnel on Linux. Let’s say you have a Linux machine behind NAT and a VPS.You want to SSH to the Linux machine behind NAT from your VPS but you don’t want to bother with port forwarding or your machine behind NAT doesn’t have a static […]

The post How to Setup Reverse SSH Tunnel on Linux appeared first on LinuxHostSupport.

]]>
We’ll explain to you, how to set up reverse SSH tunnel on Linux. Let’s say you have a Linux machine behind NAT and a VPS.You want to SSH to the Linux machine behind NAT from your VPS but you don’t want to bother with port forwarding or your machine behind NAT doesn’t have a static IP address. We have an easy solution, in today’s tutorial we are going to learn how to set up a reverse SSH tunnel on Linux.

1. Setting up a reverse SSH tunnel

We’ll start by setting up the reverse SSH tunnel on the machine that is behind NAT, do that by typing in the following command:

ssh -R 24553:localhost:22 user@111.111.111.111

Note: Make sure to substitute the SSH user and IP address in the command above to your own SSH user and IP address.

The port used for the reverse tunnel in the command above is 24553, feel free to use whatever port you like and make sure this port is open on the VPS you want to connect the reverse tunnel to.You can check iptables if the port is open by executing the following command:

iptables -L -vn

If the output has a DROP all line at the bottom like the following example:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80
 3214 3919K ACCEPT     all  --  *      *       10.20.30.1           0.0.0.0/0
    0     0 ACCEPT     all  --  *      *       10.20.31.2           0.0.0.0/0
 631K  855M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
 329K   17M DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0

Or an INPUT policy set to DROP like the following example:

Chain INPUT (policy DROP 329K packets, 17M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80
 3214 3919K ACCEPT     all  --  *      *       10.20.30.1           0.0.0.0/0
    0     0 ACCEPT     all  --  *      *       10.20.31.2           0.0.0.0/0
 631K  855M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

Then you will need to open the port in iptables by executing the command:

iptables -I INPUT 1 -p tcp --dport 24553 -j ACCEPT

Of course, make sure to replace the value in “–dport” for your preferred port number.

2. Connecting to the SSH tunnel

This is really easy and is done by executing the following command on the VPS:

ssh localhost -p 24553

You can also SSH from other machines to the NAT’ed machine, you can do that by first logging into your VPS:

ssh user@111.111.111.111

And then logging in to the machine from your VPS:

ssh localhost -p 24553

3. Creating a persistent SSH tunnel

The tunnel we created above won’t be persistent and will be dropped if the connection on the Linux machine behind NAT drops, if we want to make our reverse SSH tunnel persistent we need to install autossh.
For Ubuntu/Debian execute the following command to install autossh:

apt-get install autossh

For RHEL/CentOS execute the following command to install autossh:

yum install autossh

Now we need to create the reverse SSH tunnel on the machine behind NAT, execute the following command:

autossh -M 20110 -o ServerAliveInterval=20 -R 24553:localhost:22 user@111.111.111.111 & >/dev/null 2>&1

And then log in to the machine behind NAT by executing the following command on your VPS:

ssh localhost -p 24553

That’s it, now you have successfully set up a reverse SSH tunnel on Linux.

Of course, if you use one of our Linux support services, you can always contact and ask our expert Linux admins (via chat or ticket) to set up a reverse SSH tunnel on your Linux VPS for you. They are available 24×7 and will provide information or assistance immediately.

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

The post How to Setup Reverse SSH Tunnel on Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-setup-reverse-ssh-tunnel-on-linux/feed/ 0
How to Install Let’s Encrypt with Apache on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-with-apache-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-with-apache-on-ubuntu-16-04/#comments Wed, 13 Dec 2017 12:00:45 +0000 https://linuxhostsupport.com/blog/?p=295 In this tutorial we are going to show you, with step-by-step instructions on how to install Let’s Encrypt with Apache on Ubuntu 16.04. Let’s Encrypt is an open SSL Certificate Authority (CA) that offers free domain-validated (DV) certificates for your websites. SSL Certificates are used to establish a secure encrypted connection between a web server […]

The post How to Install Let’s Encrypt with Apache on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
In this tutorial we are going to show you, with step-by-step instructions on how to install Let’s Encrypt with Apache on Ubuntu 16.04. Let’s Encrypt is an open SSL Certificate Authority (CA) that offers free domain-validated (DV) certificates for your websites. SSL Certificates are used to establish a secure encrypted connection between a web server and a user’s web browser. The SSL certificates that have been issued by Let’s Encrypt are valid for 90 days and are trusted by most web browsers today.

1. Requirements

In order to start with the installation procedure, you need to have Apache or Nginx installed on your server. If there is no web server installed on your virtual server, please follow this tutorial to install Apache.
Also, you need a registered domain name with its A record pointing to your server’s IP address.  For the purposes of this tutorial, we will use ‘yourdomain.com’.

2. Install CertBot

Run the following commands:

sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache

3. Install Let’s Encrypt SSL

Install Let’s Encrypt SSL certificate on your domain (do not forget to replace ‘yourdomain.com’ with your actual domain):

sudo certbot --apache -d yourdomain.com
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): admin@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 at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: A

-------------------------------------------------------------------------------
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 EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: N

Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for linuxhostsupport.com
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/000-default-le-ssl.conf
Deploying Certificate for yourdomain.com to VirtualHost /etc/apache2/sites-available/000-default-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/000-default-le-ssl.conf

4. Redirect HTTP traffic to HTTPS

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
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
Redirecting vhost in /etc/apache2/sites-enabled/000-default.conf to ssl vhost in /etc/apache2/sites-available/000-default-le-ssl.conf

-------------------------------------------------------------------------------
Congratulations! You have successfully enabled https://yourdomain.com

5. Renew the SSL certificate with a cron job

Create a cron job so the SSL certificate is renewed automatically. Run:

crontab -e

and add the following line:

0 0 1 * * /usr/bin/letsencrypt renew >> /var/log/letsencrypt-renew.log

Save and close that file and restart cron service for the changes to take effect:

service cron restart

Open https://yourdomain.com in your favorite web browser, and check whether Let’s Encrypt SSL is installed properly:

Install-Lets-Encrypt-on-Ubuntu-16.04

That is it. Let’s Encrypt SSL certificate has been successfully installed on your website.

Of course you don’t have to Install Let’s Encrypt with Apache on Ubuntu 16.04, if you use one of our Linux Server Support services, in which case you can simply ask our expert Linux admins to  install Let’s Encrypt SSL certificate on Ubuntu 16.04 for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on How to Install Let’s Encrypt with Apache on Ubuntu 16, 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 Let’s Encrypt with Apache on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-with-apache-on-ubuntu-16-04/feed/ 10
10 Questions to Ask When Choosing a Hosting Service https://linuxhostsupport.com/blog/10-questions-to-ask-when-choosing-a-hosting-service/ https://linuxhostsupport.com/blog/10-questions-to-ask-when-choosing-a-hosting-service/#comments Fri, 11 Aug 2017 14:07:07 +0000 https://linuxhostsupport.com/blog/?p=170 When creating a blog or a website, it goes without saying that you will want to choose a high-quality web hosting service provider; you want a reliable host that will be able to not only give you enough features, but also offer quality support when needed. Here are some questions that will help you find […]

The post 10 Questions to Ask When Choosing a Hosting Service appeared first on LinuxHostSupport.

]]>
When creating a blog or a website, it goes without saying that you will want to choose a high-quality web hosting service provider; you want a reliable host that will be able to not only give you enough features, but also offer quality support when needed. Here are some questions that will help you find and determine, if a specific web hosting service is the right one for you. Let’s get started.


1. Do you have a security policy, and if so, what does it include?

Shared hosting is one of the most affordable options for web hosting, and if you are going for a shared host, you would want to know if there are security policies in place. You need to know whether your information and files will be properly protected; even with the more expensive dedicated or cloud hosting services, you want to work with a host that will conjoin with your efforts for security. Good web hosts perform virus and malware scans daily or every other day. If you choose a VPS, you are completely in charge of your virtual server, even though you are not the only client on the host server; you are fully isolated from other people’s virtual servers, just as how their virtual servers are fully isolated from yours. If you opt for dedicated hosting, all security is once again run by you, with the difference between this and virtual servers being that you are the only client on the entire server.

2. Do you offer TLS?

SSL, short for Secure Sockets Layer, is a protocol for the encryption of information sent over the Internet. It is a most popular choice for web encryption, making it the best choice for maintaining privacy of your information. If you are building an e-commerce site or anything that requires and processes sensitive information, you will want to work with a web host that can provide you with a good SSL certificate. Before signing up for the service, make sure the web host offers SSL, which will cover all your bases when it comes to security. In the case that your web host does not offer this, you can always get a third-party SSL provider for your website.

3. What kind of uptime can I expect from your servers?

Server uptime is essential to all users of a server, especially if you are running a website or service that caters to thousands or tens of thousands of clients every minute. Normally uptime percentages are referred to with ‘nines’ – three nines being 99.9% uptime, four being 99.99%, and so on. Anything above 99% should be plenty for almost all cases. Check the uptime guarantee of the web host before signing up, and ask if they also have a response time guarantee in the case of an emergency,

4. Do you perform backups?

Ideally, backing up data should be done as often as possible. If backups are made less often, you run a greater risk of losing critical data due to the most recent backup being older than the data that you lost. Avoid signing up with a web host that cannot perform backups of your files at least once a day.

5. What can you do when there is an outage?

A good web host will take responsibility for downtimes and outages, even when the circumstances are out of their control. You also need to know if they can help you recover your data in uncontrollable events such as power outages or weather disturbances. Some web hosts suspend their charges during emergencies to ensure that their customers are not being unfairly charged for service that is out-of-order.

6. Can I easily scale up when I need to?

In the event that you require more bandwidth, storage, RAM, or CPU power, a good web host should be able to easily accommodate your needs. However, some web hosts can trap their customers in some pretty inflexible contracts, so it’s good practice to check if the hosting company allows for upscaling in resources such as bandwidth and storage space.

7. Are your customer service and tech support teams helpful?

Good web hosts maintain equally good customer service and tech support teams that can respond quickly and diligently to your queries and difficulties.

8. Can you accommodate my needs, especially if they change over time?

A good web host should be able to easily accommodate you and your needs as they change over the course of your contract with them.

9. Do you monitor security?

Good web hosts have the ability to catch if a site is compromised as soon as it happens. Make sure that your web host has security measures in place, such as malware/virus scanners as well as firewalls.

10. What if I’m not satisfied with your service?

Web hosting companies that are confident in providing good service to their customers are not afraid to make guarantees or offer refunds in the event that there is a lapse in their service.

If you search for a web hosting provider by using the questions above, it’s more than likely that you will find a provider that will be able to provide you with excellent service and support, that also allows you to expand and upgrade your service with ease.

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

The post 10 Questions to Ask When Choosing a Hosting Service appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/10-questions-to-ask-when-choosing-a-hosting-service/feed/ 6