Linux Archives - Page 2 of 3 - CloudMinister

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.

What do mean by Inodes (index node) ? 

It is a record stored in the inode table, containing the information about the files and directories.
An inode is denoted by the phrase “file serial number”. It is just like the actual address of the file. It is a unique identifier.
There are 3 distinct areas in Linux on which our hard drives depend.

 

a) Super block b) Inode table c) Data block
  • It contains the type of file system
  • All the information about the file in linux
  • All the real data is stored in the data  block.
  • Size of the file
  • Like creation and modification date
  • When you delete something from the hard drive it doesn’t get deleted permanently, it just unlinked from the inode table unless it get overwritten by newer data
  • They store redundantly on the disk (duplicate)

(backups)

  • The reference of the data is stored in the inode table
  • In most cases the data can be recovered even after you’ve deleted it.

Soft link & Hard link

Soft link are similar to MS windows shortcut.

  • One file can have many shortcuts pointing to it.
  • Directory soft link
    ** dir007 is a dir. and dir is soft link.

File soft link

** file1= file and f1 is a shortcut link           ** 1 denotes the only one link

If we remove the original file the soft link will automatically be deleted.

Hard Link are just different names for the same file

  • One file can have many different names or hard links.

  • The files have the same inode no.

  • We cannot create hard links for the directories.

If we remove the file the hard link will not be removed.

Conclusion: Finally we will learn what is inodes, three distinct areas on which hard drive depends and what is soft & hard link.

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.

MySQL Database Engine

Database engines provide capabilities for MySQL to work with and process data

The two most common Database engines are MyISAM and InnoDB

  • MyISAM is a default MySQL engine version earlier than 5.5.5
  • InnoDB may be a better choice in many situations.

Here are the few more important differences that must be known to you….

  • –> InnoDB supports transactions whereas MyISAM does not.
  • –> InnoDB provides support for foreign keys whereas MyISAM does not.
  • –> InnoDB is suitable for large databases because it supports transaction, volume whereas –> –> MyISAM is suitable for small projects.
  • –> Performance speed of MyISAM is much higher than InnoDB
  • –> InnoDB supports row level locking which means inserting and updating is much faster as           compared with MyISAM.
  • –>InnoDB supports ACID properties whereas MyISAM does not.
  • Conclusion: Finally you will get the few differences on Innodb & MyISAM.
avh
setup apache virtual host

What is virtual hosting?

Virtual hosting is also called shared hosting.

Virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers). This allows one server to share its resources, such as memory and processor cycles, without requiring all services provided to use the same hostname.

Prerequisite is:

You need to access the CentOS 7 server with either root or user access.

You also need to install the apache web server, if you don’t have installed you can use the following commands :

 

Commands used when

we have root access otherwise

insert sudo behind each and every command 

  • yum -y update
  • yum  -y install httpd                               
  • systemctl start httpd
  • systemctl enable httpd
  • systemctl restart httpd
  • systemctl status httpd

 

After installation, you will see the active status when we set off the status command.

After the proper installation of Apache all you have to follow the proper steps for shared hosting:

Step 1

Buy multiple domain name from the domain provider and configure it with the DNS

Here we have purchased the two domains

For the learning purpose, we have bought from the free domain provider i.e freenom.com.

you can either buy the domain from the domain provider.

 

How to set up Apache virtual hosts in CentOS 7

Step 2

As this is for the testing purpose so there will be no added text, pictures in these domains.

By default, there will be index.html file in /var/www/html/index.html 

The document root the top-level directory that will save the content of the website.

Here we will create the directory of each virtual host that we plan on making.

How to set up Apache virtual hosts in CentOS 7
apache virtual host

Step 3

Here we will delete the default index.html file and after the deletion, we will create the index.html file in the same /html directory.

(for deleting the use $rm -rf  index.html command) (to creating use touch command  touch index.html)

We have created two dir. name japan123 & japan321 and also created two files index.html  

Step 4

In the index.html file for both the domains( japan123.tk & japan321.tk) just write the following lines “jack ryan from florida” & “japan321”.

