Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday, 11 September 2016

Install & Configure CSF (Config Server Firewall) on CentOS/RHEL 6x

Install & Configure CSF on CentOS/RHEL 6x


-- Config Server Firewall (or CSF) is a free and advanced firewall for most Linux distributions and Linux based VPS. In Addition to the Basic Functionality of a Firewall – Filtering Packets. CSF includes other security features, such as Login/Intrusion/Flood Detections.

Step: 1. Stop Firewall :

# service iptables stop
# chkconfig iptables off

Step: 2. Disable Selinux :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 3. Reboot the Server :

# init 6

Step: 4. Installation of CFS Dependencies :

# yum -y install wget vim perl perl-libwww-perl.noarch perl-Time-HiRes

Step: 5. Download & Extract CSF Package :

# cd /usr/src/
# wget https://download.configserver.com/csf.tgz
# tar -xzf csf.tgz

Step: 6. Install CFS :

# cd csf
# sh install.sh

Step: 7. Now You should Check that CSG really Works on this Server :

# cd /usr/local/csf/bin/
# perl csftest.pl

[OUTPUT]
RESULT: csf should function on this server.

Step: 8. Configure CSF :

# vi /etc/csf/csf.conf

-- Line No. 11 :

TESTING = "0"

Note: By default CSF Allows Incoming & Outgoing Traffic for the SSH Standard Port 22, if you use a Different SSH Port then please Add your port to the Configuration in line 139 "TCP_IN".

-- Line No. 69 :

RESTRICT_SYSLOG = "3"

-- Save & Quit (:wq)


Step: 9. Start CSF & LFD Service :

# service csf restart
# chkconfig csf on

# service lfd restart
# chkconfig lfd on

Step: 10. To View the list of Default Rules of CSF :

# csf -l
Or
# csf --status

Step: 11. Basic CSF Commands :

-- Start the Firewall (Enable the Firewall Rules) :

# csf -s
Or
# csf --start

-- Flush/Stop the Firewall Rules :

# csf -f
Or
# csf --stop

-- Reload the Firewall Rules :

# csf -f

-- Restart the Firewall Rules :

# csf -r
Or
# csf --restart

-- Allow an IP & Add it to csf.allow :

# csf -a 10.100.97.37
Or
# csf --add 10.100.97.37

-- Remove/Delete an IP from csf.allow :

# csf -ar 10.100.97.37
Or
# csf --addrm 10.100.97.37

-- Deny an IP & Add to csf.deny :

# csf -d 10.100.97.37
Or
# csf --deny 10.100.97.37

-- Remove/Delete an IP from csf.deny :

# csf -dr 10.100.97.37
Or
# csf --denyrm 10.100.97.37

-- Remove & Unblock all Entries from csf.deny :

# csf -df
Or
# csf --denyf

-- Search for a Pattern Match on iptables e.g : IP, CIDR, Port Number :

# csf -g 10.100.97.37
Or
# csf --grep 10.100.97.37

-- Disable CSF & LFD Completely :

# csf -x
Or
# csf --disable

-- Displays the Current List of Temporary Allow & Deny IP Entries with their TTL & Comment :

# csf -t
Or
# csf --temp

-- Add an IP to the Temp IP Allow List :

# csf -ta 10.100.97.37 ttl -p 22 -d 0.0.0.0 Allow All For Port No 22
Or
# csf --tempallow 10.100.97.37 ttl [-p port] [-d direction] [comment]

-- Add an IP to the Temp IP Ban List :

# csf -td 10.100.97.37 ttl -p 22 -d 0.0.0.0 Ban All For Port No 22
Or
# csf --tempdeny 10.100.97.37 ttl [-p port] [-d direction] [comment]

-- Remove an IP From the Temporary IP Ban or Allow List :

# csf -tr 10.100.97.37
Or
# csf --temprm 10.100.97.37

-- Flush all IPs from the Temporary IP Entries :

# csf -tf
Or
# csf --tempf

Step: 12. Advanced CSF Configuration :

# vi /etc/csf/csf.conf

-- Don't Block IP addresses that are in the csf.allow files :

IGNORE_ALLOW = "1"

-- Allow Incoming & Outgoing ICMP. Line No 152 for Incoming & Line 159 for Outgoing :

ICMP_IN = "1"
ICMP_OUT = "1"

-- Block Certain Countries. Go To Line 836 & Add the Country Codes :

