Linux and Unix TAR Command

Linux and Unix TAR Command

For those of you who didn’t know, The tar command used to rip a collection of files and directories into highly compressed archive file commonly called tarball or tar, gzip and bzip in Linux. The tar is most widely used command to create compressed archive files and that can be moved easily from one disk to anther disk or machine to machine. The main purpose of this article is to provide various tar command examples that might be helpful you to understand and become expert in tar archive manipulation.

Linux and Unix TAR Command

Create tar Archive File

Example command create a tar archive file idroot.tar for a directory /home/idroot in current working directory.

Create tar.gz Archive File

Example command create a compressed gzip archive file idroot.tar for a directory /home/idroot in current working directory.

Untar a tar File or gzip-bz2 tar File

Tar Command Options
Save

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!

How To Install Rar/Unrar on CentOS

Install Rar/Unrar on CentOS

In this tutorial we will show you how to install and configuration of rar/unrar on your CentOS server. For those of you who didn’t know, RAR is most popular tool for creating and extracting compressed archive (.rar) files, but unfortunately rar tool doesn’t pre-installed under Linux systems, we need to install it using third-party tools to open, extract, uncompress or unrar a archive files.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation unrar and rar command-line tools using RPMforge repository CentOS with yum.

Install Rar/Unrar on CentOS

Step 1. To install, first you must add the rar/unrar yum repository information corresponding to your CentOS/RHEL version to yum:

  • CentOS 7 64 Bit
  • CentOS 6 64 Bit
  • CentOS 6 32 Bit
  • CentOS 5 64 Bit
  • CentOS 5 32 Bit
Step 2. Install rar/unrar

Type the following command to install Rar/Unrar

install-rar-unrar-centos

Commands for Rar/Unrar archive

Following are the some useful and helpful rar/unrar archive commands

Congratulation’s! You have successfully installed rar/unrar. Thanks for using this tutorial for installing rar/unrar in CentOS system. For additional help or useful information, we recommend you to check the official rar web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!

Save

How To Install FFmpeg and FFmpeg-PHP Extension on CentOS

Install FFmpeg and FFmpeg-PHP Extension on CentOS

For those of you who didn’t know, FFmpeg is a cross-platform solution for streaming audio and video as well as recording and conversion. There’s also a great PHP package called ffmpeg-php that allows for easy use of FFmpeg from inside PHP scripts. In this tutorial i will show you the easy way to install ffmpeg and ffmpeg-php (php extension).

Install FFmpeg on CentOS

Step 1. To install, first you must add the DAG yum repository information corresponding to your CentOS/RHEL version to yum:

Add the following text to the file and save:
Step 2. After add Dag repository, Use yum to install ffmpeg using following command.

 FFmpeg-install

FFmpeg Basic Commands

 Install FFmpeg-PHP Extension on CentOS

Step 1.

Step 2. Download the latest ffmpeg-php release

If you get  [ffmpeg_movie.lo] Error 1 when compiling ffmpeg-php, then you will need to do:

Install FFmpeg on CentOS and FFmpeg-PHP Extension 

Step 3. Copy the ffmpeg.so module in php default module location. Now you have to edit php.ini file to enable ffmpeg-php support in it by using ffmpeg.so module.

Put the below two lines at the end of the php.ini file

FFmpeg-PHP extension should now be installed. You can check by creating a file called info.php in /var/www/html/ with the following content:

FFmpeg Install Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “FFmpeg” installation, starting from $10 (Paypal payment). Please contact us to get a best deal!

Save

How To Install and Configure Squid 3 on CentOS

Install and Configure Squid 3 on CentOS

In this tutorial we will show you how to install and configuration of Squid on your CentOS server. For those of you who didn’t know, Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. Squid proxy is used by various organisation and internet providers to reduce bandwidth and to increase response time.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Squid in CentOS linux server.

Install and Configure Squid 3 on CentOS