using the editor command $vim var/www/html/japan123/index.html & $vim var/www/html/japan321/index.html

Step 5

After doing this we will enter into the Apache configuration file to create the virtual hosts

For doing this process

Open your editor of choice and create the following basic Virtual Host configuration file:

How to set up Apache virtual hosts in CentOS 7
Apache virtual hosting

<VirtualHost *:80>                                                        ||             <VirtualHost *:80>

DocumentRoot “/var/www/html/japan123”        ||              DocumentRoot “/var/www/html/japan321”

ServerName www.japan123.tk                                     ||              ServerName www.japan321.tk 

ServerAlias jpan123.tk                                                   ||              ServerAlias jpan321.tk     

<Directory /var/www/html/japan123>                 ||              <Directory /var/www/html/japan321>   

Require all granted                                                         ||               Require all granted   

</Directory>                                                                   ||               </Directory>       

</VirtualHost>                                                               ||               </VirtualHost> 

Here we have made two virtual hosts to connect with the single server

So we have to insert the following commands shown in the above picture.

Step 6

After saving with the file we have to restart the httpd server

# systemctl restart httpd

Step 7

At last, we just put both the domain names japan123.tk & japan321.tk in the web browser.

How to set up Apache virtual hosts in CentOS 7
apache virtual hosting
How to set up Apache virtual hosts in CentOS 7
apache virtual host
Conclusion: After this you will able to host multiple domain on a single server.

How To Save Money With Cheap Web Hosting Plans In This Crisis?

COVID-19 appears as a crisis all over the world. It sets up lots of barriers to the success path for all types of businesses. Due to it, everyone wants to save money as much as they can. Similarly, they are trying to find out the best and cheap managed web hosting services for saving money with quality services. Cloud Minister can help you here with full professional support and services. 

 

What Is Web Hosting?

With web hosting services, you can set up a fully functional website on the World Wide Web. For such a service, you need to contact the web hosts (web hosting service providers). The host will help you by providing a space on their server for running the website freely and as you want. In consideration, they will charge money as per the rent or fee of the services. 

There are different types of web hosting options available, you should pick the suitable one as per the requirements such as – dedicated hosting server, shared hosting, reseller hosting, and so on. 

Tips for saving money 

If you are wandering for saving money by availing of cheap hosting services, then here you can get some major tips. 

 

1) Apply coupon codes

 

Some sources are offering different types of coupon codes for providing a discount. Mainly these codes are generated with the combination of some specific numbers and letters. All codes are associated with some terms & conditions and some benefits such as – reduce the payable amount at high rates. There are many companies providing coupon codes for the satisfaction of clients. You can grab such a code and apply it while making a final payment. It will help you in saving a big amount of money and get hosting at lower rates. 

2) Shared web hosting

 

As we discussed previously, there are various kinds of web hosting plans available. In case you are at the initial stages of running a small business, then you do not need to invest money on dedicated servers. Here, you can go with the option of shared web hosting. In the shared web hosting, you don’t have a complete server, you will get a space on a common server that is also used by some others. You do not need to worry about security and other measures. All these things are under the control of the hosting provider. It will help you in availing low cost server management services easily.

3) Get domain name

 

For creating your website, it is important to have your domain name. It is also helpful in availing of some special services or benefits. Some companies are providing the services of a free domain name if you are going to get both domain name and hosting from them. It will help you in reducing a big portion of the overall payable amount. These relaxations are going to be provided for the first year. In case of renewal, you cannot avail of such a service. 

 

4) Choose plan carefully

 

Before making any decision regarding the selection of a service plan, you should figure out the requirements. The requirements can help you in figuring out what you want for a website. If you do not pay attention to needs, then you may add some extra stuff to the cart. These things are leading to higher expenses only. 

 

5) Try to get the plan for a long period

 

Almost everyone is interested in getting fully managed web hosting only for one year. Here, they are completely ignoring the importance of spending on plans for a long period. If you are going to buy hosting for a long period instead of only one year, then you will get some extra discount. It will help you by reducing hosting on an average basis. 

 

6) Be a part of hosting affiliate program

 

