Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday, 4 December 2016

How to Configure WaypointHR on RHEL/Centos 6x

How to Configure WaypointHR on RHEL/Centos 6x


Q. What is WaypointHR?
 
-- WaypointHR provides a flexible Human Resource Information System (HRIS) developed by HR-Fundamentals ltd. Managing employee records and personal information - WaypointHR. It is an HR database that features a PHP based web-interface and a MySQL database. Effective management reports and ease of use are the major focus of this HR software. WaypointHR is available in two version the free one and On-Demand.

Requirements :

1. MySQL 4.1 or MySQL 5.
2. PHP 5.
3. MySQLi & InnoDB recommended.

Step: 1. Bind Hosts File :

# vi /etc/hosts

192.168.100.220 hr.domain.com    hr

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Iptables :

 # vi /etc/sysconfig/selinux

 SELINUX=disabled

 -- Save & Quit (:wq)
 
# service iptables stop
# chkconfig iptables off

# init 6

Step: 3. Install EPEL Repo :

# cd /tmp
# wget wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
Or
# yum -y install epel-release


Step: 4. Install Apache Server :


# yum -y install httpd httpd-devel wget

Step: 5. Restart Apache Service :

# service httpd restart
# chkconfig httpd on

Step: 6. Install MySQL Database Server :

# yum -y install mysql mysql-server mysql-devel

Step: 7. Start Mysql Service :

# service mysqld restart
# chkconfig mysqld on

Step: 8. Set Mysql Root Password :

# mysql_secure_installation

Step: 9. Install PHP5 Scripting Language :

# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel \
    php-xml php-imap php-ldap php-mbstring php-odbc php-pear php-xmlrpc php-soap mod_ssl

Step: 10. Create Database For WaypointHR :

# mysql -u root -p
Enter Password:

mysql> create database waypoint;
mysql> grant all on waypoint.* to waypoint@'localhost' identified by 'redhat123G';
mysql> grant all on waypoint.* to waypoint@'%' identified by 'redhat123G';
mysql> flush privileges;
mysql> exit

Step: 11. Download WaypointHR Tar File :

# cd /var/www/html
# wget http://kaz.dl.sourceforge.net/project/waypointhr/waypointhr/0.3_Alpha_5/WaypointHR_Release_0.3_Alpha_5.tar.gz
# tar -zxvf WaypointHR_Release_0.3_Alpha_5.tar.gz

Step: 12. Configure WaypointHR for Apache :


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

<Directory /var/www/html/waypointhr>
        Options -Indexes +Multiviews +FollowSymLinks
        DirectoryIndex index.php index.html
        AllowOverride All
        Allow from all
</Directory>

-- Save & Quit (:wq)

Step: 13. Restart httpd Service :

# service httpd restart

Step: 14. Point Your Web Browser :

http://192.168.100.220/waypointhr

-- Click on Continue with Installation.
-- Click on Continue with Installation.
-- Database Creation :
     Server name: localhost
     Server port: 3306
     Schema: waypoint
     Table prefix: whr_
     Username: waypoint
     Password: redhat123G

-- Finally Click on Create Database.

-- Click on 'Click Here'

Username: admin
Password: admin

Note: By default username: admin, pass: admin

Step: 15. Reset WaypointHR Admin Password :

# cd /var/www/html/waypointhr/
# vi reset.php

Find this Line:

// reset_admin_password('newpassword');

Delete // and Set you admin password.

reset_admin_password('Passw0rd');

-- Save & Quit (:wq)

Now Open Your Web Browser & Type :

http://192.168.100.220/waypointhr/reset.php

Your admin password has been reset. Please edit the reset.php file the return to WaypointHR login as normal.

# vi reset.php

Find this Line:
reset_admin_password('Passw0rd');

and Change To :

// reset_admin_password('newpassword');

-- Save & Quit (:wq)

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

Saturday, 19 November 2016

How to Install & Configure PXE Boot Server on CentOS/RHEL 6x

How to Install & Configure PXE Boot Server on CentOS/RHEL 6x


Q. What is PXE Boot Server ?

-- PXE Server, stands for preboot Execution Environment, is used to Enable a Network Computer to boot only from a Network interface card.

PXE Environment needs Following Services :

1. DHCP server that distributes the IP addresses to the client systems.
2. TFTP Server which makes bootable images available to be downloaded via network using
    Trivial File Transfer Protocol (TFTP).