Step 1. To install, first you must update yum repository and packages by typing the below command:

Step 2. Installing Squid 3.

Install squid package and dependencies using the below command :

 squid-cache-install

Step 3. Configuration Squid.

Edit squid configuration file ‘/etc/squid/squid.conf’

Step 4. Create our authentication file which Squid can use to verify for user authentications:

Example:

Congratulation’s! You have successfully installed squid. Thanks for using this tutorial for installing squid proxy on CentOS system. For additional help or useful information, we recommend you to check the official squid web site.

Squid Install Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “Squid Proxy” installation, starting from $10 (Paypal payment). Please contact us to get a best deal!

How To Increase PHP Memory Limit

php-logo

If you have seen an error like ”Fatal Error: PHP Allowed Memory Size Exhausted” in webserver logs or your browser, this means that PHP has exhausted the maximum memory limit. This tutorial will show two different ways on how you can increase the php memory limit.

Check PHP Memory Limit

You can check by creating a file called info.php in /var/www/html/ with the following content:

 php-memory-limit

Increase PHP Memory Limit

Method 1. Changing memory limit from php.ini

First find locate the php.ini file used by your web server.

Search “memory_limit” in your php.ini, and change it. If no “memory_limit” found, add the following line at the end of php.ini

Restart webserver
Method 2. Changing memory limit using .htaccess

Find the “.htaccess” in your root directory of the specified domain, edit the .htaccess file in the web root directory. Look for the section:

 

Congratulation’s! You have successfully increase PHP memory limit. Thanks for using this tutorial for increase PHP memory limit linux system. For additional help or useful information, we recommend you to check the official PHP web site.

PHP Install Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “PHP and Webserver” installation, starting from $25 (Paypal payment). Please contact us to get a best deal!

How To Install Varnish Cache on CentOS

Install Varnish Cache on CentOS

For those of you who didn’t know, Varnish Cache is a powerful open source HTTP accelerator that can be installed infront of any Webserver. Varnish Cache can improve overall performance of your web server by caching contents. The Varnish cache stores the copy of user request’s and serves the same page when the user revisits the webpage. It makes your website really fast and accelerate your web site performance up-to 300 – 1000x (means 80% or more).

Why use Varnish?

  1. To reduce server load, especially CPU works.
  2. To make a website load faster, because cached and stored in RAM.
  3. To gain more visitors to your website.

Install Varnish Cache on CentOS

Step 1. To install, first you must add the varnish yum repository information corresponding to your CentOS/RHEL version to yum:

For CentOS 5.x use:

For CentOS 6.x use:

Step 2. Type the following command to install Varnish.

 Step 3. To start Varnish for the first time, type the following command.

 To start Varnish at system start-up, type the following command to make it start at system boots.

Configure Varnish Cache 3.0

Con­fig­ure Var­nish con­fig file (/etc/varnish/default.vcl.)

Commands for Monitoring Varnish Cache

Following are the some useful and helpful Varnish Cache commands for monitoring.

 

Varnish Cache Install Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “Varnish Cache” installation, starting from $10 (Paypal payment). Please contact us to get a best deal!

Save

How To Reset Root Password MySQL Server

Reset Root Password MySQL Server

By default, MySQL server will be installed with root account and password is blank. Have you ever forgotten the root password on one of your MySQL servers? If you have set the password for root and forget it, then you will need to reset the root password for MySQL. To reset your mysql password just follow these instructions and we assume that you already have a small amount of knowledge on MySQL.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The reset password MySQL is quite simple. I will show you through the step by step reset root password MySQL server.

Reset Root Password MySQL Server

Step 1. First thing to do is stop MySQL.

 Step 2. Next we need to start MySQL in safe mode with the –skip-grant-tables option so that it will not prompt for password.

 Step 3. Start the mysql client process using this command with root account and blank password.

 Step 4. Change password for root account.

 Step 5. Restart MySQL.

Once complete, you can restart MySQL is installed by running the below command:

Congratulation’s! You have successfully reset password MySQL. Thanks for using this tutorial for reset root password MySQL on Linux system. For additional help or useful information, we recommend you to check the official MySQL web site.

MySQL Fix Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “MySQL Fix”, starting from $10 (Paypal payment). Please contact us to get a best deal!

Save

How To Enable Slow Query Log for MySQL

MySQL-Database

MySQL has built-in functionality that allows you to log SQL queries to a file, You can enable the full SQL queries logs to a file or only slow running queries log. It is easy for us to troubleshoot/ debug the sql statement if SQL queries log enable, The slow query log is used to find queries that take a long time to execute and are therefore candidates for optimization. We assume that you already have MySQL installed on Linux system with administrative privileges and we assume that you already have a small amount of knowledge on MySQL.

In order to enable slow query logs for MySQL on your system you would need to do the following.

Enable Slow Query Log for MySQL

Step 1. Edit the /etc/my.cnf file with your favorite text editor.

 Step 2. Once you have your my.cnf file open, add the following line under the “[mysqld]” section.

 Step 3. Then create the file slow-queries.log. You can have the file in any spot you wish, as long as you define the path in your my.cnf.

Step 4. After that, restart mysql service. Enter the following command:

Congratulation’s! You have successfully enable slow query log on MySQL. Thanks for using this tutorial for enable slow query log on MySQL in Linux system. For additional help or useful information, we recommend you to check the official MySQL web site.

MySQL Configuration Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “MySQL Configuration”, starting from $10 (Paypal payment). Please contact us to get a best deal!

How To Backup and Restore MySQL Database Using Command Line

How To Backup and Restore MySQL Database Using Command Line

This tutorial guide will show you two easy ways to backup and restore the data in your MySQL database using mysqldump. You can also use this process to move your data to a new web server. We assume that you already have MySQL installed on Linux system with administrative privileges and we assume that you already have a small amount of knowledge on MySQL.

The parameters of the said command as follows.

  • [uname] Your database username.
  • [passwd] The password for your database (note there is no space between -p and the password).
  • [dbname] The name of your database.
  • [backupdb.sql] The filename for your database backup.

Backup and Restore MySQL Database Using Command Line

Backup MySQL database

First, you can check MySQL databases from your server:

The following command will dump all databases to an sql file. Replace pass with your root database password and filename with the name of the file you wish to create such as backupdb.sql

Back up multiple databases in MySQL

Example:

Backup all databases in MySQL

Example:

Back up your MySQL Database with Compress

Example:

Restore MySQL database from a backup file

Above we backup the Tutorials database into backupdb.sql file. To re-create the Tutorials database you should follow two steps:

  • Create an appropriately named database on the target machine
  • Load the file using the mysql command:
Example:

MySQL DB Backup and Restore Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “MySQL DB Backup and Restore”, starting from $10 (Paypal payment). Please contact us to get a best deal!

Save

How To Completely Removing MySQL Server in CentOS

MySQL-Database

In this tutorial we will show you how to completely removing of MySQL on your CentOS server. For those of you who didn’t know, MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. The MySQL source code is freely available because it was originally developed as freeware. MySQL is written in C and C++ and is compatible with all major operating systems. MySQL can be used for a variety of applications, but is most commonly found on Web servers.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The uninstall or removing is quite simple. I will show you through the step by step removing MySQL on CentOS server. May be it’s good idea to backup databases before doing this.

Completely Removing MySQL Server in CentOS

Step 1: Check list the mysql rpm which is installed on server

mysql-list-repo

Step 2 : Removing all mysql-related packages (with “yum remove”)

 remove-mysql-list

Step 3: Delete the databases folder

 If you don’t know how to reinstall mysql database server, check out our tutorial here.

Congratulation’s! You have successfully removes MySQL. Thanks for using this tutorial for removing MySQL server on CentOS system. For additional help or useful information, we recommend you to check the official MySQL web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!