Joining an affiliate program can be a smart decision. In case you get success in carrying the affiliate program perfectly by selling services, then you will get lots of advantages. The biggest advantage is getting website hosting free or at lower prices for their promotions. If you face failure in bringing conversions, then you are not able to grab such a big reward and associated factors. 

 

7) Avail special day offers

 

The companies are providing some discounting offers during special days such as – occasions, festive seasons, and so on. You should be alert and any such kind of event is about to come, then you should wait for a while. Keeping patience and waiting for a time, will help you in saving a big amount of money. During these days, you can get the maximum discount possible. 

 

8) Ask for relaxations

 

When it comes to the renewal of hosting plans, then the options of relaxations are very less. If you want to avail of the low-cost server management services, then you should consult with a service provider. Here, you should ask them for some relaxation or discounts on the services. It can lead to a great impact on the payments and helps you in saving a good amount of money. 

These are some major facts by which you can get success in saving money by availing the cheap web hosting services. For all these things, you should try to check out several elements. The most important one is the web hoster. In case you are not dealing with the best service provider, then it doesn’t matter how much money you saved. A bad service provider may become a reason for several issues in the website functionalities. 

 

Tips for choosing the best web hoster.

 

1) Features

 

Firstly, you are required to check out the features that you will get with the services. The features are going to make things easier by eliminating the complicacy. With it, you should check out the server features and make sure that the services are suitable or not such as – how many domains you can host on a server at a time, is it safe for running an eCommerce platform, and so on. 

 

2) Control panel

 

Control panel is the most important element by which you are capable of managing the web hosting services and some other factors. A good web hosting company provides a control panel with the addition of a user-friendly interface. Consequently, it will be easier to understand all facts easily and manage the hosting account quickly. 

 

3) Payment options

 

The selection of the best web hosting company can be based on the payment details. Firstly, you need to check out all types of plans and its prices offered by the company. The similar thing you should figure out related to some other companies. It will assist you in comparing different Self-managed web hosting plans. While making a final decision, you should focus on all elements such as – bandwidth, upgrades, first-year plans, and renewals. 

 

4) Support

 

Customer support is the biggest factor that cannot be ignored. You should check out the company is providing 24*7 professional support or not. The best web hoster has lots of options for availing the support services like – contact us form, email, direct call contact, and live chat. Support is useful in clearing some basic queries and troubleshooting small issues quickly. 

 

5) Data backup

 

While availing the web hosting company, the biggest element is related to the website data. You should choose the services that are associated with the facility of regular data backups. It will help you in the recovery of websites in case of disasters and some other major issues. 

 

6) Testimonials

 

You cannot ignore the importance of testimonials. It will be useful in figuring out what kind of services are provided by the company to the previous customers. If you will get positive reviews and higher ratings, then it is good to choose the company. In case you find anything wrong, then do not forget to inspect all details and then make a final decision. 

Having low-cost server management services is not enough during this COVID-19 crisis period. You need to be more specific while choosing the best hoster. These points will help you in comparing and inspecting all options. We at Cloud Minister are working for the client’s satisfaction only and provide high-quality server hosting services at minimal possible prices.

 

WordPress

 

WordPress is one of the most popular and widely used content management systems, blogging platforms in the world. It is popularly used as a Blog, Portfolio Website,  etc.
In this tutorial, you are going to learn how to install WordPress with LEMP (Linux, Nginx, MySQL and PHP)  on CentOS 7 VPS.

 

Table of Content

 

1)  Prerequisites

2) Install MySQL 5.7

3) Configure Database in MySQL

4) Install & Configure PHP 7.2

5) Install Nginx

6) Configure Firewall

7) Configure Nginx File

8) Install WordPress File

9) Test WordPress

1) Prerequisites –

Before you start the installation of WordPress with (LEMP) stack on Centos 7 VPS, you must have one Centos 7 VPS with root privileges on it or you can use sudo for non-root user.

 You should also run basis command on server to check the following things-:

(i) # df -h  (To check the disk space on the system)

(ii) # cat /etc/os-release  (To verify the version of the VPS)

 