3. Syslinux package which provides bootloaders for network booting.
4. http/ftp (any one) which will host the local mounted mirrored DVD (RHEL/CentOS6) image,
    from where the installer will extract its required packages.

PXE Server Details :

OS: CentOS 6.5 Minimal Installation
IP Address: 192.168.1.52/24
Hostname: pxe.domain.com
SELinux Disabled on PXE Server
IPtables Stopped on PXE Server

Step: 1. Bind Hosts File :

# vi /etc/hosts

192.168.1.50    pxe.domain.com    pxe

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Firewall :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Reboot the System :

# init 6

Step: 4. Install DHCP-Server, SYSLINUX Bootloaders, TFTP-Server, Web-Server 
                 (Apache httpd),  FTP-Server (Optional) :

# yum -y install dhcp tftp-server syslinux http ftp vsftpd

Step: 5. Configure HTTP/FTP Server :

# mkdir /var/lib/tftpboot/centos6
# mount -o loop /tmp/CentOS-6.iso /var/lib/tftpboot/centos6

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

Alias /centos6 /var/lib/tftpboot/centos6
<Directory /var/lib/tftpboot/centos6>
      Options Indexes FollowSymLinks
          Order Allow,Deny
          Allow from all
</Directory>

-- Save & Quit (:wq)

# service httpd start
# chkconfig httpd on

Step: 6. Manually Browse to the Server IP & Verify if you can see all the Files :

http://192.168.1.50/centos6/

Step: 7. Enable the tftp Service in Xinetd :

# cp -r /usr/share/syslinux/* /var/lib/tftpboot/
# vi /etc/xinetd.d/tftp

service tftp
{
    socket_type       = dgram
    protocol               = udp
    wait                        = yes
    user                        = root
    server                    = /usr/sbin/in.tftpd
    server_args        = -s /var/lib/tftpboot
    disable                 = no
    per_source         = 11
    cps                          = 100 2
    flags                      = IPv4
}

-- Save & Quit (:wq)

# service xinetd start
# chkconfig xinetd on

Step: 8. Configure PXE Boot Server :

# mkdir /var/lib/tftpboot/pxelinux.cfg
# vi /var/lib/tftpboot/pxelinux.cfg/default

default menu.c32
prompt 0
timeout 300
ONTIMEOUT local
menu title ########## PXE Boot Menu ##########
label 1
menu label ^1) Install CentOS 6 Edition
kernel centos6/images/pxeboot/vmlinuz
append initrd=centos6/images/pxeboot/initrd.img method=http://192.168.1.52/centos6 devfs=nomount
label 2
menu label ^2) Boot from local drive localboot

-- Save & Quit (:wq)

Step: 9. Configure DHCP Server :

# vi /etc/sysconfig/dhcpd

DHCPDARGS=eth0

-- Save & Quit (:wq)

# vi /etc/dhcp/dhcpd.conf

option domain-name "pxe.domain.com";
option domain-name-servers 192.168.1.1, 8.8.8.8;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;

subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.240 192.168.1.254;
    option routers 192.168.1.1;
    option broadcast-address 192.168.1.255;
}
allow booting;
    allow bootp;
    next-server 192.168.1.50;            # PXE Server IP Address.
    filename "pxelinux.0";

-- Save & Quit (:wq)

# service dhcpd restart
# service xinetd restart
# service httpd restart

# chkconfig dhcpd on
# chkconfig xinetd on

Note:

KERNEL - Defines the location from where the PXELINUX bootloader will load.
APPEND - Defines the location for PXE initrd image file to load.
FTP Server - There is not much Change for ftp server just replace the below line in the above file.

APPEND initrd=centos6/images/pxeboot/initrd.img method=ftp://192.168.1.6/centos6/ devfs=nomount


# mkdir /var/lib/tftpboot/centos6
OR
# mkdir /var/ftp/pub/centos6

# vi /etc/vsftpd/vsftpd.conf

anonymous_enable=YES
anon_root=/var/lib/tftpboot/centos6 # Specify the path

-- Save & Quit (:wq)

# service vsfptd restart
# chkconfig vsftpd on

ftp://192.168.1.50/centos6/

Step: 10. PXE Client Configuration :

The Client may be any System that has Network boot Enabled Option (PXE boot). You can Enable this Option in your BIOS Settings. That’s it. Now, power on the Virtual client system.

Once you have Reached PXE Menu, Choose your CentOS 6 Installation Type, hit Enter key & Continue with the Installation Procedure the same way as you might Install it from a Local Media Boot Device.

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


