Tuesday, July 27, 2021

How to Install Centos 7 step by step | Centos 7 Installation step

 

Centos 7 Step by Step installation guide 

Requirement for Centos .

A - You should have DVD or ISO image of Centos 7. 
      if you don't have you can download it from here .
B - You should have Virtual Machine or Base Machine 


Let's move for Installation 
  1. Turn on your machine and insert your installation media like DVD, Pen Drive or ISO and boot from media .
    2. Now you will get below screen here just select Install CentOS 7  and press enter .



    3.  Now select language according to your need and click on Continue 



    4.  Now click on Date & Time as given in below screen.


    5. Here you can select your time zone according to your need i'm selecting Asia/Kolkata and click on            Done 


    6. Now Click on NETWORK & HOST NAME




    7. HERE turn on Ethernet and change hostname and given below screenshots.



    Note: if you will turn on Ethernet only and when you will reboot your server next time your server 
              will not connect with network so make sure click on Configure  and check Automatically 
              connect to this network when it is available after that click on Done.



    8. Now click on  INSTALLATION DESTINATION and select disk where you want to install and 
        click on Done as given in below screenshots .



    9. Now click on SOFTWARE SELECTION  if you want to install additional packages.
       like GUI, Administrator tools etc and click on Done 


    
    10. Now click on Begin Installation to start installation of CentOS 7 .

 


    11. Now Click on ROOT PASSWORD to set root user password 


    12. Remember here you have to give password as suggested but if you are using weak password 
            then you have to click on Done twice.


    13. Now click on Reboot and make sure you remove installation media 



    14. Now click on LICENSE INFORMATION 


    15. Here  accept the license agreement  and click on Done


    16. Now click on FINISH CONFIGURATION 


    17. Click on Next


    18. Click on Next - Next - Next




    19. Now click on Skip or if you want to configure given account you can 


    20. If you have not created user account at the time of installation you have to create here as given 
            below after that click on Next  and set password then click on Next



    21. Now your server or desktop is ready for use click on Start Using CentOS Linux





    Now Enjoy, if you have any query you can post comment.



Sunday, July 11, 2021

How to solve CSS loading issue after implementing AWS ALB | CSS not Loading after AWS ALB in Wordpress

 

How to solve CSS Loading issue After implementing AWS ALB


=> Why this issue is happening : Whenever we use ALB to manage our website traffic like http or https first all request goes to ALB only and ALB manage all traffic, means  user get https reply but ALB send only http request on backend server and we don't have https enabled on server so server not able to respond in same way because of this we started facing CSS not loading issue or broken site pages or "ERR_TOO_MANY_REDIRECTS"


How to solve this issue : You can solve this issue by using  
                                          HTTP_X_FORWARDED_PROTO by doing modification in wordpress configuration as given below .


=> Update Your wordpress configuration 


define('WP_HOME','https://www.makelinuxinteresting.com/');
define('WP_SITEURL','https://www.makelinuxinteresting.com/');

// Below is the code which you have to implement in wp-config.php
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
       $_SERVER['HTTPS']='on';


Note : After implementing this code make sure you clear your browser cache or use private windows. 




Saturday, July 3, 2021

How to create NFS server on Centos 7 | How to Install NFS server on Centos 8

 

Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems (Sun) in 1984,It allows you to mount your local file systems over a network and remote hosts to interact with them as they are mounted locally on the same system. NFS, like many other protocols, builds on the Open Network Computing Remote Procedure Call (ONC RPC) system. 


    Feature & Benefits of NFS Server 

    • NFS server allows to mount locally from  remote server files.
    • Fast and reliable services 
    •  NFS can be configure as centralized storage .
    • Users get their data irrespective of physical location.
    • File sync real time . 
    • Can be secured with Firewalls.

    NFS Configuration files 
    /etc/exports  : This is main configuration file which contain information of all shared Directory .

    /etc/sysconfig/nfs : This file contain information port and services information.

    /etc/fstab : This is not NFS configuration but we use this file to mount share permanently. 


    NFS Server Configuration
    Step 1 : Install required packages 

    [root@server1 ~]# yum install nfs-utils 


    Step 2 : Start the nfs service 


    [root@server1 ~]# systemctl start nfs-server  


    systemctl status nfs-server

    nfs-server.service - NFS server and services

       Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)

       Active: active (exited) since Tue 2021-06-22 23:12:52 EDT; 1s ago

      Process: 9325 ExecStartPost=/bin/sh -c if systemctl -q is-active gssproxy; then systemctl reload gssproxy ; fi (code=exited, status=0/SUCCESS)

      Process: 9309 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)

      Process: 9308 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)

     Main PID: 9309 (code=exited, status=0/SUCCESS)

        Tasks: 0

       CGroup: /system.slice/nfs-server.service


    Jun 22 23:12:52 server1 systemd[1]: Starting NFS server and services...

    Jun 22 23:12:52 server1 systemd[1]: Started NFS server and services.




    [root@server1 ~]# systemctl enable nfs-server 

    Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.




    Step 3 : Configure NFS Share 



    [root@server1 ~]# mkdir /opt/SHAREDRIVE



    [root@server1 ~]# vi /etc/exports


    /opt/SHAREDRIVE 192.168.43.230(rw,sync,no_root_squash)



    Note: In above entry /opt/SHAREDRIVE is a folder which you

          want to share over network and 192.168.43.230 is a client 

          IP to whom you want to share. if you want to share this

          NFS drive to all system over network user * in place of IP.



    : Now restart nfs service to take effect new configuration 


    [root@server1 ~]# systemctl restart nfs-server


    : Now check your configuration 


    [root@server1 ~]# showmount -e localhost


    Export list for localhost:

    /opt/SHAREDRIVE 192.168.43.230



    NFS Options

    • ro: With the help of this option we can provide read only access to the shared files.
    • rw: This option will allows both read and write access to the client.
    • sync: Sync confirms requests to the shared directory only once the changes have been committed.
    • no_subtree_check: This option prevents the subtree checking. When a shared directory is the subdirectory of a larger file system, nfs performs scans of every directory above it, in order to verify its permissions and details. Disabling the subtree check may increase the reliability of NFS, but reduce security.
    • no_root_squash: This allows root to connect to the directory.



    Step 4 : Mount NFS Share on client 



    Note: if nfs-utils package is not installed on client install it first 



    : Check available share 


    NirmalSingh@abcs-Air ~ % showmount -e 192.168.43.62


    Exports list on 192.168.43.62:

    /opt/SHAREDRIVE                     192.168.43.230 



    : Now Mount NFS share 

    [root@client1 ~]#  mount -t nfs 192.168.43.62:/opt/SHAREDRIVE /mnt/




    : Now Verify your NFS Mount 


    [root@client1 ~]# mount | grep nfs


    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)

    nfsd on /proc/fs/nfsd type nfsd (rw,relatime)

    192.168.43.62:/opt/SHAREDRIVE on /mnt type nfs4 (rw,relatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.43.62,local_lock=none,addr=192.168.43.62)



    : Now Mount NFS Share Permanent 

    : Make entry in /etc/fstab file 

    [root@client1 ~]# vi /etc/fstab


    192.168.43.62:/opt/SHAREDRIVE /mnt      nfs     defaults 0 0




    : Now all configuration done you can use share to put data

      and check on server.










    Mastering Cron Jobs in Linux: A Comprehensive Guide with Examples

    Introduction: Cron jobs are an indispensable tool in the world of system administration and automation. They allow users to schedule tasks t...