Shell: A Command-Line Interpretor that connects a user to Operating System and allows to execute the commands or by creating text script.

Process: Any task that a user run in the system is called a process. A process is little more complex than just a task.

File: It resides on hard disk (hdd) and contains data owned by a user.

X-windows aka windows: A mode of Linux where screen (monitor) can be split in small “parts” called windows, that allow a user to do several things at the same time and/or switch from one task to another easily and view graphics in a nice way.

Text terminal: A monitor that has only the capability of displaying text stuff, no graphics or a very basic graphics display.

Session: Time between logging on and logging out of the system.

Types of Shell on a Standard Linux Distribution

Bourne shell : The Bourne shell was one of the major shells used in early versions and became a de facto standard. It was written by Stephen Bourne at Bell Labs. Every Unix-like system has at least one shell compatible with the Bourne shell. The Bourne shell program name is “sh” and it is typically located in the file system hierarchy at /bin/sh.

C shell : The C shell was developed by Bill Joy for the Berkeley Software Distribution. Its syntax is modelled after the C programming language. It is used primarily for interactive terminal use, but less frequently for scripting and operating system control. C shell has many interactive commands.

Beginning the Fun! (Linux Shell)

There exist thousands of commands for command-line user, how about remembering all of them? Hmmm! Simply you can not. The real power of computer is to ease the ease your work, you need to automate the process and hence you need scripts.

Scripts are collections of commands, stored in a file. The shell can read this file and act on the commands as if they were typed at the keyboard. The shell also provides a variety of useful programming features to make scripts truly powerful.

Basics of Shell Programming

To get a Linux shell, you need to start a terminal.

To see what shell you have, run: echo $SHELL.

In Linux, the dollar sign ($) stands for a shell variable.

The ‘echo‘ command just returns whatever you type in.

The pipeline instruction (|) comes to rescue, when chaining several commands.

Linux commands have their own syntax, Linux won’t forgive you whatsoever is the mistakes. If you get a command wrong, you won’t flunk or damage anything, but it won’t work.

#!/bin/sh – It is called shebang. It is written at the top of a shell script and it passes the instruction to the program /bin/sh.

About shell Script

Shell script is just a simple text file with “.sh” extension, having executable permission.

Process of writing and executing a script

Open terminal.

Navigate to the place where you want to create script using ‘cd‘ command.

Cd (enter) [This will bring the prompt at Your home Directory].

touch hello.sh (Here we named the script as hello, remember the ‘.sh‘ extension is compulsory).

Sample Output

Was this cool? Writing script is as simple as getting an idea and writing pipelined commands. There are some restrictions, too. Shell scripts are excellent for concise filesystem operations and scripting the combination of existing functionality in filters and command line tools via pipes.

When your needs are greater – whether in functionality, robustness, performance, efficiency etc – then you can move to a more full-featured language.

If you already know C/Perl/Python programming language or any other programming language, learning the scripting language won’t be much difficult.

Writing your Third Script

Moving to, write our third and last script for this article. This script acts as an interactive script. Why don’t you, yourself execute this simple yet interactive script and tell us how you felt.

Sample Output

Hey what’s Your First Name?
Tikto
welcome Mr./Mrs. Tikto, would you like to tell us, Your Last Name
Kumar
Thanks Mr./Mrs. Tikto Ridar for telling us your name
******************************************************
Mr./Mrs. Tikto, it’s time to say you good bye