CC_DENY = "CN,UK,US"
CC_ALLOW = "ID,IN,DE"

-- Send the Su & SSH Login Logs by Email. Go to the Line No. 1069 :

LF_SSH_EMAIL_ALERT = "1"

LF_SU_EMAIL_ALERT = "1"

-- And then Define the Email Address at Line No. 588 :

LF_ALERT_TO = "koushik@domain.com"

-- Save & Quit (:wq)

Step: 13. Restart CSF & LFD Service :

# service csf restart
# service lfd restart

IMPORTANT NOTES:
=================

-- The Ports Opened by Default are the Following :

TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995"
TCP_OUT = "20,21,22,25,53,80,110,113,443"
UDP_IN = "20,21,53"
UDP_OUT = "20,21,53,113,123"

-- Services using the Open Ports :

Port 20: FTP data transfer
Port 21: FTP control
Port 22: Secure shell (SSH)
Port 25: Simple mail transfer protocol (SMTP)
Port 53: Domain name system (DNS)
Port 80: Hypertext transfer protocol (HTTP)
Port 110: Post office protocol v3 (POP3)
Port 113: Authentication service/identification protocol
Port 123: Network time protocol (NTP)
Port 143: Internet message access protocol (IMAP)
Port 443: Hypertext transfer protocol over SSL/TLS (HTTPS)
Port 465: URL Rendesvous Directory for SSM (Cisco)
Port 587: E-mail message submission (SMTP)
Port 993: Internet message access protocol over SSL (IMAPS)
Port 995: Post office protocol 3 over TLS/SSL (POP3S)

-- Below are Port sets that should be opened if you are Running the Listed Service :

On any Server:

TCP_IN: 22,53
TCP_OUT: 22,53,80,113,443
UPD_IN: 53
UPD_OUT: 53,113,123

Apache:

TCP_IN: 80,443

FTP Server:

TCP_IN: 20,21
TCP_OUT: 20,21
UPD_IN: 20,21
UPD_OUT:20,21

Mail Server:

TCP_IN: 25,110,143,587,993,995
TCP_OUT: 25,110

MySQL Server (if remote access is required):

TCP_IN: 3306
TCP_OUT: 3306

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Saturday, 3 September 2016

How To Install & Configure OpenFire on RHEL/Centos 6x

How To Install & Configure OpenFire on RHEL/Centos 6


Q. What is Openfire?

-- Openfire is an Instant Messaging and Group chat server, written in Java that uses XMPP (Extensible Messaging and Presence Protocol) server. Wikipedia reports, Openfire was previously called as ‘Wildfire‘ and ‘Jive Messenger‘. The Application Software is developed by Jive Software and a community called ‘IgniteRealtime.org‘, and is Licensed under Apache License.

Openfire Features :

- Web Based Admin control
- SSL/TLS support
- LDAP connectivity
- User Friendly
- Platform Independent

Openfire Installation :

Step: 1. Bind Host File :

# vi /etc/hosts

192.168.100.220    ser1.domain.com    ser1

-- Save & Quit (:wq)

Step: 2. Disable Selinux :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# init 6


Step: 3. Install Java ( lastest version is preferred) :

# cd /opt
# wget --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.rpm
   
# yum -y install jdk-8u5-linux-x64.rpm
# yum -y install libldb.i686

Step: 4. Setup Environment Variables :

Setup JAVA_HOME Variable :
   
# export JAVA_HOME=/usr/java/jdk1.8.0_05
# export PATH=$PATH:$JAVA_HOME
# echo $JAVA_HOME

Step: 5. Edit the Java Profile :

# vi /etc/profile.d/java.sh

#!/bin/bash
JAVA_HOME=/usr/java/jdk1.8.0_05
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
export CLASSPATH=.

-- Save & Quit (:wq)

# chmod +x /etc/profile.d/java.sh
# source /etc/profile.d/java.sh

Step: 6. Check Version of JAVA :

# java -version
   
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Client VM (build 25.5-b02, mixed mode)

Step: 7. Install the Openfire Dependencies :

# yum -y install httpd httpd-devel wget
# service httpd restart
# chkconfig httpd on

Step: 8. Download the Openfire RPM using wget Command :

# cd /tmp
# wget http://download.igniterealtime.org/openfire/openfire-3.9.3-1.i386.rpm

