Skip to main content

Posts

Showing posts from September, 2017

SETTING PARTITION IN CENTOS

#lsblk   (to view all partitions available) This will list the available space    #fdisk /dev/sdc (Select n Then p for primary e for extended Give size w for save) similarly we can create multiple number of partition based on requirement. Then we need to assign a file system to the created partition.Here we are assigning ext3 file system.  #mkfs -t ext3 /dev/sdc Now create mount point.ie,the directory to which we want to mount #mkdir /disk Open fstab file inorder to permenently mount a file system. #vi /etc/fstab Here we gave details about UUID  mountpoint  filesystem defaults 0 0 (note:here fst zero indicates wheather disk is to be backed up.0 indicates no Second 0 indicates wheather fscheck is needed or not.0 means no fscheck. We can give these value no issue in it) To know the UUID blkid command can be used #blkid /dev/sdc1 After editing fstab file run partprobe command to reload partition table #partprobe

GUACAMOLE SERVER ON CENTOS/UBUNTU

           Guacamole will provide a web-based control panel that will allow you to switch quickly from one machine to another – all within the same web browser window.It will help us to control our server through web interface.Before installing guacamole we want to make sure xrdp is installed in our system(follow my blog http://www.goserverspace.com/2017/09/xrdp-for-ubuntu-142.html for it) Installing Guacamole Server Before installing guacamole, you will need to take care of its dependencies first. For Debian and Ubuntu: #apt-get install make libssh2-1-dev libtelnet-dev libpango1.0-dev libossp-uuid-dev libcairo2-dev libpng12-dev freerdp-x11 libssh2-1 libvncserver-dev libfreerdp-dev libvorbis-dev libssl0.9.8 gcc libssh-dev libpulse-dev tomcat7 tomcat7-admin tomcat7-docs ghostscript For RHEL / CentOS / Fedora#yum install cairo-devel libjpeg-devel libpng-devel uuid-devel freerdp-devel pango-devel libssh2-devel libssh-dev tomcat tomcat-admin-webapps tomcat-webapps libvncserver

SETTING STATIC IP FOR A CENTOS MACHINE

First go to network configuration file of interface #vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0" NM_CONTROLLED="yes" ONBOOT=yes HWADDR=A4:BA:DB:37:F1:04 TYPE=Ethernet BOOTPROTO=static NAME="System eth0" UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 NETWORK=192.168.2.0 IPADDR=192.168.2.23 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 #vi /etc/resolv.conf nameserver 8.8.8.8      # Replace with your nameserver ip nameserver 4.2.2.2  # Replace with your nameserver ip Now just restart network service #service network restart

APACHE SERVER PERFOMACE OPTIMISATION IN CENTOS/UBUNTU

There are different things to be taken care for improve perfomance of apache server.Iam explaing about different apache modules which helps in tuning its perfomance. APACHE MOD_STATUS To enable status reports only for browsers from the localhost add this code to your httpd.conf configuration file #vi /etc/httpd/conf/httpd.conf(centos/Redhat) #vi /etc/apache2/apache2.conf(ubuntu) <Location /server-status> SetHandler server-status Order Deny,Allow Deny from all Allow from localhost </Location> Apache mod_status also offers an option called  ExtendedStatus , which provides additional information about each request made to Apache. To enable  ExtendedStatus  edit your Apache configuration file: #vi /etc/httpd/conf/httpd.conf(centos/Redhat) #vi /etc/apache2/apache2.conf(ubuntu) ExtendedStatus On (Enabling ExtendedStatus consumes additional system resources.) To view the file generated, download Lynx: #yum install lynx Restart httpd

XRDP FOR UBUNTU 14.2

XRDP is lightweight and really easy to install for a remote administrative graphical user interface(GUI) desktop. This is a 2 minute setup for a minimal lightdm desktop manager First update all packages in your ubuntu machine. #apt-get update #apt-get upgrade #tasksel This command will list different packages to install.Install Ubuntu Desktop and GNOME Desktop packages from it. Now install xrdp package  #apt-get install xrdp #apt-get update Install the xfce4 package #apt-get install xfce4 At this stage, you have to configure your Ubuntu machine in order for xrdp to know that the xfce desktop will be used instead of the Unity or Gnome (which are not working anymore in Ubuntu). To configure this, from the terminal console, you will issue the following command #echo xfce4-session >~/.xsession Now start  the xrdp service #service xrdp restart Now using RDP software login to remote system.

ORACLE DB INSTALLATION ON CENTOS

       For oracle database installation we want enough space on our disk and also needed a swap space in our linux system. First Download the Oracle software from oracle site   Unzip the files.  #unzip linux.x64_11gR2_database_1of2.zip Set up the Hosts File The "/etc/hosts" file must contain a fully qualified name for the server.  <IP-address>  <fully-qualified-machine-name>  <machine-name>          #vi /etc/hosts   192.168.0.215   ol7.localdomain  ol7 Set the correct hostname in the "/etc/hostname" file. #vi /etc/hostname ol7.localdomain Add or amend the following lines in the "/etc/sysctl.conf" file. #vi /etc/sysctl.conf fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 1807687680 kernel.shmmni = 4096 # semaphores: semmsl, semmns, semopm, semmni kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default=262144

INSTALLING/UPGRADING/DOWNGRADING PHP ON UBUNTU

        This helps you to install lower or higher versions of php in your ubuntu server other than the default one. If you already have higher version installed on your system and if you need to install lower version, then you have to remove higher version first and remove apt repository from system. INSTALLING PHP 5.6 ON UBUNTU #apt-get install python-software-properties # sudo add-apt-repository ppa:ondrej/php # sudo apt-get update # sudo apt-get install -y php5.6 Check Installed PHP Version: # php -v We can see version of php as 5.6   INSTALLING PHP 7.1 ON UBUNTU #apt-get install python-software-properties #add-apt-repository ppa:ondrej/php #apt-get update #apt-get install -y php7.1 Check Installed PHP Version:  #php -v If you have installed multiple php versions and want to use different than default. Use following steps to switch between php5.6 and php7.1 version. You can use the same command for other php versions.

WORDPRESS ON CENTOS

Wordpress is a free and open-source content management system used for creating websites also to some extend managing them.It is mainly based on php amd mysql. 1.First Create a LAMP setup.For that you can follow instructions in the following link http://www.goserverspace.com/2017/09/lamp-on-centos-68.html 2. We can download Wordpress straight from their website # wget http://wordpress.org/latest.tar.gz Now extract it #tar -xzvf latest.tar.gz 3.Create the WordPress Database and User mysql -u root -p CREATE DATABASE wordpress; CREATE USER 'user'@'localhost' IDENTIFIED BY 'REDhat@1234'; GRANT ALL PRIVILEGES ON wordpress.* TO user@localhost IDENTIFIED BY 'REDhat@1234'; FLUSH PRIVILEGES; Exit 4.Copy the contents to /va r/www/html #cp -r ~/wordpress/* /var/www/html 5.Setup the WordPress Configuration #cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php Open the wp-config.php file.Here we en

MYSQL MASTER SLAVE REPLICATION

MySQL replication is a feature that allows us to maintain multiple copies of a MySQL data and data get automatically copied to slave server. Here Iam using Masters and slave ip as: Master ip : 1.1.1.1 Slave ip : 2.2.2.2 SETUP MYSQL MASTER # yum install mysql-server mysql       [Install it based on centos version] #vi /etc/my.cnf server-id=1 binlog-do-db=databasename relay-log=/var/lib/mysql/mysql-relay-bin relay-log-index=/var/lib/mysql/mysql-relay-bin.index log-error=/var/lib/mysql/mysql.err master-info-file=/var/lib/mysql/mysql-master.info relay-log-info-file=/var/lib/mysql/mysql-relay-log.info log-bin=/var/lib/mysql/mysql-bin #service mysqld restart # mysql -u root -p >GRANT REPLICATION SLAVE ON *.* TO 'replicauser'@'2.2.2.2' IDENTIFIED BY 'replicapass'; >FLUSH PRIVILEGES; >FLUSH TABLES WITH READ LOCK; replicauser = is new MySQL user for replicating purpose. 2.2.2.2 = is Slave IP replicap