Well this is not an end. We tried to bring a taste of scripting to you. In our future article we will elaborate this scripting language topic, rather a never ending scripting language topic, to be more perfect. Your valuable thoughts in comments is highly appreciated, Like and share us and help us to spread. Till then just chill, keep connected, stay tuned.

]]>Understanding Linux Shell Shell: A Command-Line Interpretor that connects a user to Operating System and allows to execute the commands or by creating text script. Process: Any task that a user run in the system is called a process. A process is little more complex than just a task. File: It resides on hard disk [&#8230;]http://www.blog.cheapbesthost.com/tips-understand-linux-shell-and-basic-shell-scripting-language.html/feed0Install Config Server Firewall on a VPS Linuxhttp://www.blog.cheapbesthost.com/install-config-server-firewall-on-a-vps-linux.htmlServerAFRIDA YANTISun, 04 Jan 2015 01:25:50 PSThttp://www.blog.cheapbesthost.com/?p=781Security is one of the most important things you need to consider if you have an online business. The best security practices for keeping your server protected include an advanced firewall service. Today we will discuss and explain how to install Config Server Firewall (CSF), which is one of the most advanced firewall services for a Linux VPS. The installation process is, as a matter of fact, very simple and it is not time consuming at all, so if you are ready, we can begin.

For today’s tutorial, we are using a CentOS VPS , but do not worry if you are using another Linux distribution on your VPS since it should work without any problems.

The first thing you need to do is to update all your system software to the latest version available. For that purpose, you can carry out the command:

# yum update

Once you execute this command, your system will be up to date and you can commence the installation of Config Server Firewall. Navigate to your /root directory:

# cd /root

Now, when you are in your /root directory you can download the Config Server Firewall from the official web site. For that purpose you can use the following command:

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

Next thing you need to do is to unpack the archive:

# tar -zxvf csf.tgz

Enter into the newly created directory on your Linux VPS:

# cd csf/

And start the installation script:

# sh install.sh

After few seconds of time, the Config Server Firewall should be installed on your Linux VPS and it should be ready to use.
As many other services, Config Server Firewall can be started, stopped, or restarted using init scripts. For instance, to start your Config Server Firewall you can use the command:

# /etc/init.d/csf start

If you like to stop your Config Server Firewall, you can execute the command:

# /etc/init.d/csf stop

Or, in case you like to restart your Config Server Firewall service you can run the command:

# /etc/init.d/csf restart

Also, as many other Linux services, you can configure Config Server Firewall to meet your needs. The main configuration file is stored in your /etc directory under /csf.

# /etc/csf/csf.conf

Finally, we will show you how to use Config Server Firewall. If you like to allow a specific IP address to access your Linux VPS, you can use the command:

# csf -a IPADDRESS

Please do not forget to replace IPADDRESS with the actual IP address.
In case you like to block certain IP address, you can use the command:

# csf -d IPADDRESS

Again, do not forget to replace IPADDRESS with the actual IP address.
In the end, if you like to reload all the rules you can execute:

# csf -r

]]>Security is one of the most important things you need to consider if you have an online business. The best security practices for keeping your server protected include an advanced firewall service. Today we will discuss and explain how to install Config Server Firewall (CSF), which is one of the most advanced firewall services for [&#8230;]http://www.blog.cheapbesthost.com/install-config-server-firewall-on-a-vps-linux.html/feed0Security Tips for Your Serverhttp://www.blog.cheapbesthost.com/security-tips-for-your-server.htmlServerAFRIDA YANTISat, 03 Jan 2015 05:00:33 PSThttp://www.blog.cheapbesthost.com/?p=772One of the first things you should do when running a Virtual Private Server (VPS) is to secure your server as much as possible. This way you will protect your server against various security attacks which may harm or even destroy your data.

Here are a few easy tips on how to improve the stability and security of your Virtual Private Server:

Keep Your Software Up-To-Date

Keeping the software up-to-date is one of the most important tasks of securing your server. Everyday, numerous vulnerabilities are found in various Linux applications, services and scripts and new fixed versions of them are being released very quickly. Installing the updates on your server is crucial and strongly recommended. You can keep your server up-to-date using your distribution’s package manager such as ‘yum’ or ‘apt-get’.

RPM based distros:

# yum update

Debian based distros

# apt-get update && apt-get upgrade

Use Strong Passwords

Passwords are the front line defense for your server. When setting up new accounts on your virtual server, you should create strong passwords. The stronger the password is, the less likely it is to be guessed and your server compromised. Never use passwords that are easily guessable, such as passwords based upon names, street addresses, dictionary words, significant dates, etc… A strong password consists of a combination of letters (both upper and lower case), numbers and special characters and it should be at least 8 characters long.

To change your ‘root’ password use the following on the Linux command line:

# passwd

To change a user’s password use the following instead:

# passwd <username>

Use Correct File and Directory Permissions

Three types of access permissions: read, write and execute are available for three different categories of users: owner, group and others. With these permissions you can determine who can access or modify the files. This makes them very important for the security of your server. You should ensure that all files and directories have the correct permissions. You can check the permissions of a file by executing the ‘ls -l’ command. The very first line of the given output shows the files/directories permissions: ‘r’ = read permission; ‘w’ = write permission; ‘x’ = execute permission; ‘-‘ = no permission. You can change the permissions with the ‘chmod’ command.

The following commands can help you find any world writable files and directories which may be a security risk:

To find world writable files type:

# find / -type f -perm -o+w -exec ls -l {} \;

To find world writable directories type:

# find / -type d -perm -o+w -exec ls -ld {} \;

Stop/Disable Unnecessary Services

All Linux distributions usually have many services/daemons configured to start every time you start the server. The more services running on your server, the more ports are being open to potential external break-ins. Disabling unnecessary services can improve the security of your server and even the overall server performance.
To check which services are running on your server execute:

# chkconfig –list

The above command will show the startup status of all services.

To stop a service at startup time you can execute:

# chkconfig –levels <name_of_service> off

Disable ‘root’ login via SSH

The ‘root’ account has full control over the entire server, so allowing direct logins as ‘root’ via SSH is one of the biggest security risks. Hackers can brute force a server’s ‘root’ password and when they succeed, they will gain full control over your entire server. Despite this, even one small mistake made while logged in as ‘root’ can cause a big problem on your server. It’s strongly recommended to use your ‘root’ user only when it is really necessary.

Remove Inactive Accounts

User accounts that are not used for a long time are potentially security risks for your server. Since no one is using them, they can be compromised and used to harm your server or other servers on the network.
To delete user account from the Linux command line execute:

# userdel <username>

]]>One of the first things you should do when running a Virtual Private Server (VPS) is to secure your server as much as possible. This way you will protect your server against various security attacks which may harm or even destroy your data. Here are a few easy tips on how to improve the stability [&#8230;]http://www.blog.cheapbesthost.com/security-tips-for-your-server.html/feed0Install osCommerce on a CentOS Linuxhttp://www.blog.cheapbesthost.com/install-oscommerce-on-a-centos-linux.htmlWeb HostingAFRIDA YANTIThu, 01 Jan 2015 14:11:53 PSThttp://www.blog.cheapbesthost.com/?p=768In this tutorial we will show you how to install osCommerce on a CentOS VPS. Open Source Commerce (osCommerce) is a complete self-hosted online store solution that contains both a catalog frontend and an administration tool backend which can be easily installed and configured through a web-based installation procedure.

It can be used on any web server with PHP and MySQL installed and it allows you to setup and maintain e-stores very easily with almost no effort.

Before you start the installation, please make sure that you have LAMP stack installed on your server. If not, follow our excellent tutorial about installing LAMP (Linux Apache, MariaDB & PHP) on a CentOS VPS

REQUIREMENTS

We are using our 1 VPS hosting plan for this tutorial.

UPDATE THE SYSTEM

Login to your server as user ‘root’ and make sure your Linux VPS is fully up-to-date:

# ssh root@hostname
# yum update

INSTALL osCommerce

Let’s navigate to a directory where we will download osCommerce. For the purposes of this tutorial we will use the opt directory.

# cd /opt

Install wget and unzip:

# yum install wget unzip

The next thing to do is to download the latest stable version of osCommerce which is 2.3.4 during the writing of this article. Issue the following command:

With this step the installation procedure from the command line is done.
Now open your favorite web browser and navigate to http://your_IP_address/oscommerce/catalog/install/index.php and follow the on-screen instructions.

Please note that it is recommended to follow the post-installation steps after the completion of the installation procedure to secure your osCommerce Online Merchant online store. One of the steps is to delete the installation files. You can do that with the following commands:

After you complete the web-based installation and follow the post-installation steps you will have a fully functional e-commerce and online store management system installed on your virtual server.

]]>In this tutorial we will show you how to install osCommerce on a CentOS VPS. Open Source Commerce (osCommerce) is a complete self-hosted online store solution that contains both a catalog frontend and an administration tool backend which can be easily installed and configured through a web-based installation procedure. It can be used on any [&#8230;]http://www.blog.cheapbesthost.com/install-oscommerce-on-a-centos-linux.html/feed0Install Joomla on a CentOS Linuxhttp://www.blog.cheapbesthost.com/install-joomla-on-a-centos-linux.htmlWeb HostingAFRIDA YANTIThu, 01 Jan 2015 14:02:18 PSThttp://www.blog.cheapbesthost.com/?p=765Today we will show you how to install Joomla on a Centos VPS using Apache web-server and MySQL database.

Joomla is a free and open-source content management system (CMS) for publishing web content. It is built on a model–view–controller web application framework that can be used independently of the CMS.

Joomla is written in PHP, uses object-oriented programming (OOP) techniques and software design patterns, stores data in a MySQL, MS SQL or PostgreSQL database and includes features such as page caching, RSS feeds, printable versions of pages, news flashes, blogs, polls, search, and support for language internationalization.
It is an immensely popular and award-winning open source Content Management System (CMS) that has been downloaded over 50 million times.

Before you start the installation, please make sure that you have LAMP stack installed on your server. If not, follow our excellent tutorial about installing LAMP (Linux Apache, MariaDB & PHP) on a CentOS VPS

REQUIREMENTS

We are using our 1 VPS hosting plan for this tutorial.

UPDATE THE SYSTEM

First make sure your Linux VPS is fully up-to-date using the command below:

# yum update

Before we proceed you should customize your Firewall to allow external access to port 80 (http) and 443 (https). To do this please enter the following commands:

]]>Today we will show you how to install Joomla on a Centos VPS using Apache web-server and MySQL database. Joomla is a free and open-source content management system (CMS) for publishing web content. It is built on a model–view–controller web application framework that can be used independently of the CMS. Joomla is written in PHP, [&#8230;]http://www.blog.cheapbesthost.com/install-joomla-on-a-centos-linux.html/feed0How to install and integrate SpamAssassin with Exim on a CentOShttp://www.blog.cheapbesthost.com/how-to-install-and-integrate-spamassassin-with-exim-on-a-centos.htmlServerAFRIDA YANTIThu, 01 Jan 2015 13:54:47 PSThttp://www.blog.cheapbesthost.com/?p=762In the following tutorial we are going to cover the procedure of installing and integrating SpamAssassin with Exim on a CentOS 7 Linux VPS. Once the set-up is completed, SpamAssassin will be able to scan and mark the emails detected as SPAM.

What is SpamAssassin?

It is a software program released under the Apache License 2.0 used for e-mail spam filtering based on content-matching rules. It is a very intelligent email filter which uses a diverse range of tests to identify unsolicited bulk email and apply the tests to email headers and content to classify email using advanced statistical methods.

Before proceeding any further, make sure you have a mailserver with Exim setup on your SSD virtual server. You can follow our great article on how to setup a mailserver with Exim and Dovecot on a CentOS 7 VPS if you don’t have Exim setup already on your Linux VPS.

UPDATE THE SYSTEM

ssh to your server and initiate a screen session using the command below:

# screen -U -S exim-spamd

once you’re in a screen session, update your CentOS 7 VPS using yum as in:

# yum update

INSTALL SPAMASSASSIN

SpamAssassin is available in CentOS 7 base repository, so you can easily install it using yum:

# yum install spamassassin

Once it’s installed, edit /etc/mail/spamassassin/local.cf using your favorite editor and set the following:

TEST SPAMASSASSIN

To test the setup, simply send a test email with subject XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X to any email account available on the mailserver and you should see the following lines in the email header:

X-Spam-Flag: YES
X-Spam-Subject: [SPAM] XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
X-Spam-Score: 1000.0 (+++++++++++++++++++++++++++++++++++++++++++++++++++)
X-Spam-Report: Spam detection software, running on the system “mail.mydomain.com”, has
identified this incoming email as possible spam. The original message
has been attached to this so you can view it (if it isn’t spam) or label
similar future email. If you have any questions, see
@@CONTACT_ADDRESS@@ for details.

]]>In the following tutorial we are going to cover the procedure of installing and integrating SpamAssassin with Exim on a CentOS 7 Linux VPS. Once the set-up is completed, SpamAssassin will be able to scan and mark the emails detected as SPAM. What is SpamAssassin? It is a software program released under the Apache License [&#8230;]http://www.blog.cheapbesthost.com/how-to-install-and-integrate-spamassassin-with-exim-on-a-centos.html/feed0How to install PrestaShop on an Ubuntuhttp://www.blog.cheapbesthost.com/how-to-install-prestashop-on-an-ubuntu.htmlWeb HostingAFRIDA YANTIThu, 01 Jan 2015 13:40:58 PSThttp://www.blog.cheapbesthost.com/?p=758PrestaShop is an open source e-commerce solution, based on PHP and MySQL that allows you to easily create an online store.

To install PrestaShop on an Ubuntu VPS follow the very easy steps described below.

At the time of writing this tutorial, the latest stable version of PrestaShop is v1.6.0.9 and it requires:

Also, the webserver user (www-data) needs to be able to write to files and directories inside the ‘/var/www/prestashop’ directory, so it can easily be accomplished by executing the following command:

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

Open http://your-domain.com/ in your popular web browser and follow the easy instructions.

For security reasons, it is recommended to delete the install directory (‘/var/www/prestashop/install’) once you are done with the installation process. That is it. The PrestaShop installation is now complete.

]]>PrestaShop is an open source e-commerce solution, based on PHP and MySQL that allows you to easily create an online store. To install PrestaShop on an Ubuntu VPS follow the very easy steps described below. At the time of writing this tutorial, the latest stable version of PrestaShop is v1.6.0.9 and it requires: PHP &#62;= [&#8230;]http://www.blog.cheapbesthost.com/how-to-install-prestashop-on-an-ubuntu.html/feed0Basic MySQL database administration on a Linuxhttp://www.blog.cheapbesthost.com/basic-mysql-database-administration-on-a-linux.htmlServerAFRIDA YANTIThu, 01 Jan 2015 13:34:30 PSThttp://www.blog.cheapbesthost.com/?p=755MySQL is one of the most popular relational database management systems (RDBMS). It is open-source and it is used by many individuals and organizations. If you are using our Linux VPS hosting services, you are most likely using MySQL as a database system. Therefore, it is important for you to know how to operate with your database system when you need to make some changes in your databases. Today, we will have a very simple task – to teach you how to work with your MySQL database system using these simple commands from your Linux VPS.