Sunday, 13 November 2016

Install & Configure IT Operational Portal Using iTop On RHEL/CentOS 6x

Install & Configure IT Operational Portal Using iTop On RHEL/CentOS 6x


Q. What is iTop?

-- iTop, stands for IT Operational Portal, is an Open Source web based application for the day to day operations of an IT environment. iTop was designed with the ITIL best practices in mind but does not dictate any specific process, the application is flexible enough to adapt to your processes whether you want rather informal and pragmatic processes or a strict ITIL aligned behaviour.

  • Using iTop you can :
- Document your entire IT infrastructure assets such as servers, applications, network devices,
   virtual machines, contacts.. etc.
- Manage incidents, user requests, planned outages.
- Document IT services and contracts with external providers including service level agreements.
- Export all the information in a manual or scripted manner.
- Import or synchronize/federate any data from external systems.

  • Features :
- Fully configurable CMDB.
- HelpDesk and Incident Management.
- Service and Contract Management.
- Change Management.
- Configuration Management.
- Automatic SLA management.
- Automatic impact analysis.
- CSV import tool for all data.
- Consistency audit to check data quality.
- Data synchronization (data federation).

Configuration :

Step: 1. Install EPEL Repo :

# yum -y install epel-release

Step: 2. Install Apache Server :

# yum -y install httpd httpd-devel mod_ssl wget

Step: 3. Start Apache Server :

# service httpd restart
# chkconfig httpd on

Step: 4. Install Mysql Server :

# yum -y install mysql mysql-server mysql-devel

Step: 5. Set MySQL Root Password :

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 6. Install PHP5 Scripting Language :


# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel \
   php-xml php-imap php-ldap php-mbstring php-odbc php-pear php-xmlrpc php-soap \
   php-cli graphviz

Step: 7. We need to Adjust the following PHP Settings :

# vi /etc/php.ini

post_max_size = 32M

-- Save & Quit (:wq)

Step: 8. Restart Apache Server To Load the New Configuration :

# service httpd restart

Step: 9. Download & Install iTop :

# yum -y install zip unzip
# cd /var/www/html
# wget http://sourceforge.net/projects/itop/files/itop/2.0.2/iTop-2.0.2-1476.zip
# unzip iTop-2.0.2-1476.zip
# mv web itop
# rm -rf iTop-2.0.2-1476.zip INSTALL LICENSE README

Step: 10. Create the following Directory & Make them to be Writable :

# mkdir /var/www/html/itop/conf
# mkdir /var/www/html/itop/data
# mkdir /var/www/html/itop/env-production
# mkdir /var/www/html/itop/log
# chmod 777 /var/www/html/itop/conf/
# chmod 777 /var/www/html/itop/data
# chmod 777 /var/www/html/itop/env-production/
# chmod 777 /var/www/html/itop/log

Step: 11. Finally, Install iTop Using Web Browser :

http://Server_ip_address/itop

-- Click on "Continue"
-- Select "Install a New iTOP"
-- Click on "Next"
-- I Accept the Agreement.
-- Click Next
-- MySQL Sever Details :
     Server Name: localhost,
     Login: root,
     Password: redhat

Database :

Select Create a new Database: itopdb
-- Click Next.

Administrator Account :

Login: admin
Password: Passw0rd
Confirm password: Passw0rd

-- Language: English
-- Click Next.

Sample Data :

If you directly use it in production environment, then select the second option and Click Next. I want to populate my database with some demo data’s, so checked the first option.

-- Click Next.
-- Click Next.
-- Select "Service Management for Enterprises"
-- Click Next.
-- Select "ITIL Compliant Tickets Management" & Check 'User Request Management' &  
     'Incident Management'
-- Then Click Next
-- Select "ITIL Change Management"
-- Click Next.
-- Check Both Option 'Known Errors Management' & 'Problem Management'
-- Click Next.
-- Click Install.
-- Finally Click on Enter iTop.

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

Saturday, 5 November 2016

Install & Configure Joomla on CentOS/RHEL 6x

Install & Configure Joomla on CentOS/RHEL 6x


Q. What is Joomla?

-- Joomla is a popular Open Source Content Management System (CMS) tool which allows us to easily build dynamic website and manage online applications. It also manage & publish your website contents like video, pictures, articles on the website. Joomla is freely available, which supports huge third party plug-ins and themes. With the help of Content Management System (CMS), you can set up websites in the World Wide Web (WWW) without having knowledge of programming.