(iii) # yum -y update  (To update all the packages of the VPS)

 

2) Install MySQL 5.7 –

WordPress uses a MySQL database for storage, MySQL is used in stack for storing user details in database.

 For installing MySQL on Centos 7 first you need to enable MySQL repository and then you can install MySQL.

# yum localinstall -y https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

The command used for installing MySQL in CentOS 7 VPS is as follows:

# yum install mysql-server -y

 Then check the MySQL version by typing following command:

 # mysql -V(‘V’ is in uppercase)

 After the installation is completed MySQL will start automatically and you can check it’s status by typing:

# systemctl status mysqld

 If MySQL is not start automatically you can write the following command:

 # systemctl start mysqld

 Before going for the next step you should generate a temporary password to access MySQL root user with the following command:

 # grep ‘temporary password’ /var/log/mysqld.log

Now configure the MySQL secure installation to improve the security by typing the following commands.

# mysql_secure_installation

 Login with the temporary password and assign new password, after that in this configuration it ask several questions you can give Y or N according to your requirement.

i) Change the password for root ? N

ii) Remove anonymous users? Y

iii) Disallow root login remotely? Y

iv) Remove test database and access to it? Y

v)  Reload privilege tables now? Y

3) Configure Database in MySQL –

Now create database for WordPress in MySQL for that first login with MySQL server by using the following command:

 # mysql -u root -p

 And give its password, after that create database in it with the command:

mysql> CREATE DATABASE wordpress;

You can also check that database is created or not with the command:

 mysql> SHOW  DATABASES;

 Now create user and assign him password by using command:

mysql> CREATE USER ‘wordpress’@’localhost’ IDENTIFIED 

 BY ‘Password’;

 After that grant all privileges to the user created under that database with the command:

 mysql> GRANT ALL ON  wordpress.* TO ‘wordpress’@’localhost’;   

 Then flush all privileges on MySQL server with the command:

  mysql> FLUSH PRIVILEGES;

 Now exit from the MySQL server you can use commands:

  mysql> exit;

  mysql> q;

 
Note-: In MySQL you must end each command with a semicolon(;).

 4) Install & Configure PHP 7.2 –

 PHP is used by WordPress to do various functions done by PHP like calling plugin, calling theme, validating user permissions, checking option, grab from database, etc.

In this Blog we are using PHP 7.2 versionand install it with epel-release with remi repository.

 Firstly, install yum-utils packages using the following command:

# yum -y install yum-utils

 After that, install epel-release package by using command:

# yum -y install epel-release

 Then import remi repository from the command:

 # yum -y install  http://rpms.remirepo.net/enterprise/ remi-release-7.rpm

Enable the remi repository by typing:

# yum-config-manager –enable remi-php72 

 After that install PHP and all required modules by using command:

 # yum -y install php-fpm php-mysql php-mbstring php-xml      php-gd php-cli php-json php-opcache php-curl

Now after the installation completed you can check the PHP version with the command:

# php -v (‘v’ is in smallcase)

 

5) Install Nginx

Nginx, pronounced as “Engine X” and is a very fast and lightweight web server, that can be used to support static files, used as a reverse proxy and also for load balancing. It is one of the best Linux VPS Server as compared to Apache. It can handle higher load of HTTP request.

Firstly, update all the software packages by typing the following command:

# yum -y update

After that install EPEL repository that is required for Nginx packages by using command:

# yum -y install epel-release 

Now install  Nginx by typing the command:

 # yum -y install nginx

After the installation is completed you must Enable and Start Nginx server by typing command:

# systemctl start nginx

And enable it with the command:

# systemctl enable nginx

Also check its status with

# systemctl status nginx

6) Configure Firewall

After completed with installation part, configure the firewall settings with the following command:

Open HTTP port by typing command with:

# firewall-cmd –permanent –zone=public –add-service=http

If firewall package is not available then you can install it with command

 # yum -y install firewalld

And start firewalld service with command:

 # systemctl start firewalld

Now reload firewall configuration file by typing:

 # firewall-cmd –reload

Now verify your installation of Nginx by visiting the following URL on any browser you like with http://ip_address

