How to configure Btrfs on Centos 7

Check unit to add

#fdisk -l

Return:

Exemplo:
Selecione o disco
Disk /dev/sdb: 17.2 GB, 17179869184 bytes, 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Adding partition:

#fdisk /dev/sdb
# M – “Show all options available”
# P – “Type ” p” to display information on the disc as the current partitions”
# n – “Show all options available”
# p – “primary partition”
# 1 – “Partition number 1”
# enter – “default”
# enter – “default”
# w “List unit”

Check unit created

# fdisk -l

Check BTRFS Version and Installation

#yum search btrfs
#yum install btrfs-progs.x86_64

FSTAB access the file and add the mount point and compression

#vim /etc/fstab

Add the following line:

/dev/sdb1 /opt btrfs compress=zlib,compress-force=zlib 1 1

Assembling Compression :

#mkfs.btrfs /dev/sdb1 -f

Restart the machine and starting from this moment the unit / opt ‘ll be using btrfs to compress the files.

Continue Reading

Install Cpanel/WHM on CentOS 7, RHEL 7

Here in this article we will discuss about latest cPanel & WHM Version 11.50 feature and prerequisites and installation on fresh CentOS 7  / RHEL 7 Version.
Latest Features of cPanel  & WHM 11.50 :

CentOS , CloudLinux , and RHEL 7 support
Use the XFS  or ext4 filesystems.
Less booting time
Greylisting feature : which protect server from unwanted emails and untrusted email servers .

Installation Recommended settings:

Disable OS Firewall before installation .
Recommended Hardware :
Minimum & Recommended Processor should be 226MHZ
Minimum RAM should be 1 GB.
Minimum Disk Space should be 20 GB .

Installation of cPanel in CentOS 7 / RHEL 7 / CloudLinux 7 :

Before doing cpanel & WHM installation first ensure your OS Version , RAM and diskspace.

Deactivate firewall on CentOS 7 , CloudLinux 7 and RHEL 7 :

# iptables-save > ~/iptables.rules
# systemctl stop firewalld.service
# systemctl disable firewalld.service

Disable Security Enhanced Features ( SELinux ) :

If your server running SELinux Features of security, then disable this features .

To disable , run the below command.

Edit the configuration file /etc/selinux/config and set the parameter SELINUX to disabled, below is my configuration file , after set the parameter you need to reboot the server.

# vim /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=permissive

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     minimum - Modification of targeted policy. Only selected processes are protected.

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

Installation set up steps :

cPanel installation need perl package , so we need to install perl before instaalation .

# yum install perl

After installation of perl, set the hostname of server , the hostname should be in FQDN i.e fully qualified domain name. Below is steps to set hostname in Centos / RHEL 7.

Below command to check  hostname of server :

# hostnamectl

To set hostname :

#hostnamectl set-hostname cpanel.techtransit.org

Install cPanel/WHM

Now we will download cpanel script on home directory of server ,  which will install cpanel & WHM  .Follow below steps for installation.

# cd /home
# curl -o latest -L https://securedownloads.cpanel.net/latest
# sh latest

Now script will run some hours and after installation you will get some output  like , time taken in installation as well as server access url and access details, you will use in login root as a user and use password of root user.

You will get WHM access like below url.
ACCESS URL:

https://your –server-public-ip:2087/

OR

https://server-hostname:2087/

cpanel_11.50_centos7

cpanel_11.50_centos7

After access of url in browser and put the username password details in access url and accept license agreement, you can configure server networking, ip address and nameserver as according to you , you should have good nice knowledge of System Admin part.

Hope you enjoy this post , for any concern please comment here and give us feedback. Thanks

Continue Reading

Install Guacamole on CentOS 7

This post is for installing the latest version of Guacamole on CentOS 7, as there are several difference from the previous guide I did. If you want to read more about Guacamole, and how awesome it is, I recommend you take a glance at my previous post here.

**Note, I am installing the MySQL Authentication package which allows me to store connections and authentication information in a database, instead of a plain-text XML file.
Let’s Get Started!

1.) prerequisites:

yum -y install epel-release wget
wget -O /etc/yum.repos.d/home:felfert.repo http://download.opensuse.org/repositories/home:/felfert/Fedora_19/home:felfert.repo
yum -y install cairo-devel freerdp-devel gcc java-1.8.0-openjdk.x86_64 libguac libguac-client-rdp libguac-client-ssh libguac-client-vnc \
libjpeg-turbo-devel libpng-devel libssh2-devel libtelnet-devel libvncserver-devel libvorbis-devel libwebp-devel openssl-devel pango-devel \
pulseaudio-libs-devel terminus-fonts tomcat tomcat-admin-webapps tomcat-webapps uuid-devel

Above we are just installing adding the EPEL and Felfert repositories that contain the files we need, and installing all our prereqs. Easy.

2.) guacd install

mkdir ~/guacamole && cd ~/
wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-server-0.9.9.tar.gz
tar -xzf guacamole-server-0.9.9.tar.gz && cd guacamole-server-0.9.9
./configure --with-init-dir=/etc/init.d
make
make install
ldconfig

Guacamole is delivered in two different pieces. The back-end is what we just installed above, from source, called guacd (or guacamole daemon). The other piece is the guacamole client, or web frontend. This is delivered via Jetty, and installed next.

3.) guacamole client

mkdir -p /var/lib/guacamole && cd /var/lib/guacamole/
wget http://sourceforge.net/projects/guacamole/files/current/binary/guacamole-0.9.9.war -O guacamole.war
ln -s /var/lib/guacamole/guacamole.war /var/lib/tomcat/webapps/
rm -rf /usr/lib64/freerdp/guacdr.so
ln -s /usr/local/lib/freerdp/guacdr.so /usr/lib64/freerdp/

We now have the guacamole server daemon and the guacamole client installed. Next up is the MySQL Authentication piece, using MariaDB.

4.) mysql authentication

yum -y install mariadb mariadb-server
mkdir -p ~/guacamole/sqlauth && cd ~/guacamole/sqlauth
wget http://sourceforge.net/projects/guacamole/files/current/extensions/guacamole-auth-jdbc-0.9.9.tar.gz
tar -zxf guacamole-auth-jdbc-0.9.9.tar.gz
wget http://dev.mysql.com/get/Downloads/Connector/j/mysql-connector-java-5.1.38.tar.gz
tar -zxf mysql-connector-java-5.1.38.tar.gz
mkdir -p /usr/share/tomcat/.guacamole/{extensions,lib}
mv guacamole-auth-jdbc-0.9.9/mysql/guacamole-auth-jdbc-mysql-0.9.9.jar /usr/share/tomcat/.guacamole/extensions/
mv mysql-connector-java-5.1.38/mysql-connector-java-5.1.38-bin.jar /usr/share/tomcat/.guacamole/lib/
systemctl restart mariadb.service

The above is installing mariadb, downloading the needed .jar’s, and moving them to where they belong. All but one jar file is included in the Guacamole MySQL Auth download, which is the MySQL Java Connector.

5.) configure database

mysqladmin -u root password MySQLRootPass
mysql -u root -p   # Enter above password
create database guacdb;
create user 'guacuser'@'localhost' identified by 'guacDBpass';
grant select,insert,update,delete on guacdb.* to 'guacuser'@'localhost';
flush privileges;
quit

Here we created the database and user for guacd to use.

6.) extend database schema