Step: 1. Set Host Name :

# hostname joomla.domain.com
# vi /etc/sysconfig/network

HOSTNAME=joomla.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Hosts File :


# vi /etc/hosts

10.100.99.214           joomla.domain.com    joomla

-- Save & Quit (:wq)

Step: 3. Disable Selinux & Stop Firewall :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 4. Install NTP Server (for Time Synchronization) :

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

Step: 5. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 6. Edit httpd.conf file :

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

#ServerName www.example.com:80

-- Add this Line:

ServerName ip_address_of_server:80

-- Save & Quit (:wq)

Step: 6. Download & Extract Joomla Package :

# cd /var/www/html
# wget http://joomlacode.org/gf/download/frsrelease/18323/80367/Joomla_3.1.1-Stable-Full_Package.tar.gz
# mkdir joomla
# tar zxvf Joomla_3.1.1-Stable-Full_Package.tar.gz -C joomla/

# chmod -Rf 775 joomla

Step: 7. Edit the 'httpd.conf' File :

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

-- Add those Lines :

<Directory /var/www/html/joomla>
    Options -Indexes +Multiviews
       DirectoryIndex index.php index.html
    AllowOverride All
    Allow from all
</Directory>

-- Save & Quit (:wq)

Step: 8. Install MySQL Database Server :

# yum -y install mysql mysql-server mysql-devel

Step: 9. Start MySQL Service :

# service mysqld start
# chkconfig mysqld on

Step: 10. Setup MySQL Root Password :

# mysql_secure_installation

Step: 11. Create Database & User for Joomla :

# mysql -u root -p

-- Give root Password.

Mysql> create database joomladb character set utf8;
Mysql> grant all privileges on joomla.* to joomla@'localhost' identified by 'password';
Mysql> grant all privileges on joomla.* to joomla@'%' identified by 'password';
Mysql> flush privileges;
Mysql> exit

Step: 12. Install PHP5 Scripting Language :

# yum -y install epel-release
# yum -y install php php-devel php-cli php-mysql php-common php-gd php-mbstring \
   php-mcrypt php-imap php-xml php-xmlrpc

Step: 13. Check php Configuration :

# vi /var/www/html/info.php

<?php
  phpinfo();
?>

-- Save & Quit (:wq)

Step: 14. Restart Apache to Load php :

# service httpd restart
# chkconfig httpd on

Step: 15. Then Point your Browser to http://ip_address/info.php :

Ex- http://10.100.99.214/info.php

Step: 16. Configure Joomla Server through Web Browser :

Go to http://10.100.99.214/joomla

-- Select Language: English
-- Site Name: Koushik's World
     Admin Email: kchatterjee@domain.com
-- Admin Username: admin
     Admin Password: Passw0rd
     Confirm Admin Password: Passw0rd
  
-- Click Next
-- Database Type: MySQL
     Hostname: localhost
     Username: joomla
     Password: password
     Database Name: joomladb
  
-- Click Next.
-- Just Skip Ftp Configuration.
-- Click Next.
-- Select Blog English Sample Data.
-- Click Install.
-- Click on Remove Installation Folder.
-- Click on Site.

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

Sunday, 30 October 2016

Install & Configure GlassFish on CentOS/RHEL 6x

Install & Configure GlassFish on CentOS/RHEL 6x


-- GlassFish is an Application Server which can also be used as a Web Server (Http Server). GlassFish Server is the world's first implementation of the Java Platform.

Step: 1. Bind Hosts File :

# vi /etc/hosts

10.100.97.39           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

Step: 3. Install NTP Server (for Time Synchronization) :

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

# init 6

Step: 4. Installing the Java :

# yum -y install wget
# 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

Step: 5. Setup JAVA_HOME Variable :

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

Step: 6. 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: 7. 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: 8. Download & Extract Glassfish :

# yum -y install unzip
# cd /opt
# wget http://download.java.net/glassfish/4.1.1/release/glassfish-4.1.1.zip
# wget http://download.java.net/glassfish/4.0/release/glassfish-4.0.zip
# unzip glassfish-4.1.1.zip

Step: 9. Start the GlassFish Server :

# /opt/glassfish4/bin/asadmin start-domain

Waiting for domain1 to start .........
Successfully started the domain : domain1
domain  Location: /opt/glassfish4/glassfish/domains/domain1
Log File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

Step: 10. Set GlassFish Admin Password (By Default Password is Blank) :