7) Configure Nginx File

An Nginx server configuration file plays an important role, So you should be more careful when setting up this file.

For configuring Nginx file go inside the following path with the following command:

# cd /etc/nginx/conf.d

# vi default.conf

And write the following code in the above file i.e. default.conf.

Also change your domain in place of   ip_address   

server {

        listen       80;

        server_name  54.161.140.2;

root /usr/share/nginx/html/wordpress;

        index index.php index.html index.htm;

location / {

          try_files $uri $uri/ =404;

       }

       error_page 404 /404.html;

            location = /40x.html {

        root /usr/share/nginx/html/wordpress;

     }

        error_page 500 502 503 504 /50x.html;

            location = /50x.html {

        root /usr/share/nginx/html/wordpress;

}

        location ~* .php$ {

        try_files $uri =404;

        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;

        fastcgi_index index.php;

        include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        }

}

And save it with :wq command, after that edit the configuration file of php-fpm with the following command:

 # vi /etc/php-fpm.d/www.conf

Open the file with above command and edit the following lines i.e.

user = nginx

group = nginx

Add new listen under listen  = 127.0.0.1:9000

listen = /var/run/php-fpm/php-fpm.sock

And also add

listen.owner = nginx

listen.group = nginx

Remove comment (;) from the above two lines and save it with :wq.

8) Install WordPress File

You can easily download WordPress archive file from the link I provided in this blog.
First go inside /tmp directory by typing below command:

# cd /tmp

Download the latest WordPress setup by using wget command

# wget https://wordpress.org/latest.tar.gz

And if wget command not work then you can download it with the following command

# yum -y install wget

Now extract the downloaded file using below command:

# tar xzvf latest.tar.gz

After that move wordpress directory in /var/www/html directory by using command:

# mv wordpress /usr/share/nginx/html

Also change the ownership of /var/www/html directory by using the following command

# sudo chown -R nginx: /usr/share/nginx/html

# chmod -R 755 /usr/share/nginx/html

 

9) Test WordPress

Now for testing the server of WordPress you should restart the server for that follow the command:

# nginx -t

(If the command shows ‘successfully’ message then the changes in file are correct and else the changes are wrong in the nginx configuration file.)

# systemctl restart php-fpm

# systemctl restart nginx

Then open any browser and type inside URL i.e http://ip_address/

After then configuration page i.e. http://ip_address/wp-admin/ is open and select language.

How to install WordPress with LEMP stack on CentOS 7 VPS.

CONCLUSION– After this installation, you will be able to create or manage blog in WordPress CMS.

Linux/Unix

Linux is a clone of Unix operating system, it is a multi-user operating system, which can be accessed by many users at a time.

Linux Server Management

Linux server management service is a cost-effective mixture for the application-based server. Essential applications deployed on Linux servers need the right management solutions or tools. Large enterprises and end-users require robust Linux servers to manage applications for their business.

In this tutorial, you will learn the very basic Linux commands that will help you to get more familiar with the Linux command line. This will also help you to sharpen the commands line in Linux as well as also help you in enhancing your capability of getting an expert in this field.

Commands

The commands in Linux have the following syntax:

$command options arguments

 

 Bash/shell: Program that provides text-only interface.

 Terminal: A terminal window

 Command-line   : Anything that takes input

 Console: Physical instrument panel

1) $ls                           :  Used to show the folders & web files

2) $ls -a                      : List all the files and folders.

3) $ls -l                        :Used to list folders with permissions

Linux / Unix basic commands for beginners

4) $ls Do*   : Listing all the folders starting with Do also print inside files

5) $ls .*       : Listing all the files starting with (.)

 Linux / Unix basic commands for beginners

6) $ls -a       : listing all the folders and files, including hidden files

7) $cd          : To jump in the folder

8) $cd ..       : To go back to the folder.

9) $cd ../..    : To jump back to the two directories.

10) $mkdir     : To make the directory/folder

11) $mkdir -p : To make the directory/folder one to one inside in it.

Example:

Linux / Unix basic commands for beginners

