what is Archives - CloudMinister

File compression in Linux

Here you will learn about the file compression and the full overview of types of file compression

File compression used to contain two or more file & directory in smaller size rather than original. Compression means reduce size of file.

In linux have many types of file compression
1. gzip

2. bzip2
3. xz
4. zip

 

# du -sh filename/or/path (This command use to check the size of file)

# yes “string” > file_name (This command use to copy string into file)

Alert :- immediately press (ctrl + c) after use yes command.If you not press (ctrl +c) immediately file size increase every second.

example :- 

  1. gzip :-

gzip is used to compress file but gzip not reduce more  size as compared to others. gzip extension is .gz.   

# gzip file_name (This command used for compress the file in .gz extension)


Uncompress gzip command

# gunzip  file_name.gz (This command used to unzip .gz file)

Example:- 


Create compress and tar file simultaneously 

#tar cvzf destination\path/file_name.tar.gz /source/path/ (This command used to compress in gz format and convert in tar file)

Example:- 


Uncompress and untar  file simultaneously

# tar xvzf file_name.tar.gz (This command used for uncompressing and untar file those extensions have .tar.gz or .tgz)

Example:- 

  1. bzip2

bzip2 is used to compress file bzip2 to reduce the size as compared to gzip. Bzip2 takes time to compress. Bzip2 extension is .bz2

# bzip2 file_name (This command used to compress the file with extension .bz2)

Uncompress bzip2 command

# bunzip2  file_name.bz2 (This command used to unzip .bz2      file)

Example:- 


Create compress and tar file simultaneously using bzip2 

#tar -cvjf destination\path/file_name.tar.bz2 /source/path/ (This command used to compress in bzip2 format and convert in tar file)

Example:- 

Uncompress and untar  file simultaneously using bzip2

# tar -xvf file_name.tar.gz (This command use for uncompress and untar file those extensions have .tar.bz2 or .tbz or .tb2)

Example:- 

  1. Xz

xz is used to compress file xz reduce more size as compared to other compression method.xz  extension is .xz.

# xz file_name (This command used to compress file with extension .xz)

Example:- 

Uncompress xz command

# unxz  file_name.bz2 (This command used to unzip .xz  file)

Example:- 


  1. Zip

Zip is used to compress the file or folder so that reduce the size of that package.
zip is available in linux,windows and unix. Many other software available that work same as zip. example:- WinRAR, 7zip etc.

 

Note: before use zip command first install zip package.

In centos installation :- # yum install zip -y

In ubuntu installation :- # apt-get install zip -y

Zip current all directory and file

# zip file_name.zip * (This command use to zip all current working directory and file) 

Recursively zip all directory file

# zip -r file_name.zip directory\path (This command use to recursively zip all file in a directory)

Exclude some file in zip 

# zip -r file_name.zip directory\path –exclude “*.extension”

(This command use to zip all file in directory but exclude some files using exclude option)

Extract zip file 

# unzip file_name.zip (This command use to extract zip file)

Extract zip file into directory 

# unzip file_name.zip -d directory\path (This command use to extract zip file into a directory)

Choosing the correct hosting control panel for your Hosting VPS or dedicated server

There are lots of open source as well as paid control panel through you can manage vps and dedicated servers, Control are being used by server admin to setup and manage the server and all services required for hosting like mail server , LAMP stack i.e apache, mysql, php and its modules effectively and By deciding correct control panel admin and user can save lots of its time and money too.

There are some advantages and disadvantages of control panels I am going to explain here .

1. GUI interface for admin and user end
2. resource consumption
3. Automation
4. Paid or open source
5. Advantages over multiple site hosting (shared Hosting)
6. Tomcat Hosting

1. WHM and cpanel

Advantages:

  • GUI of whm is best for admin and user end.
  • Automation is good in terms of auto backup, php modules installation configuration ,security ,multiple php modules.
  • Best for multiple site hosting (shared server for hosting companies).
  • All mysql versions can be installed by whm graphically in no time.
  • Best for Reseller Hosting.

Dis Advantages:

  • License for vps is 14.95 USD per month and for dedicated is 34.95 USD per month.
  • Resource hungry required minimum 2 GB RAM for installation and generally high load issue arise when resources are less.
  • Manual installation of nginx as a reverse proxy and varnish ,litespeed caused many issues over apache.
  • Apache is only supported be default as a web server.
  • Only support linux server.
  • Tomcat automation is not good on whm like setup and war file deployment is not quite easy.

2. Centos Web Panel

Advantages:

  • GUI of whm is good for admin and user end.
  • Automation is good in terms of auto backup, php modules installation configuration ,security ,multiple php modules.
  • Best for standalone servers or few personal websites server.
  • All php versions can be installed by cwp graphically in less time.
  • multiple web server support with front end cache server like nginx as a reverse proxy and varnish with apache.
  • Its a opensource control panel .
  • Consume less resources.