# cd /opt/glassfish4/bin/
# ./asadmin
asadmin> change-admin-password

Enter admin user name [default: admin]> Just Press Enter.
Enter the admin password> Just Press Enter.
Enter the new admin password> Passw0rd (Press Enter.)
Enter the new admin password again> Passw0rd (Press Enter.)
Command change-admin-password executed successfully.

Step: 11. Enabled to Access the DAS Remotely on GlassFish :

asadmin> enable-secure-admin

Enter admin user name>  admin
Enter admin password for user "admin"> Passw0rd

You must restart all running servers for the change in secure admin to take effect.
Command enable-secure-admin executed successfully.

asadmin> stop-domain

Waiting for the domain to stop .
Command stop-domain executed successfully.

asadmin> start-domain

Waiting for domain1 to start .......
Successfully started the domain : domain1
domain  Location: /opt/glassfish4/glassfish/domains/domain1
Log File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

asadmin> exit
Command multimode executed successfully.

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

 

Saturday, 22 October 2016

SFTP Chroot Jail Configuration on CentOS/RHEL 6.x

SFTP Chroot Jail Configuration on CentOS/RHEL 6.x


-- This tutorial describes how to give users chrooted SSH or SFTP access on CentOS. With this setup, you can give your users shell access without having to fear that they can see your whole system. Your users will be jailed in a specific directory which they will not be able to break out of.

Step: 1. Create a New Group For SFTP Users :

# groupadd sftpusers

Step: 2. Create a SFTP User :

# mkdir /var/www/html/koushik.com
# useradd -g sftpusers -d /var/www/html/koushik.com/koushik -s /sbin/nologin koushik
# passwd koushik

Step: 3. Configure SFTP Server :

# vi /etc/ssh/sshd_config

-- Find & Commented :

#Subsystem      sftp    /usr/libexec/openssh/sftp-server

-- Add those Lines :

Subsystem sftp internal-sftp
AllowUsers koushik

# User specific configuration
Match User koushik
ChrootDirectory /var/www/html/koushik.com
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

-- Save & Quit (:wq)

Step: 4. Restart SFTP/SSH Service :

# service sshd restart

Step: 5. Give Permission of Chroot Directory :

# chown -Rf koushik:sftpusers /var/www/html/koushik.com/
# chmod -Rf 755 /var/www/html/koushik.com/

Step: 6. Testing SFTP Chroot Jail :

# sftp koushik@192.168.100.229

Are you sure you want to continue connecting (yes/no)? yes

koushik@192.168.100.229's password: redhat

sftp> pwd
Remote working directory: /
sftp> cd /tmp
Couldn't canonicalise: No such file or directory
sftp> cd /etc
Couldn't canonicalise: No such file or directory
sftp> mkdir test
sftp> ls
test
sftp> bye
[root@ser2 ~]#

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

 

Wednesday, 12 October 2016

Install & Configure Vsftpd Server on CentOS/RHEL 6x

Install & Configure Vsftpd Server on CentOS/RHEL 6x


Q. What is VSFTPD ?

-- vsftpd, (or very secure FTP daemon), is an FTP server that runs on Linux/UNIX Operating Systems. It is Licensed under the GNU General Public License. It supports IPv6 and SSL. VSFTP is a secure, stable, and fast FTP Server.

Step: 1. Install VSFTP Server :

# yum install -y vsftpd

Step: 2. Configure FTP Server :

# vi /etc/vsftpd/vsftpd.conf

Find these Lines :

-- At line 12:

anonymous_enable=NO

-- At lines 96 & 97 Uncommented the following :

chroot_local_user=YES
chroot_list_enable=YES

-- At line 98 Uncomment the following :

chroot_list_file=/etc/vsftpd/chroot_list

-- Just delete the # sign

userlist_enable=YES

-- Save & Exit (:wq)

Step: 3. Make the Directory Accessible to the ftp-users Group :

# useradd -d /var/www/path/to/your/dir -s /usr/sbin/nologin ftpuser1
# passwd ftpuser1
# chown -Rf ftpuser1 /var/www/path/to/your/dir
# chmod 775 /var/www/path/to/your/dir

Step: 4. Create a File Under /etc/vsftpd :

# vi /etc/vsftpd/chroot_list

-- Jail Users or Limits Users to only their home directory. To add the limited user name in the 'chroot_list'

ftpuser1
ftpuser2

-- Save & Quit (:wq)