Step: 9. Install the OpenFire RPM :

# rpm -Uvh openfire-3.9.3-1.i386.rpm

Step: 10. Once the RPM has been installed, Start the OpenFire service :

# service openfire start

Step: 11. Ensure that OpenFire will boot with your Server :

# chkconfig openfire on

Step: 12. For this instance, you’ll want to make sure iptables is not running, you can Configure the iptables rules how you need them later :

# service iptables stop
# chkconfig iptables off

Step: 13. Install MySQL Server with MySQL Connector :

# yum -y install mysql mysql-server mysql-connector-java

Step: 14. Start MySQL Server :

# service mysqld restart
# chkconfig mysqld on

Step: 15. Set MySQL Root Password :

# mysql_secure_installation

Step: 16. Create Database for OpenFire :

# mysql -u root -predhat

mysql> CREATE DATABASE openfire;
mysql> grant all on openfire.* to openfire@'localhost' identified by 'password';
mysql> grant all on openfire.* to openfire@'%' identified by 'password';
mysql> flush privileges;
mysql> exit

Step: 17. Navigate in your Web Browser To :

Note: If Showing any JAVA Error while Installing the OpenFire through Web Browser then Restart the Server Once.

http://yourip_address:9090

-- Choose Language: (English)
-- Click on "Continue"

-- Server Settings:
     Domain: (127.0.0.1)
     Admin Console Port: (9090)
     Secure Admin Console Port: (9091)

Note: Don't Change Admin Port and Secure Admin Port. Generally you don’t need to change these data, until you need a custom port.

-- Select "Blowfosh"-- Property Encryption Key: (Leave it Blank)
-- Click on "Continue"

-- Database Settings:
-- Select "Standard Database Connection".
-- Click on "Continue"

-- Database Settings - Standard Connection :
     Database Driver Presets: Select MySQL
     Database URL:  jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true
     Username: openfire
     Password: password
     Minimum Connections: 5
     Maximum Connections: 25
-- Click on "Continue"

-- Profile Settings: Select Default
-- Click on "Continue"

-- Administrator Account:
     Admin Email Address: kchatterjee@kminfosystems.com
     New Password: Passw0rd
     Confirm Password: Passw0rd
-- Click on "Continue"

-- Finally Click on "Login to the Admin Console"

Note: Login to Openfire Admin User using username 'admin' and password, the one we set above.

User: admin
Pass: Passw0rd

Step: 18. To Create OpenFire Chat User :

-- Click on Users/Groups (Tabs)
-- Click on Create New User.
-- Fill the User Details.
-- Click on "Create User"'.

Step: 19. Installation of Spark Client :

Download and Install cross platform Spark client for your system using the below link.

http://www.igniterealtime.org/downloads/index.jsp

Once you’ve installed Spark client, open the application and enter username, password and IP addresss of openfire server.

User Name: koushik
Password: Passw0rd
Server IP: 192.168.100.221

-- Check on Save Password.
-- Check on Auto Login
-- Click on Login

Once you logged in you can chat with the users who are online.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.


Sunday, 28 August 2016

How To Take MySQL Database Backup using Shell Script

How To Take MySQL Database Backup using Shell Script


Step: 1. First We need to Create the Following Directory Structure :

# mkdir -p /Backups/DB_backups
# mkdir /Backups/scripts

Step: 2. Create a Read-Only MySQL User Called "backupoperator" :

Note: Don't use "root" user.

-- Make Sure You have given the Right Privileges to "backupoperator" to take Backup.

# mysql -u root -p
Enter the Password:

mysql> grant select on *.* to backupoperator@localhost identified by 'backupoperator_password';
mysql> flush privileges;
mysql> quit

Step: 3. Creating MySQL Database Backup Shell  Script under "scripts" Directory :

Note: Backup Retention is 3 days. 3 days older file will deleted automatically.

# vi /Backups/scripts/mysql_backup_script.sh

-- Paste the Below Codes :

