Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

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


Copyright © 2016 Kousik Chatterjee's Blog