Step: 5. To Add a nologin to the Shell :

# vi /etc/shells

-- The file should look like this:

    /bin/ksh
    /usr/bin/rc
    /usr/bin/tcsh
    /bin/tcsh
    /usr/bin/esh
    /bin/dash
    /bin/bash
    /bin/rbash

-- Add this line at the End:

    /usr/sbin/nologin

-- Save & Exit (:wq)

Step: 6. Now Create a usergroup & Add the ftpuser1 to it :

# addgroup ftp-users
# usermod -Gftp-users ftpuser1

Step: 7. Restart the FTP Service :

# service vsftpd restart
# chkconfig vsftpd on
# netstat -tulpn | grep :21
# service vsftpd status

Step: 8. Configure Firewall & Set SELinux for FTP :

# iptables -I INPUT -p tcp -m tcp --dport 20 -j ACCEPT
# iptables -I INPUT -p tcp -m tcp --dport 21 -j ACCEPT
# iptables -I INPUT -p tcp -m tcp --dport 12000:12100 -j ACCEPT
# iptables -I INPUT -p udp -m tcp --dport 12000:12100 -j ACCEPT

# setsebool -P ftpd_disable_trans=1

Step: 9. View FTP Log File :

# tail –100f /var/log/vsftpd.log

Step: 10. VSFTP Passive Port Configuration :

# vi /etc/vsftpd/vsftpd.conf

-- Add these Lines at the End:

# PASV Configurations :
pasv_promiscuous=YES
pasv_enable=YES
pasv_min_port=12000
pasv_max_port=12100
#pasv_address=X.X.X.X

# Other Parameter :
max_login_fails=5
max_per_ip=5
max_clients=10
require_ssl_reuse=NO
listen_port=21
use_localtime=YES
connect_from_port_20=NO

-- Save & Quit (:wq)

# service vsftpd restart

Step: 11. Check Connectivity through Web Browser:

ftp://192.168.72.142
Enter User name & Password.

-- Or You Can use Filezilla or Any other FTP Client.

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


Saturday, 1 October 2016

Install & Configure Apache CouchDB 1.6.1 on Ubuntu 14.04

Install & Configure Apache CouchDB 1.6.1 on Ubuntu 14.04


What is Apache CouchDB?

-- Apache CouchDB is an open source document-oriented database with NoSQL. NoSQL means, it doesn’t have any database schema, tables, rows, etc. CouceDB uses JSON to store data with documents, which you can access from a web browser via HTTP. CouchDB works smoothly with all latest modern web and mobile apps.

Step: 1. Install Build Tools & Required Dependencies :
 
# apt-get update
# apt-get -y upgrade
# apt-get -y install build-essential erlang-base-hipe erlang-dev erlang-manpages erlang-eunit \
   erlang-nox libicu-dev libmozjs185-dev libcurl4-openssl-dev wget

Step: 2. Installing CouchDB  :

# cd /tmp
# wget http://mirror.fibergrid.in/apache/couchdb/source/1.6.1/apache-couchdb-1.6.1.tar.gz
# tar -xvf apache-couchdb-1.6.1.tar.gz
# rm -rf apache-couchdb-1.6.1.tar.gz
# cd apache-couchdb-1.6.1
# ./configure
# make && make install

Step: 3. Configuring CouchDB :

# adduser --disabled-login --disabled-password --no-create-home couchdb
# chown -Rf couchdb:couchdb /usr/local/var/lib/couchdb/
# chown -Rf couchdb:couchdb /usr/local/var/log/couchdb/
# chown -Rf couchdb:couchdb /usr/local/var/run/couchdb/
# ln -s /usr/local/etc/init.d/couchdb /etc/init.d/couchdb
# update-rc.d couchdb defaults

Step: 4. Give HTTP Access To CouchDB :

# vi /usr/local/etc/couchdb/local.ini

-- Uncomment & Modify Line No. 11 & 12 :

[httpd]
port = 5984
bind_address = 0.0.0.0

-- Save & Quit (:wq)

Step: 5. Start CouchDB Service :

# service couchdb start
# service couchdb status

Step: 6. Verifing CouchDB :

# curl http://localhost:5984

Or

Open Web Browser & Type: http://10.100.97.37:5984

Step: 7. Access Couchdb Web Interface For Manage the Database :

http://10.100.97.37:5984/_utils/

-- Create Admin User :