#!/bin/bash
export path1=/Backups/DB_backups
date1=`date +%y%m%d_%H%M%S`
# Set Backup Retention. Here Backup Retention is 3 days.
/usr/bin/find $path1/* -type d -mtime +3 -exec rm -r {} \; 2> /dev/null
cd $path1/
mkdir $date1
USER="backupoperator"
PASSWORD="backupoperator_password"
OUTPUTDIR="$path1/$date1"
MYSQLDUMP="/usr/bin/mysqldump"
MYSQL="/usr/bin/mysql"
databases=`$MYSQL --user=$USER --password=$PASSWORD \
 -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`
echo "` for db in $databases; do
    echo $db
if [ "$db" = "performance_schema" ] ; then
       $MYSQLDUMP --force --opt --single-transaction --lock-tables=false --skip-events  --user=$USER --password=$PASSWORD \
    --databases --routines $db > "$OUTPUTDIR/$db.sql"
         else
$MYSQLDUMP --force --opt --single-transaction --lock-tables=false --events  --user=$USER --password=$PASSWORD \
    --databases --routines $db > "$OUTPUTDIR/$db.sql"
fi
done `" 2> /Backups/Logs/error_$date1.log

-- Save & Quit (:wq)

Step: 4. Now, Give the Executable Permission :

# chmod 755 /Backups/scripts/mysql_backup_script.sh

Step: 5. To Execute the Script :

# cd /Backups/scripts/
# ./mysql_backup_script.sh

Step: 6. Schedule in Crontab :

# crontab -e

30 2 * * * /Backups/scripts/mysql_backup_script.sh > /dev/null

-- Save & Quit (:wq)

Note: It will take backup automatically every day at 2:30 AM.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog


Friday, 26 August 2016

Install & Configure Help Desk System Using OTRS On CentOS/RHEL 6x

Install & Configure Help Desk System Using OTRS On CentOS/RHEL 6x


Q. What is OTRS ?

-- OTRS is one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management. With a fast implementation and easy customization to your needs it helps you reducing costs and increasing the efficiency and transparency of your business communication.

Step: 1. Bind Host File :

# vi /etc/hosts

10.100.99.13    ser3.domain.com    ser3

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Firewall :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Note: If Iptables service is on, then Adjust iptables to allow Apache Default Port 80.

# vi /etc/sysconfig/iptables

Add the Following Line in Filter Table :

-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

-- Save & Quit (:wq)

# service iptables restart

Step: 3. Reboot the System :

# init 6

Step: 4. Install EPEL Repository :

# yum -y install epel-release

Step: 5. Install MySQL Server :

# yum -y install mysql mysql-server

Step: 6. Start MySQL Service & Set MySQL Root Password :

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 7. To Change Engine MyISM to InnoDB & Restart MySQL Service :

# vi /etc/my.cnf

-- Add the Following Lines under the [mysqld] Section :

max_allowed_packet=20M
query_cache_size=32M
innodb_log_file_size = 500M
default-storage-engine = InnoDB

-- Save & Quit (:wq)

# service mysqld stop
# mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0.bak
# mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/ib_logfile1.bak

# service mysqld restart

Step: 8. Create Database For OTRS :

# mysql -u root -p
Enter Password:

mysql> create database otrsdb;
mysql> grant all privileges on otrsdb.* to otrsuser@localhost identified by 'password';
mysql> flush privileges;
mysql> \q

Step: 9. Install Apache Web Server :

# yum -y install httpd httpd-devel wget

Step: 10. Start Apache Service :

# service httpd restart
# chkconfig httpd on

Step: 11. Download & Install OTRS RPM Package :

# cd /mnt
# wget http://ftp.otrs.org/pub/otrs/RPMS/rhel/6/otrs-5.0.10-01.noarch.rpm
# yum -y install otrs-5.0.10-01.noarch.rpm

Step: 12. Restart Apache Service :

# service httpd restart

Step: 13. Install Additional PERL Modules :

# /opt/otrs/bin/otrs.CheckModules.pl

# yum -y install "perl(Crypt::Eksblowfish::Bcrypt)" "perl(DBD::ODBC)" "perl(DBD::Pg)" "perl(Encode::HanExtra)" "perl(GD)" "perl(GD::Text)" "perl(GD::Graph)" "perl(JSON::XS)" "perl(Mail::IMAPClient)" "perl(PDF::API2)" "perl(Text::CSV_XS)" "perl(YAML::XS)"

# /opt/otrs/bin/otrs.CheckModules.pl

Step: 14. Now Install OTRS Through Web Browser :

http://10.100.99.13/otrs/installer.pl

-- Click on "Next".
-- Click on "Accept License & Continue".
-- Database Selection:
     Type: MySQL
     Install Type: Use an existing database for OTRS

-- Click on "Next".
-- Configure MySQL:
     User: otrsuser
     Password: password
     Host: 127.0.0.1
     Database Name: otrsdb
-- Click on "Check Database Settings".
-- Click on "Next".
-- Click on "Next".
-- System Settings:
     AdminEmail: koushik@domain.com
     Organization: Your Organization
-- Click on "Next".
-- Mail Configuration: For Now Skip this Step.

Step: 15. Now Login OTRS Admin Panel :

http://10.100.99.13/otrs/index.pl

User: root@localhost
Password: LvMiOnXJAu2U7Vg6

-- Click on "Login".

Step: 16. To Resolve OTRS Daemon is not running, Do the Following :

# useradd otrs
# chmod -Rf 777 /opt/otrs/Kernel/Config/Files/
# su - otrs
$ /opt/otrs/bin/otrs.Daemon.pl start
$ /opt/otrs/bin/Cron.sh start

Step: 17. To Change Admin Password :

http://10.100.99.13/otrs/index.pl

User: root@localhost
Password: LvMiOnXJAu2U7Vg6

-- Click on "Edit Personal Peferences"
-- Change Password:
     Current password: LvMiOnXJAu2U7Vg6
     New Password: Passw0rd@123
     Verify Password: Passw0rd@123
-- Click on "Update".

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog


Friday, 19 August 2016

How To Create a Wireless Hosted Network in Windows 10

Wireless Hosted Network

-- Hosted Network is a feature that comes included with the Netsh (Network Shell) command-line utility. It's was previously introduced in Windows 7, and it allows you to use the operating system to create a virtual wireless adapter.

This method does not require you to Download any third-party Application. You can easily set up a Wi-Fi hotspot using the built-in tools in Windows.

Step: 1. Open Command Prompt with Administrator Privileges :

How To Create a Wireless Hosted Network in Windows 10























Step: 2. Check if your Wireless Adapter Supports Hosted Networks in Windows 10 :

Type the below Command :

C:\WINDOWS\system32> netsh wlan show drivers

How To Create a Wireless Hosted Network in Windows 10
Step: 3. Create a Wireless Hosted Network :

Type the below Command :

C:\WINDOWS\system32> netsh wlan set hostednetwork mode=allow ssid=MySSID key=Passw0rd
C:\WINDOWS\system32> netsh wlan start hostednetwork

How To Create a Wireless Hosted Network in Windows 10


















Step: 4. Share your Internet Connection with a Hosted Network :

-- Right Click on "Network Adapter"
-- Click on "Open Network and Sharing Center"

How To Create a Wireless Hosted Network in Windows 10

Note: In Network Connections, you should see a new Microsoft Hosted Virtual Adapter which is labeled Local Area Connection* X.

How To Create a Wireless Hosted Network in Windows 10

-- Right Click on "Ethernet" 
-- Click on "Properties"

How To Create a Wireless Hosted Network in Windows 10

-- Click the "Sharing" tab

-- Check "Allow other Network users to Connect through this Computer's Internet 
    Connection" option.

-- Next, from the "Home Networking Connection" drop-down menu select the "Microsoft 
    Hosted Virtual Adapter".

-- Click "OK" to Finish.
 
How To Create a Wireless Hosted Network in Windows 10
 
Now, You’ll have a brand new Wi-Fi Network that’s connected to your home internet.

How To Create a Wireless Hosted Network in Windows 10
Step: 5. Now Connect Any Wireless Capable Device to the newly Created Access Point :

How To Create a Wireless Hosted Network in Windows 10




















Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 

Sunday, 14 August 2016

How To Reset MySQL Root Password in CentOS/RHEL & Ubuntu

How To Reset MySQL Root Password in  CentOS/RHEL & Ubuntu


For CentOS/RHEL User :

Step: 1. Stop MySQL Service :

# service mysqld stop

Step: 2. Start to MySQL Server without Password :

# mysqld_safe --skip-grant-tables &

Step: 3. Connect to MySQL Server using MySQL Client :

# mysql -u root

mysql> use mysql;
mysql> update user set password=PASSWORD("new_password") where User='root';
mysql> flush privileges;
mysql> quit

Step: 4. Stop the MySQL Server Again :

# service mysqld stop

Step: 5. Start MySQL Server Normally & Test it :

# service mysqld restart
# chkconfig mysqld on

# mysql -u root -p
Enter Password:

For Debian/Ubuntu User :

$ sudo dpkg-reconfigure mysql-server-5.5
--  Give New Password.


Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Sunday, 7 August 2016

Install & Configure CVS (Concurrent Versions System) on RHEL/CentOS 6x

Install & Configure CVS (Concurrent Versions System) on RHEL/CentOS 6x


Q. What is CVS ?

-- The Concurrent Versions System (CVS), also known as the Concurrent Versioning System. CVS can be used for source or content control in the field of software development.

Step: 1. Install CVS :

# yum -y install cvs*

Step: 2. Verify CVS :

# cvs -v
Concurrent Versions System (CVS) 1.11.23 (client/server)

Step: 3. Initialize the CVS Repository :

# cvs -d /home/cvs/project1 init

Note: Once initialized, you’ll see CVSROOT directory created under the CVS repository.

Step: 4. Make some initial Changes before Starting the CVS Server :

# vi /etc/xinetd.d/cvs

service cvspserver
{
        disable                 = no
        port                       = 2401
        socket_type      = stream
        protocol              = tcp
        wait                       = no
        user                       = root
        passenv               = PATH
        server                   = /usr/bin/cvs
        env                         = HOME=/home/cvs
        server_args       = -f --allow-root=/home/cvs/project1 pserver
        bind                       = 192.168.72.220
}

-- Save & Quit (:wq)

Step: 5. Restart the xinetd Services :

# service xinetd restart
# chkconfig xinetd on

Step: 6. Verify that the Service is Running & Listening :

# netstat -ntlp | grep 2401

tcp     0   0   192.168.72.220:2401      0.0.0.0:*   LISTEN      18337/xinetd

Step: 7. Create CVS User & Groups :

# useradd cvs
# passwd cvs

Step: 8. Create CVS Repository Directory :

# cd /home/cvs
# mkdir project1

# chmod -Rf 775 /home/cvs/project1
# chown -Rf cvs:cvs /home/cvs/project1

Step: 9. Client login into CVS server :

# cvs -d :pserver:cvs@192.168.72.220:/home/cvs/project1 login

Another Way to Login :

# export CVSROOT=:pserver:cvs@192.168.72.220:/home/cvs/project1

# cvs login
Logging in to :pserver:cvs@192.168.72.220:/home/cvs/project1
CVS password:


Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 

Sunday, 31 July 2016

How To Install & Configure x11vnc Server on Ubuntu 14.04

Install & Configure x11vnc Server on Ubuntu

Q. What is VNC?

-- Virtual Network Computing (VNC) is a graphical desktop sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer.

Step: 1. Update the System :

# apt-get update

Step: 2. Install VNC :

# apt-get -y install x11vnc

Step: 3. Create VNC Password & Save the Password to /etc/x11vnc.pass :

# x11vnc -storepasswd password /etc/x11vnc.pass 

(Here vnc password will be password)

Step: 4. Make the x11vnc Service Starting at Boot Time :

# vi /etc/init/x11vnc.conf

start on login-session-start
script
/usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /var/log/x11vnc.log
end script

-- Save & Quit (:wq)

Step: 5. Run this Command to Start the x11vnc without Reboot :

# /usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /var/log/x11vnc.log

Step: 6. Install VNC viewer & Connect the Server :


https://www.realvnc.com/download/viewer/ 

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 

Saturday, 23 July 2016

How To Install & Configure Monitorix on CentOS/RHEL 6x

Install & Configure Monitorix on CentOS/RHEL 6x

About Monitorix:

-- Monitorix is a free, open source, lightweight system monitoring tool designed to monitor as many services and system resources as possible. It has been created to be used under production Linux/UNIX servers, but due to its simplicity and small size can be used on embedded devices as well.

Step: 1. Bind Host File :

# vi /etc/hosts

10.100.100.100    monitor.domain.com    monitor

-- Save & Quit (:wq)

Step: 2. Stop Firewall & Disable Selinux :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=enforing to disabled

-- Save & Quit (:wq)

Step: 3. Reboot the System :

# init 6

or

# reboot

Step: 4. Install EPEL Repository :

# yum -y install epel-release

Step: 5. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 6. Install  the Required Packages :

# yum -y install rrdtool perl rrdtool-perl perl-libwww-perl perl-MailTools perl-MIME-Lite \
   perl-CGI perl-DBI  perl-XML-Simple perl-Config-General perl-HTTP-Server-Simple \
   perl-IO-Socket-SSL wget

Step: 7. Download & Install the Monitorix Package :

# cd /mnt
# wget http://www.monitorix.org/monitorix-3.8.1-1.noarch.rpm
# yum -y install monitorix-3.8.1-1.noarch.rpm

Step: 8. Start Apache & Monitorix Service :

# service httpd restart
# service monitorix start

# chkconfig httpd on
# chkconfig monitorix on

Step: 9. Edit the Monitorix Configure file :

# vi /etc/httpd/conf.d/monitorix.conf

Alias /monitorix /usr/share/monitorix
ScriptAlias /monitorix-cgi /usr/share/monitorix/cgi-bin

<Directory /usr/share/monitorix/cgi/>
DirectoryIndex monitorix.cgi
Options ExecCGI
order deny,allow
deny from all
allow from all       # Alllow connect from the outside
</Directory>

# Apache rules to restrict access to Monitorix:
# Don’t forget to add <username> in .htpasswd with the 'htpasswd' command.

# Uncomment these lines
<Directory "/usr/share/monitorix">
Options Indexes Includes FollowSymLinks
Order Deny,Allow
Deny from All
allow from all        # Alllow connect from the outside
AllowOverride None
AuthUserFile /etc/httpd/conf/.htpasswd
AuthGroupFile /dev/null
AuthName "Monitorix: Restricted Access..., sorry."

AuthType Basic
Require user <username>
Satisfy Any
</Directory>

-- Save & Quit (:wq)

Step: 10. Set Password For Monitorix Web Panel :

# htpasswd -cm /etc/httpd/conf/.htpasswd monitoradmin
Enter the Password: Password@123

Step: 11. Retart the Apache Service :

# service httpd restart

Step: 12. Connect Monitorix via Web Browser :

http://10.100.100.100/monitorix
User: monitoradmin
Pass: Password@123

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Monday, 18 July 2016

How To Install & Configure Bamboo on CentOS/RHEL 6.x

Install & Configure Bamboo on CentOS/RHEL 6.x


Q. What is Bamboo Server ?
-- Bamboo is a continuous integration (CI) server that can be used to automate the release management for a software application, creating a continuous delivery pipeline.

Bamboo


Requirements :
===========
1. Centos 6.x
2. Apache
3. Java
4. Bamboo License


Note: Get a Bamboo Server License from https://id.atlassian.com/login?application=mac&continue=https://my.atlassian.com. Create a Account here and Get the License Key (Valid for 30 Days)

Step: 1. Stop the IPTables & Disable Selinux :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 2. Update the Date & Time on the Server :

# yum -y install ntp
# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on
# init 6

Step: 3. Bind Hosts File :

# vi /etc/hosts

192.168.72.220    bamboo.domain.com    bamboo

-- Save & Quit (:wq)

Step: 4. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 5. Configure Virtual Host for Bamboo :

# vi /etc/httpd/conf/httpd.conf

-- Changes the Following Lines :

# Line Number 44 - change from OS
ServerTokens Prod

# Line Number 76 - change to ON
KeepAlive On

# Line Number 338 change from None
AllowOverride All

# Line Number 402 add file name that it can access only with directory's name
DirectoryIndex index.html index.htm

# Line Number 536 change from On
ServerSignature Off

# Line Number 759 comment out
# AddDefaultCharset UTF-8

# Add at last of the file
RewriteEngine on
CheckCaseOnly On

-- Save & Quit (:wq)

# vi /etc/httpd/conf.d/bamboo.domain.com.conf

<VirtualHost *:80>
    ServerName bamboo.domain.com

    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy *>
        Order Deny,Allow
        Allow from all
    </Proxy>

    ProxyPass / http://localhost:8085/
    ProxyPassReverse / http://localhost:8085/

    <Location /bamboo>
        Order Allow,Deny
        Allow from all
    </Location>
</VirtualHost>

-- Save & Quit (:wq)

# cd /var/www/html
# vi index.html

<html>
<head>
    <title>Restricted Zone...!!!</title>
</head>
<body>
    <p>Restricted Zone...!!!</p>
</body>
</html>

-- Save & Quit (:wq)

Step: 6. Install & Configure Java :

# cd /opt
# wget http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u73-linux-x64.tar.gz
# alternatives --install /usr/bin/java java /opt/jdk1.8.7/bin/java 2
# alternatives --config java

There may Be more that 1 programs which provide 'java'. Select the version Which is downloaded.

Selection    Command
-----------------------------------------------
*  1           /opt/jdk1.7.0_71/bin/java
 + 2           /opt/jdk1.8.0_45/bin/java
   3           /opt/jdk1.8.7/bin/java
  
Enter to keep the current selection[+], or type selection number: 3

# vi /etc/profile.d/java.sh

#!/bin/bash
JAVA_HOME=/opt/jdk-9/
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
export CLASSPATH=.

-- Save & Quit (:wq)

# export JAVA_HOME=/opt/jdk1.8.7/
# chmod 755 /etc/profile.d/java.sh
# source /etc/profile.d/java.sh

Step: 7. Download & Install Bamboo :

# cd /opt
# wget https://downloads.atlassian.com/software/bamboo/downloads/atlassian-bamboo-5.10.1.1.tar.gz
# tar -zxvf atlassian-bamboo-5.10.1.1.tar.gz
# mv atlassian-bamboo-5.10.1.1 bamboo
# cd bamboo
# vi /opt/bamboo/atlassian-bamboo/WEB-INF/classes/bamboo-init.properties

-- Add this Line :

bamboo.home=/opt/bamboo

-- Save & Quit (:wq)

# sh /opt/bamboo/bin/start-bamboo.sh

Step: 8. Browse bamboo.domain.com (Bind the Site Address to your pc's Host File) :

http://bamboo.domain.com

Give the License Key & Follow with the Express Installation Instructions.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Saturday, 9 July 2016

How To Install & Use Of PostgreSQL on Ubuntu 14.04

Install & Use Of PostgreSQL on Ubuntu 14.04

Q. What is PostgreSQL ?

-- PostgreSQL, or Postgres, is a relational database management system that provides an implementation of the SQL querying language. It is a popular choice for many small and large projects and has the advantage of being standards-compliant and having many advanced features like reliable transactions and concurrency without read locks.

Step: 1. Install PostgreSQL :
   
# apt-get updat
# apt-get -y upgrade
# apt-get install postgresql postgresql-contrib
# vi /etc/postgresql/9.3/main/pg_hba.conf
   
Step: 2. Edit on line 90 & 92 to make sure the file has :

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust

-- Save & Quit (:wq)
       
# sudo /etc/init.d/postgresql restart
   
Step: 3. Login to postgres :

# sudo -i -u postgres

Step: 4. Set a password for the "postgres" Database role using the Command :

postgres=# \password postgres

Step: 5. To Create a  User :

postgres=# CREATE USER koushik WITH password 'redhat';
CREATE ROLE

Step: 6. To Create a Database :

postgres=# CREATE DATABASE mydb WITH OWNER koushik;
CREATE DATABASE

Step: 7. List of the Database present on the Server :

postgres=# \l

Step: 8. To See all Databases :

postgres=# \l
                                  
PostgreSQL
Step: 9. To Select a Database :

postgres=# \connect mydb

Step: 10. To Create a Table :

postgres=# CREATE TABLE COMPANY(
   ID INT PRIMARY KEY     NOT NULL,
   NAME           TEXT    NOT NULL,
   AGE            INT     NOT NULL,
   ADDRESS        CHAR(50),
   SALARY         REAL
);

Step: 11. To view Created Tables :

postgres=# \d

PostgreSQL













Step: 12. Change the Owner of the Table :

postgres=# \connect mydb

mydb=# ALTER TABLE blocks OWNER to koushik;


From the psql Command line Interface :

mydb=# \dt

Step: 13. Drop Database :

postgres@ser4:~$ psql
postgres=# DROP DATABASE mydb;
                            
Step: 14. Restoring the dump Backup of SQL :
   
# sudo -i -u postgres
   
$ psql database_name < /data/backup.sql
   
From Linux/Debian Terminal without login to postgres :

Step: 15. To Create a Database with a User that have full rights on the Database, use the Following Command :

# sudo -u postgres createuser -D -A -P koushik

# sudo -u postgres createdb -O koushik mydb

Note: The first command line creates the user with no database creation rights (-D) with no add user rights -A) and will prompt you for entering a password (-P). The second command line create the database 'mydb with 'koushik' as owner.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Copyright © 2016 Kousik Chatterjee's Blog