Dis advantages:

  • Not good for shared server where thousands of websites are hosted.
  • Mysql automation for upgrade option is missing.
  • Only support linux servers.
  • Tomcat automation is not good on centos web panel like setup and war file deployment is not quite easy.
  • Not good for Reseller Hosting.

3. Plesk control panel

Advantages:

  • GUI of whm is good for admin and user end.
  • Automation is good in terms of auto backup, php modules installation configuration ,security ,multiple php modules.
  • Good for Shared hosting servers .
  • All php versions and mysql versions can be installed graphically in less time.
    nginx and apache both supported .
  • support linux and windows OS .
  • Tomcat automation is good on plesk like setup and war file deployment is quite easy.
  • Good for reseller Hosting.

Disadvantages:

  • License cost for vps and dedicated on monthly basis.
  • Resource hungry required minimum 2 GB RAM for installation and generally high load issue arise when resources are less.
  • Manual installation of nginx as a reverse proxy and varnish ,litespeed caused many issues over apache.
  • Some times typical issues arise troubleshooting for admin is hard.
  • Do not support DKIM authentication on mail server yet.

4. Virtualmin

Advantages:

  • GUI of virtualmin is not so good for admin and user end.
  • Automation is less.
  • Can be used for standalone server.
  • nginx and apache web server both supported but manual install is required .
  • Its a opensource control panel .
  • Pro license has some cost for support .
  • Used less resources of server for automation.

Disadvantages:

  • Not good for shared server where thousands of websites are hosted.
  • Mysql automation for upgrade option is missing .
  • Manual installation of nginx as a reverse proxy and varnish ,litespeed caused many issues over apache.
  • Some times typical issues arise troubleshooting for admin is hard.
  • Only support linux servers.
  • Tomcat automation is not good on virtualmin like setup and war file deployment is not quite easy.
  • Not good for Reseller Hosting.

What is Access Control List and its types ?

It is a special kind of permission we are giving to the file system.

Think of the scenario when a user is not a member of a group created by you but still you want to give some read or write access, how can you do it without making the user a member of group, here ACL enters in the picture.

  •  setfacl are used for setting up ACL
  •  getfacl are used for showing ACL

–> There are two type of ACL :-

  1. Default ACL

  2. Access ACL

→ The default acl is used to set access control list on a specific directory

→ The access ACL is used to set permissions on any file or directory.

 Default ACL

  • setfacl -m “d:o:perms” file_of_ name

acl_1

Access ACL

To add permissions for a group

  • setfacl -m “g:group:permissions” /path_of_file

acl_2

To add permission for user

  • setfacl -m “u:user:permissions” /path_of_file

acl4

To remove a specific entry

  • setfacl -x “g:group” /path_of_file

acl_3

To copy the ACL rule from one file to other

  • getfacl file> file
  • setfacl -M file_to_file

acl_5

To remove all entries

  • setfacl -b path_of_file

acl_6Conclusion: By completing this tutorial we had learned the technical integrity of ACL and its types.

Webmin

Webmin is the popular web-based systems management UI for Linux, Unix, MacOS systems, Webmin makes management and delegation of most common system administration tasks available in a friendly web-based UI. Webmin manages users and groups, databases, BIND, Apache, Postfix, Sendmail, QMail, backups, firewalls, monitoring, and alerts, etc.

 

Virtualmin

Virtualmin is a web hosting control panel, designed to make it easy to manage websites, mailbox users, databases, and web applications. Installing Virtualmin provides a full-featured web hosting stack with web, email, databases, spam and antivirus filtering, analytics, etc.

 

Prerequisite
Automated installation requires a freshly installed OS.

Minimum 1GB RAM and more is better.

Minimum 1GB Free Disk Space.

Should have Root access or can use Sudo.

 

Configure Hostname
1) Confirm that your VPS server has a fully qualified domain name set as the hostname.

Configure hostname with the help of this command:

    # hostnamectl set-hostname FQDN


2) Let’s start with the installation. First of all, log in to your Linux server as user root.

Before proceeding any further, start a screen session using this command:

# screen -R

Note: If this command does not work then Install screen using this command:

     On RPM based systems use this command

# yum install screen

     On Debian based systems use the following command

# apt-get install screen


3) Now, we need to update the system. It is very important for all packages to be up to date because many packages in Virtualmin depend on the OS packages.

On RPM based systems you can upgrade the packages using the command:

# yum -y update

On Debian based systems use the following command:

# apt-get update


4) Go to Virtualmin’s official website and download the install script.

# wget http://software.virtualmin.com/gpl/scripts/install.sh

Note: If this command not works then Install wget using this commands:

On RPM based systems you can upgrade the packages using the command:

# yum -y install wget

On Debian based systems use the following command:

# apt-get install wget


5) Make the script executable 

# chmod +x install.sh


6) And run the installer

# ./install.sh

 

The install.sh has a number of options that can be used to perform a particular type of installation. The usage (–help) output describes the available options:

–uninstall|-u – Removes all Virtualmin packages (do not use on a production system)