The first thing you need to do is to check your MySQL version using the command:

# mysql -h localhost -V

If by any chance you do not have MySQL database server installed on your VPS, you can install it using the commands:

# yum install mysql-server

if you have a CentOS VPS, or:

# apt-get install mysql-server

if you have an Ubuntu VPS or Debian VPS.

Before going even further, you may want to create a backup of your existing databases so you can proceed with this tutorial safely. Please check our blog post on How to backup and restore your MySQL database

Now, let’s start with the actual tutorial.

To log in to your MySQL database server you can run the command:

# mysql -u username -p

For instance, if you like to log in as ‘root’, you can run the command:

# mysql -u root -p

You will be prompted for your database ‘root’ password. Please note, your database ‘root’ password may not be the same as your SSH ‘root’ password.

Once you successfully log in to your MySQL database server, you can list all the databases using the command:

mysql> SHOW DATABASES;

If you like to create a database, you can use the command:

mysql> CREATE DATABASE db_name;

Replace the ‘db_name’ with the name of the database you like to create.

Additionally, if you like to delete some of the databases, you can simply enter the command:

mysql> DROP DATABASE db_name;

Again, replace the ‘db_name’ with the name of the database you like to delete.

Next, if you like to use some of the databases, type:

mysql> USE db_name;

Once you select the database you like to use, you can list all the tables using the command;