-- By Default there is no admin user, you need to create one by just clicking on the bottom right
     corner that says "Fix this". Once you click on that link you will prompted to enter admin user
     and password.

-- Give Username & Password.
-- Click on "Create" Button.

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


Saturday, 24 September 2016

How To Change RDP (Remote Desktop) Default Port on Windows Server 2008 R2

Change RDP (Remote Desktop) 3389 Port on Windows Server 2008 R2


-- Remote Desktop Protocol (RDP) stands for Administrative Console Access. If your System has Remote Desktop enabled, it is listening for TCP connections on Port 3389 (by default Port) and it may be necessary to make it even more secure by changing the TCP Port used for the network access. Since this port is both well known and can be used to attack accounts. If you want to change the port, it requires a quick change in the Windows registry.

Note: Editing the registry is very risky, So be sure you have a verified backup before saving any changes.

Step: 1. Open Registry Editor :

Click on Start -> Run -> Type: regedit -> Press 'OK'.

Step: 2. Change Registry :

Go to:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

Double Click on PortNumber -> Select Decimal -> Give Value Data (2289) -> OK

Step: 3. Allow your Port Number within Windows 2008 Firewall :

Click on Start -> Administrative Tools -> Windows Firewall with Advanced Security -> Inbound Rules -> Search Remote Desktop (TCP-In) & Right Click -> Disable Rule.

-- Then Create a New Rule for RDP :

Inbound Rules -> New Rule -> Select Port -> Next -> Specific Local Ports (2289) -> Next -> Next -> Next -> Give Name (RDP) -> Finish -> Close.

Step: 4. Restart Remote Desktop Service (plus Dependent Services) :

Click on Start -> Administrative Tools -> Services -> Restart the following Services :

-- Remote Desktop Configuration
-- Remote Desktop Services
-- Remote Desktop Services
-- UserMode Port Redirector

Step: 5. Finally Restart the Server :

Now Login with new Port Number.

Note: When you try to Connect to this Computer by using the Remote Desktop Connection, you must Type the new Port Number.

Ex: 192.168.100.102:2289

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

Saturday, 17 September 2016

How to Install & Configure Redmine 3 on Ubuntu 14.04

How to Install & Configure Redmine 3 on Ubuntu 14.04


Q. What is Redmine ?

-- Redmine is a free and open source, web-based project management and issue tracking tool, Written using the Ruby on Rails framework. It allows users to manage multiple projects and associated sub projects. It features per project wikis and forums, time tracking, and flexible role based access control.

Features :

1. Multiple Projects Support.
2. Flexible Role Based Access Control
3. Flexible Issue Tracking System etc.

Step: 1. Set Host Name :

# hostname tickets.domain.com
# vi /etc/hostname

tickets.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Host File :

# vi /etc/hosts

10.100.97.137    tickets.domain.com    tickets

-- Save & Quit (:wq)

Step: 3. Update the System :

# apt-get update
# apt-get -y upgrade

Step: 4. Install Prerequisites :

# apt-get -y install apache2 apache2-utils apache2-threaded-dev apache2-prefork-dev \
    libapache2-mod-passenger make automake autoconf cmake openssl libcurl4-openssl-dev \
    libapr1-dev libaprutil1-dev libmysqlclient-dev wget

# apt-get -y install php5 libapache2-mod-php5 php5-mysql libapache2-mod-perl2 libssl-dev \
    libmagickcore-dev libmagickwand-dev curl git-core patch build-essential bison zlib1g-dev \
    libxml2-dev autotools-dev libxslt1-dev libyaml-0-2 libreadline6-dev libyaml-dev libtool \
    imagemagick libicu-dev libssh2-1 libssh2-1-dev libgpg-error-dev

Step: 5. Install Ruby & Gem with Rails :

# apt-get -y remove ruby
# curl -#LO https://rvm.io/mpapis.asc
# gpg --import mpapis.asc
# curl -sSL https://get.rvm.io | bash -s stable
# source /etc/profile.d/rvm.sh
# rvm requirements
# rvm install 2.3.0
# rvm use 2.3.0 --default

Step: 6. To Check Ruby & Gem Version :

# ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

# gem -v
2.5.1

Step: 7. Install Passenger :

# gem install passenger
# passenger-install-apache2-module

Press Enter and Press " ! " and Make Sure you Select only the 'ruby' one.

**LOOK CAREFULLY after successfully installing it give codes .we must edit in our apache. FOR ME .It may be other for you. ========================================================================
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.3.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
    PassengerRoot /usr/local/rvm/gems/ruby-2.3.0/gems/passenger-5.0.30
    PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.3.0/wrappers/ruby