–help|-h – This message

–force|-f – Skip confirmation message

–hostname|-h – Set fully qualified hostname

–verbose|-v – Verbose

–setup|-s – Setup software repositories and exit (no installation or configuration)

–minimal|-m – Install a smaller subset of packages for low-memory/low-resource systems

–bundle|-b <name> – Choose bundle to install (LAMP or LEMP, defaults to LAMP)

 

LAMP vs. LEMP

The Virtualmin install script can setup Apache or Nginx. The default, and best-tested and most feature-complete, is Apache. But, if you prefer Nginx, you can install a bundle with the LEMP stack instead of the LAMP stack. Use the –bundle LEMP option for Nginx.

 

Once the installation is completed navigate your web browser to https://youriPaddress:1000  to open the control panel. Log in using the root user to finish the post-installation setup wizard.

Settings root password

To access Virtualmin from the browser, we need to set root password for that you can use the following command:

If you are log in with root user simply type, 

# passwd

It will ask for the new password.

If you are log in with other user use sudo,

$ sudo passwd root

It will ask for the new password.

 

CONCLUSION

In this post, you will able to learn how to install Virtualmin and what is the difference between Webmin and Virtualmin.

What is the CPU Core?

The CPU core means the CPU processor.

In classical times the one core focuses on one task at a time.

(i.e. 1 core means → one task at a time)

Multiple cores mean multiple tasks at a time which results in more efficiency

Intel 8th generation processor has 4 cores

    4 core means = 1 core x 2  | 1 core x 2 | 1 core x 2  | 1 core x 2                                  **only if hyper-threading exits

                                  ↓                   ↓               ↓                           ↓

                                  2                  2               2                           2

                                                                        = 8 logical processor

1 CPU core + hyper-threading → appears as two logical CPU to an operating system.

 But actually the fact is the CPU is still a single CPU. While the OS sees each two CPU for each core. The CPU pretends it has more cores then it does and it uses its own logic to speed up program execution.

What is Hyper-Threading?

Hyper-Threading is Intel’s term for simultaneous multi-threading (SMT).

This is the process where CPU splits its physical core into the virtual core, which are known as threads, for example, each Intel’s CPU with hyper-threading splits both cores into four threads.

Hyper-Threading allows each core to split to do two things simultaneously this results in improvising CPU  performance, thereby allowing you to run multiple demanding apps at the same time or use heavily-threaded apps without the PC lagging.

Hyper-threading is just a ‘bonus’. processor with multi-threading that pretends multiple cases, modern Intel CPU has both multiple cores and hyper-threading.

Your dual-core CPU + hyper-threading appears as 4 cores to your OS

Your quad-core CPU + hyper-threading appears as 8 cores to your OS

So dual-core CPU with hyper-threading performs better with dual-core CPU without hyper-threading.

What is the Processor ?

The processor socket (also called a CPU socket) is the connector on the motherboard that houses a CPU and forms the electrical interface and contact with the CPU. Processor sockets use a pin grid array (PGA) where pins on the underside of the processor connect to holes in the processor socket.

Before hyper-threading and multi-core CPU came around, people attempted to add additional processing power to computers by adding additional CPU. This requires a motherboard with multiple CPU sockets. The motherboard also needs additional hardware to connect those CPU sockets to the RAM and other resources. There’s a lot of overhead in this kind of setup. There’s additional latency if the CPU need to communicate with each other, systems with multiple CPU consume more power, and the motherboard needs more sockets and hardware.

Here in the task manager, you can see sockets, cores, logical processor fairly well.

You can see in the system there is only one socket where the cores are placed and with hyper-threading, each core splits into two logical processors to show to the operating system. So the total cores are 4 and split into 8 logical processors.

Concept of core, sockets, hyper-threading, processor, vCPUs

Concept of core, sockets, hyper-threading, processor, vCPUs

What is vCPUs?

Here we will talk about the concept of virtual machines in the physical machine

Concept of core, sockets, hyper-threading, processor, vCPUs4 cores in the physical machine

Concept of core, sockets, hyper-threading, processor, vCPUs←← single CPU

A chip has 4 cores/ 4 CPU

To execute the virtualization in the cloud environment we are making virtual machines.

So each core in the single physical machine can execute (5-6 vCPUs) depending on the hypervisor you are using.

Suppose we have to make 160 vCPUs in the quad-core system which has 320GB RAM

 Suppose a core can handle 10 vCPU in each core →  4 cores X 10vCPUs = 40 vCPUs

                                                        Or

We have to configure 160 vCPUs in 4 cores on a single physical system

vCPUs per core = 160/4 = 40 vCPUs per core

Each core will handle 320 / 160 = 2 GB RAMs on each vCPUs

Concept of core, sockets, hyper-threading, processor, vCPUs

40 vCPUs on each core

Conclusion: After understanding these topics we will now understand the basic terminologies on the above topic.

Get started with CloudMinister Today