You will get an ‘Empty set’ message. This is because the ‘test_table’ is new and does not hold any data.

In the next tutorial, we will show you how to insert and manipulate data into your tables.

]]>MySQL is one of the most popular relational database management systems (RDBMS). It is open-source and it is used by many individuals and organizations. If you are using our Linux VPS hosting services, you are most likely using MySQL as a database system. Therefore, it is important for you to know how to operate with [&#8230;]http://www.blog.cheapbesthost.com/basic-mysql-database-administration-on-a-linux.html/feed0Install and configure Linux Malware Detect on a CentOShttp://www.blog.cheapbesthost.com/install-and-configure-linux-malware-detect-on-a-centos.htmlServerAFRIDA YANTIThu, 01 Jan 2015 13:29:52 PSThttp://www.blog.cheapbesthost.com/?p=752Linux Malware Detect or just Maldet is free and open source malware scanner for Linux machines. It scans the machine for known malwares and quarantine suspicious files or simply alert you for their presence. It uses threat data from network edge intrusion detection systems to extract malware that is actively being used in attacks and generates signatures for detection. In addition, threat data is also derived from user submissions with the LMD checkout feature and from malware community resources.

In this tutorial we will show you how to install Linux Malware detect on your CentOS VPS.

Log in to your server as user root and update the packages:

# yum update -y

Now, go to Linux Malware Detect’s official website and download it to your server

]]>Linux Malware Detect or just Maldet is free and open source malware scanner for Linux machines. It scans the machine for known malwares and quarantine suspicious files or simply alert you for their presence. It uses threat data from network edge intrusion detection systems to extract malware that is actively being used in attacks and [&#8230;]http://www.blog.cheapbesthost.com/install-and-configure-linux-malware-detect-on-a-centos.html/feed0Install WordPress on a CentOS VPShttp://www.blog.cheapbesthost.com/install-wordpress-on-a-centos-vps.htmlWeb HostingAFRIDA YANTIThu, 01 Jan 2015 13:24:32 PSThttp://www.blog.cheapbesthost.com/?p=749Today we will show you how to install WordPress on a Centos VPS using Apache web-server and MySQL database.

WordPress is a web software you can use to create a beautiful website or blog. An open source CMS, WordPress is often used as a blog publishing application powered by PHP and MySQL. Currently it is the most popular of the blogging platforms available.

Before you start the installation, please make sure that you have LAMP stack installed on your server. If not, follow our excellent tutorial about installing LAMP (Linux Apache, MariaDB & PHP) on a CentOS VPS.

REQUIREMENTS

We are using our 1 VPS hosting plan for this tutorial.

UPDATE THE SYSTEM

First make sure your CentOS VPS is fully up-to-date using the command below:

# yum update

INSTALL WORDPRESS

Enter a directory by your choice and download WordPress. For our purpoces we are using the /opt directory.

Allow the Apache web server to write to the uploads directory. Do this by assigning group ownership of this directory to your web server which will allow Apache to create files and directories. Issue the following command:

# chown -R :apache /var/www/html/wordpress/wp-content/uploads

Enter the WordPress directory:

# cd /var/www/html/wordpress/

Rename wp-config-sample.php into wp-config.php:

# mv wp-config-sample.php wp-config.php

Open the WordPress configuration file with your favorite text editor and change the database values with the ones you gave at the time of the database creation.

# vim wp-config.php

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress’);

]]>Today we will show you how to install WordPress on a Centos VPS using Apache web-server and MySQL database. WordPress is a web software you can use to create a beautiful website or blog. An open source CMS, WordPress is often used as a blog publishing application powered by PHP and MySQL. Currently it is [&#8230;]http://www.blog.cheapbesthost.com/install-wordpress-on-a-centos-vps.html/feed0nonadult