12) $mkdir -vp : to make the directory and it will print the dir. created.

              Example-

 Linux / Unix basic commands for beginners

13) $touch pop : to make the new file(pop) in folder

14) $touch grapes oranges : to make a recursive file(grapes,oranges) in a folder.

15) $mv : to move the file from source to destination.

16) $cp : to copy a file from one folder to another.

17) $rm : Delete the file or folder

18) $rm -r file name/ :  Remove the folder

19) $rm -r a b c : remove the files from the folder

20) $whereis (command name) : To find the actual path of the command.

21) $echo -e “paul nlikes necho”

Linux / Unix basic commands for beginners

  • It will print each char in next line

22) $ x=paul

23) $ echo  “ $x nlikes necho”

 Linux / Unix basic commands for beginners

  • It will also print the x value

Find command

Find command is used to search and locate the list of files and directories based on conditions you specify for files that match the arguments. Find can be used in a variety of conditions like you can find files by permissions, users, groups, file type, date, size, and other possible criteria

 

Note: (.) is for the current directory

24.) $ find . -name file_name / dir._name

    Used to find the file/directory in the current directory

Linux / Unix basic commands for beginners

25.) $ find . -type f/d -empty

    To find the empty dir/ file     ** f for file & d for directory

Linux / Unix basic commands for beginners
Linux / Unix basic commands for beginners

26) $ find . -mtime  -1

   To find the file/directory which is made within one day

Linux / Unix basic commands for beginners

27) $ find . -mtime  +1

   To find the file/dir. which was made 1 day ago

28) $find . -mmin 1

   To find the file/dir. which was made 1 min ago/  To find the file/dir which is made within 1 min.

Linux / Unix basic commands for beginners

 

29) $ find ./ type d/f -name file/dir

   To find the directory / file

        ** f for file and d for directory

 

30) $ find . *.extension

   To find the all file which is with the assigned extension.

        ** here there is no .jpg file available

Linux / Unix basic commands for beginners

 

31) $ find dir.name

   To show all the files and directories

Linux / Unix basic commands for beginners

32) $ find -iname “char*”

   To find all the files and dir. starting with the f* and -i not including case sensitivity

Linux / Unix basic commands for beginners

33) $ find ./ -type f/d -iname “f*”

   To find file or directory with disable case sensitivity and listing files / dir with f*

Linux / Unix basic commands for beginners

34) $ find . -size +0

   This will show the file presented in the current directory which is more than 0 mega byte.

         ** G = GB

         ** K= KB

Linux / Unix basic commands for beginners

35) $ du -sh file/dir

    It will give the size of the file or directory in KB

Vi editor

Linux / Unix basic commands for beginners

After $ vi d1 write the text by pressing (I for Insert )click→ Esc→ shift + :→ wq → Enter

Linux / Unix basic commands for beginnersLinux / Unix basic commands for beginners

GREP – Global Regular Expression Print

“It allow us to search text within files in a system”

36) $ grep [binary digit] file_name

   It will search the binary number which are inserted in the square bracket.

Linux / Unix basic commands for beginners

37) $ grep -w “string” file_name

   It will only show the valid text inserted in the inverted commas.

Linux / Unix basic commands for beginners

38) $ grep -i “string” file_name

   It is non-case sensitive command (  -i )

Linux / Unix basic commands for beginners

39) $ grep “string” file_name

   Show all the matching text.

Linux / Unix basic commands for beginners

40) $grep -win “string” file_name

   Show at which line the text resides.

Linux / Unix basic commands for beginners

41) $ grep -win -B 4 “string” file_name

  Show the 4 line before the inserted text.

Linux / Unix basic commands for beginners

Show the 2 lines above and below the text.

Linux / Unix basic commands for beginners

Show the 2 lines after the text

42) $ grep -win -A2 ‘String” d1

Linux / Unix basic commands for beginners