cd ~/guacamole/sqlauth/guacamole-auth-jdbc-0.9.9/mysql/schema/
cat ./*.sql | mysql -u root -p guacdb   # Enter SQL root password set above

And here we extend the schema of the database we created.

7.) configure guacamole

mkdir -p /etc/guacamole/ && vi /etc/guacamole/guacamole.properties

The above is creating our needed directories, and then creating the guacamole.properties file. This file is what tomcat uses to know what port to talk to guacd on as well as how to access the database. Here is a basic guacamole.properties file that will do what you need.

# MySQL properties
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacdb
mysql-username: guacuser
mysql-password: guacDBpass

# Additional settings
mysql-default-max-connections-per-user: 0
mysql-default-max-group-connections-per-user: 0

This will configure guacamole to use the database and user that we created on the default port of 4822. Note, this is for internal communication only and is not the port that you will be accessing the web interface on.

And we have to create a symlink so Guacamole can find the config file:

ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat/.guacamole/

8.) Cleanup

All that’s left is a little housecleaning!

cd ~ && rm -rf guacamole*
systemctl enable tomcat.service && systemctl enable mariadb.service && chkconfig guacd on
systemctl reboot

Once your server boots, you’ll have Guacamole running and ready to be used! Head on over to http://guac_server_ip:8080/guacamole to start using your new Guacamole server! default username and password are both ‘guacadmin’.

If you’re having trouble accessing the webpage for Guacamole, make sure you have configured firewalld (or disabled it) to allow access to port 8080.

Leave me some feedback!

Continue Reading

Install Nagios 4.0.4 on Centos 7

For RHEL/CentOS users:

#yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp
#yum install   httpd php  gd gd-devel gcc glibc glibc-common openssl perl perl-devel makesasa

Download Nagios Core and Nagios Plugins Tarballs
For all systems, run the following commands in your terminal:

cd /tmp
#wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.4.tar.gz
#wget http://nagios-plugins.org/download/nagios-plugins-2.0.tar.gz

This will download Nagios Core, and it’s required plugins.
Adding the Nagios User and Group
Next add the appropriate user and group for the Nagios process to run:

#useradd nagios
#groupadd nagcmd
#usermod -a -G nagcmd nagios

Nagios Core Installatiom

#tar zxvf nagios-4.0.4.tar.gz
#tar zxvf nagios-plugins-2.0.tar.gz

Change to the new Nagios directory and install the packages:

#cd nagios-4.0.4
#./configure --with-command-group=nagcmd
#make all
#make install
#make install-init
#make install-config
#make install-commandmode
#make install-webconf
#cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
#chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
#/etc/init.d/nagios start

For RHEL/CentOS users:

#/etc/init.d/httpd start
#systemctl start httpd

Create a Default User for Web Access.
Add a default user for Web Interface Access:

#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Nagios Plugin Installation

#cd /tmp/nagios-plugins-2.0
#./configure --with-nagios-user=nagios --with-nagios-group=nagios
#make
#make install

Nagios Service Setup
The following commands will register the Nagios daemon to be run upon system startup.

chkconfig --add nagios
chkconfig --level 35 nagios on
chkconfig --add httpd
chkconfig --level 35 httpd on

Nagios Web Interface
After correctly following the procedures you should now
be able to access your Nagios Core installation from a
web browser.
Simply use the following:
http://<your.nagios.server.ip>/nagios
And log in with the credentials you chose when adding
the nagiosadmin user to the htpasswd.users file.
Finishing

Continue Reading

Como instalar Splunk 6.3.2 no CentOS Minimal 7.0

Olá amigos, segue um guia de como realizar a instação do Splunk

Efetuar o dowload do pacote de instalação.

#yum update      
#yum install wgetInstalação do Wget

dowloadsplunk

#wget http://download.splunk.com/products/splunk/releases/6.3.2/splunk/linux/splunk-6.3.2-aaff59bb082c.i386.rpm

dowload

Realizar a instalação do pacote .rpm.

#rpm -Uvh “pacote””splunk-6.3.2-aaff59bb082c.i386.rpm”

splunkinstalado

Instalando componentes

#yum -y install glibc.i686

Liberando portas no Firewall

Liberar porta web  tcp 8000, syslog na udp 5514
#firewall-cmd –zone=public –permanent –add-port=8000/tcp
#firewall-cmd –zone=public –permanent –add-port=5514/udp

Forward syslog input to high port for non-root, allow port 80 for http

#firewall-cmd –direct –permanent –add-rule ipv4 nat PREROUTING 0 -p udp -m udp \–dport 514 -j REDIRECT –to-ports 5514
#firewall-cmd –direct –permanent –add-rule ipv4 nat PREROUTING 0 -p tcp -m tcp \–dport 80 -j REDIRECT –to-ports 8000

Reiniciar o firewall
#firewall-cmd –reload

Acessar o Diretorio de inicialização dentro do Splunk /opt/splunk/bin
#./splunk start –accept-license  “Iniciar o Splunk e aceitar todos os termos”
#./splunk enable boot-start        ” Colocar o Splunk na inicialização”.

O Splunk pode ser acessado através da URL http://ipserver:8000/

Splunk

Continue Reading