Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts

Thursday, December 1, 2016

Wednesday, November 23, 2016

Configure Static IP On CentOS 6



Below steps will show configuration to set static IP address in Cent-OS machine.

    Network configuration files are under "/etc/sysconfig/network-scripts".
    We can open the file with editor like nano, vi, vim etc...
   
    Here I will use vi editor.
   
    In this server we will set Static IP for eth0 Ethernet port

1 - Start your server running Cent-OS enter root user credentials and login.

2 - Type the command,

         vi /etc/sysconfig/network-scripts/ifcfg-eth0

    This will open network configuration file, edit below lines:

         NM_CONTROLLED=yes
         ONBOOT=yes
         TYPE=Ethernet
         BOOTPROTO=static
         IPADDR=192.168.1.44            # Replace IP with your new
         NETMASK=255.255.255.0     # Replace IP with your subnet mask

3 - Type the command,

         vi /etc/sysconfig/network
   
    This will open file to set default gateway, edit below lines:

         NETWORKING=yes
         GATEWAY=192.168.1.1        # Replace IP with your gateway IP

4 - Type the command,

          vi /etc/resolv.conf
   
    This will open file to set DNS,

          nameserver 8.8.8.8                # Replace IP with your DNS IP
          nameserver 192.168.1.1        # Replace IP with your DNS IP

5 - To apply changes restart network interface, Type the command.
   
          /etc/init.d/network restart
   
NOTE:
Some time you might face issue in accessing your system. It can be due to firewall.
       
        To stop firewall temporary execute command,

            service iptables stop
           
        To stop firewall permanently execute command,

            service iptables stop
            chkconfig iptables off
           

 
ENJOY! and Stay connected.

Thursday, August 4, 2016

Install and Secure Apache, My SQL, PHP & phpMyAdmin on a CentOS 6




To Install Apache, My SQL, PHP & phpMyAdmin follow below process, 


    a) Run below command to install Apache, My SQL, PHP and phpMyAdmin
   
        yum install httpd mysql-server php php-mysql
   
    b) Run below command to start Apache & MySQL service,
   
        service httpd start
        service mysqld start
   
    c) Run below command to add Apache & MySQL service in startup,
   
        chkconfig httpd on
        chkconfig mysqld on

    d) Run below command to set database password, and other settings,
   
        mysql_secure_installation
       
     e) Run below command to install phpMyAdmin
      
        yum install epel-release
        yum install phpmyadmin

     f) Open below file, update required detais and restart apache service,
   
    /etc/httpd/conf.d/phpMyAdmin.conf

    Require ip your_workstation_IP_address
    . . .
    Allow from your_workstation_IP_address
    . . .
    Require ip your_workstation_IP_address
    . . .
    Allow from your_workstation_IP_address
    . . .

    service httpd restart

       
    g) Open below url to test apache and phpMyAdmin
   
        Apache
        http://<IP_address>
       
        phpMyAdmin
        http://<IP_address>/phpmyadmin

ENJOY! and Stay connected.
       

Friday, June 10, 2016

Modify host-name in Cent-OS 6

To change host name you must have root access of the system. We can do it using any text editor, here I am using text editor "vim".

Open /etc/sysconfig/network file.

         [root@lmntechnohub ~]# vim  /etc/sysconfig/network

Modify the HOSTNAME= value, and set your new host name.

     HOSTNAME=lmntechnohub.com

For internal networking, change the entries in host files at /etc/hosts .

     127.0.0.1    localhost localhost.localdomain

     10.10.10.10 lmntechnohub.com

Run the host-name command. This command will change host-name of Linux server, but it will not immediately update all programs that are running with old host-name.

     [root@lmntechnohub ~]# hostname lmntechnohub.com

     [root@lmntechnohub ~]# hostname

     lmntechnohub.com

     [root@lmntechnohub ~]#

To finalize it restart network service on your system, to ensure that changes will there on system restart.

     [root@lmntechnohub ~]# /etc/init.d/network restart

ENJOY! and Stay connected.