43) $ grep -winr “string” ./*

   [centos@localhost ~]$ grep -winr “cat” ./*

   It will show all the files and folders with the string.

AWK command (Aho, Weinberger and Kernighan)

 

It is just a scripting language used to it doesn’t require compilation time and it generates reports by processing file. It is beneficial for pattern searching and processing files.

Various programming concepts offered by AWK are:

     1) Output formatting

     2) Inbuilt variables

     3) Pattern matching

     4) String operations

     5) Arithmetic operations

Basic syntax

# awk options ‘selection _criteria {action }’ input-file > output-file

Awk assign some variables for each field.

→ $0 denotes the whole file

→ $1 denotes the first field

→ $2 denotes the second field

     And $3,$4,$5…..so on for every field.

Commands related AWK

 

44) # awk ‘{print $variable}’ file_name

   This command will print the field according to the variable

Linux / Unix basic commands for beginners

Linux / Unix basic commands for beginners
Linux / Unix basic commands for beginners

45) # awk –version

   We can also check the version of the awk.

         # awk -F: ‘{print $variable}’ filename

This will print the file without the separator (i.e. [:])

Linux / Unix basic commands for beginners

Linux / Unix basic commands for beginners

46) # echo “string” | awk ‘{$variable=”string”; print  $variable}’

    This will replace the string manish to raghav  and print the whole string.

 

Linux / Unix basic commands for beginners

47) # cat file_name | awk ‘{$variable=”string”; print $variable}’

   This command  will replace the particular string which is in field 2 and  print the whole file content.

Linux / Unix basic commands for beginners

48) # awk ‘/string/’ file_name 

   This command will show each line that contains the following word i.e.( or )

Linux / Unix basic commands for beginners

49) # awk ‘$variable==”char” {print $variable}’ file_name

   T

his will print 5th field if the field 1 value matches the value 300 in the file.

Linux / Unix basic commands for beginners

CUT command

 

The cut command basically a Unix command line utility which extracts section from each line.

Basically the cut command slices a line and extracts the text.

50) # cat -b variable file_name

     This cut command will extract the following byte (-b) from the file.

Linux / Unix basic commands for beginners
Linux / Unix basic commands for beginners

51) # cut -d ‘delimiter’ -f field/ranges/sequence file_name

   This command will show the following fields/ranges from the file

   if -d option is not used then it prints whole line:

Linux / Unix basic commands for beginners

Linux / Unix basic commands for beginners

52) # cut -c variable file_name

   This command will print each character from the file starting from 1st field.

Linux / Unix basic commands for beginners

53) # cut –complement -d “  “ -f variable file_name

   This command will print each field except the 3rd field

Linux / Unix basic commands for beginners

54) # echo field >> file_name

   This command will permanently add on the field at last into the file

Linux / Unix basic commands for beginners

55) # cut -d “ “ -fvariable file_name

    This command will show only the 3rd field from the file

Linux / Unix basic commands for beginners

SED command

 

It is also called stream editor, it is a powerful linux/unix utility tool used for text manipulation, finding, deletion, saving permanently, etc.

s: means substitute

g: means globally

56) # sed ‘s/string1/string2/g’ file_name

   This command will change the string1 to string2

Linux / Unix basic commands for beginners

57) # sed /bstring1b/string2/g’ file_name

   This will replace the exact matching word list into raghav in the file.

Linux / Unix basic commands for beginners

58) # sed ‘s/^string1/string2/g’ file_name

   This command will change the value which ends with $ sign in the file.

Linux / Unix basic commands for beginners

Deletion 

 

59) # sed ‘/word/d’ file_name

  This command will delete the particular line which consists of the particular word.

   ‘d’ denotes the delete.

Linux / Unix basic commands for beginners

Saving permanently to the file

 

60) # sed -i ‘s/char1/char2/g’ file_name

Linux / Unix basic commands for beginners

-i → use this -i ,if you want to change or modify directly to the file

        This -i can be used at the above sed commands this will permanently save every modification in the file.

 

Conclusion: By following this tutorial you will get the basic understanding of Linux commands

Why do we use file permission in Linux/Unix?

Linux is a clone of UNIX operating system, it is a multi-user operating system, which can be accessed by many users at a time.

Because of this , it raises the question on its security, that it can be easily corrupted or any one can change or remove the crucial data.

So, taking care of the security.

 

Linux divides authorisation level into 2 levels

1…Ownership

2…Permissions

 

Ownership 

In linux the system is allocated 3 types of owner

→ First one is “User

Owner of the file.The person who creates the file is called the owner.

→ Second one is “Group

In a group there can be multiple users we can put multiple users in a group and assign the same file permission.

→ Third one is “other

Other can be anybody except user & group

  Permissions

For every user, group & other there their is set permission

  1. Read 
  2. Write 
  3. Execute

 

User → rwx

Group → rwx                                            (-) → file -rw-rwxrw-

Other → rwx                                             (d) → directory drw-rwxrwxrw-

 

Read – Gives the permission to read the file,

Write – Gives the permission to modify the file it gives the authority to add ,remove ,rename the file which is stored in the directory.

 Execute – we cannot open the file if the execute permission is not given to the file.

Example:- Understanding and learning file permissions in Linux OS

(d)/(-)

Show directory or file if directory (d) sign shows in starting

If file (-) hyphen sign show in starting

first (rwx)

Permission of user (read,write,execute)

Second (r-x)

Permission of group (read,-,execute)

Third (r-x)

Permission of other (read,-,execute)

r

r  refer to  read permission

w

w  refer to write permission

X

x  refer to execute permission

Give permission to file and directory has two way
1. Symbolic method
2. Octal method / numerical method

(chmod) command use to change permission

Default permission of file :-

Symbolic method

Symbolic method is used alphabets to set permission.

 

u

u refer to user

g

g refer to group

o

o refer to other

(+)

Use to add permission

(-)

Use to remove permission

(=)

Use to overwrite permission

 

Examples:-

Create “mydir” directory
1. add  write permissions to group on mydir (# chmod g+w mydir)

    Understanding and learning file permissions in Linux OS
2. Give only execute permission to other (# chmod o=x mydir)

Understanding and learning file permissions in Linux OS

3. Remove write permissions to user (# chmod u-w mydir)

Understanding and learning file permissions in Linux OS

Octal or numeric method

Octal method use numbers to set permission

 

0

(—)

No permission

1

(–x)

Execute permission

2

(-w-)

Write permission

3

(-wx)

Write and execute permission

4

(r–)

Read-only permission

5

(r-x)

Read & execute permission

6

(rw-)

Read & write permission

7

(rwx)

All permission

 

example:- use octal method to give permission

chmod user|group|other file/directory path
1. # chmod 755 mydir (this command give permission to mydir user have all permissions, group & other have only read and execute permission.)

Understanding and learning file permissions in Linux OS

Special permission

1. Setuid (set user id)
2. Setgid (set group id)
3. Sticky bit

1. setuid :- setuid is the permission bit that allows the user to execute a command/ program with the permission of its owner. Setuid permission are used to tell the system to run an executable file as the owner with the owner’s permission.

Symbolic method to setuid —># chmod u+s file_name (This command use to setuid bit on file)

Octal method to setuid —># chmod 4766 file_name (This command use to setuid bit using  octal method)

Remove setuid bit —># chmod u-s file_name (This command use to remove the setuid bit form file)

2. Setgid :- setgid is a bit that allows the user to execute a program with the permission of the group owner.

Symbolic method to setgid  —># chmod g+s file_name (This command use to setgid bit on file)

Octal method to setgid —># chmod 2766 file_name (This command use to setgid bit using octal method)

Remove setgid bit —> # chmod g-s file_name  (This command use to remove the setuid bit form file)

3. Sticky bits :- A sticky bit is a permission bit that is set on a directory that allows only the owner of the file within that directory or the root user to delete or rename the file. No other user has the needed privileges to delete the file created by some other user.

Symbolic method to set sticky bit  —># chmod +t file_name (This command use to set the sticky bit on file and directory)

Octal method to set sticky bit —># chmod 7660 file_name (This command use to set stickybit using octal method)

Remove sticky bit —> # chmod -t file_name  (This command use to remove the sticky bit)

Conclusion:

By following this tutorial you will learn what are the permissions as well as special permission in Linux/Unix.

Get started with CloudMinister Today