</IfModule>
=========================================================================

Step: 8. To Load the Passenger Module into Apache :

# vi /etc/apache2/mods-available/passenger.load

-- Delete the LoadModule Line & Paste the Below Module.

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.3.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so

-- Save & Quit (:wq)

# vi /etc/apache2/mods-available/passenger.conf

-- Delete Everything & Paste the Below Code.

<IfModule mod_passenger.c>
    PassengerRoot /usr/local/rvm/gems/ruby-2.3.0/gems/passenger-5.0.30
    PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.3.0/wrappers/ruby
</IfModule>

-- Save & Quit (:wq)

# a2enmod passenger

Step: 9. Now, you can Download the Latest Version of Redmine :

# cd /var/www
# wget http://www.redmine.org/releases/redmine-3.0.4.tar.gz
# tar zxf redmine-3.0.4.tar.gz
# rm redmine-3.0.4.tar.gz
# mv redmine-3.0.4 redmine
# chown -R www-data:www-data /var/www/redmine
# chmod -R 775 /var/www/redmine
# touch /var/www/redmine/log/production.log
# chown root:www-data /var/www/redmine/log/production.log
# chmod 664 /var/www/redmine/log/production.log

Step: 10. Start the Apache Server :

# service apache2 restart

Step: 11. Install MySQL Server :

# apt-get -y install mysql-server mysql-client

New password for the MySQL "root" user: redhat
Repeat password for the MySQL "root" user: redhat

Step: 12. Create Database for Redmine :

# mysql -u root -p
Enter Password:

mysql> create database redminedb character set utf8;
mysql> grant all privileges on redminedb.* to redmine@'localhost' identified by 'password';
mysql> flush privileges;
mysql> exit

Step: 13. Now, Install the Gem file and the bundler :

# gem install rake rack i18n rubytree RedCloth mysql coderay rails jquery-rails fastercsv builder mime-types awesome_nested_set activerecord-jdbc-adapter selenium-webdriver shoulda mysql2

# cd /var/www/redmine
# gem install bundler
# bundle install --without development test rmagick

Step: 14. Setup the Database Connection for Redmine :

# cd /var/www/redmine/config
# mv database.yml.example database.yml
# vi database.yml

In the 'production' Section, update the 'database', username, password and other Parameters Accordingly like so :

production:
  adapter: mysql2
  database: redminedb
  host: localhost
  username: redmine
  password: "password"
  encoding: utf8

-- Save & Quit (:wq)

Step: 15. Create the Virtual host files for running Redmine :

# mv /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf.bak
# cd /etc/apache2/sites-enabled
# unlink 000-default.conf
# vi /etc/apache2/sites-available/redmine.conf

<VirtualHost *:80>
ServerName redmine

DocumentRoot /var/www/
Alias /tickets /var/www/redmine/public

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/redmine>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory /var/www/redmine/public>
PassengerEnabled on
SetHandler none
PassengerAppRoot /var/www/redmine
RailsBaseURI /redmine
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>

-- Save & Quit (:wq)

# a2ensite redmine.conf

Step: 16. Restart Apache Server :

# service apache2 restart

Step: 17. Set Environment to "production" Environment :

# cd /var/www/redmine/config
# vi environment.rb

Note: If there is line uncomment it, if not just proceed ahead.

ENV['RAILS_ENV'] ||= 'production'

-- Save & Quit (:wq)

Step: 18. In Terminal, use Following Command :

# cd /var/www/redmine/
# bundle install
# RAILS_ENV=production bundle exec rake generate_secret_token
# RAILS_ENV=production bundle exec rake db:migrate
# RAILS_ENV=production bundle exec rake redmine:load_default_data

Type 'en' when asked & Press Enter.

Step: 19. Rename dispatch CGI files in /redmine/public/ :

# cd /var/www/redmine/public
# mv dispatch.fcgi.example dispatch.fcgi
# cp htaccess.fcgi.example .htaccess

Step: 20. Fix Rights for the Apache user :

# chown -Rf www-data:www-data /var/www/redmine

Step: 21. Restart the Apache Server :

# service apache2 restart

Step: 22. Point Your Web Browser & Type :

http://ip_address_server/redmine
or
http://domain_name/redmine
User: admin
Pass: admin

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

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

Copyright © 2016 Kousik Chatterjee's Blog