Thursday 25 July 2013

Working with screen in linux


Screen : most useful feature available in Linux for run command from remote end user.
without interrupting you command would be run backend.

Install screen in Linux :

#yum install screen

Work with screen :
Enter in screen
#screen
Come out from screen
Ctrl+AD
List screen id :
#screen -RD
Enter in screen( if multiple screen running)
#screen -RD screen_id
Enter in screen (if single screen running)
#screen -RD  

Thursday 11 July 2013

Easy way to Install and configure Apache tomcat Intigration with mod_jk.so in Linux/RHEL/Centos


Apache HTTP Server : commonly none as a Apache, it's web server application. From long Apache is most popular web server in the internet. Normally Apache run on a Linux like Operating system, Apache developed and maintain by Apache software Foundation, it's open source application.
Apache handling only static pages.

Tomcat : Tomcat is a container, it's contain java servlet. Tomcat handling java servlet dynamic page requests. Tomcat latest version available here  http://tomcat.apache.org

We are here for discussing and integration of apache and tomcat on Linux platform. Now, I am using centos 6.2 server, Jre1.6, apache 2.2.x , tomcat7.0.29 for done this configuration.

1.First Install jre download from here :
http://www.oracle.com/technetwork/java/javase/downloads/jre6downloads-1902815.html

# ls
lost+found
jre-6u45-linux-x64-rpm.bin 
# chmod +x jre-6u45-linux-x64-rpm.bin
# ./jre-6u45-linux-x64-rpm.bin
# java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
2. Install apache http server and components
#yum install httpd
#yum httpd-devel     ( it's provides /usr/sbin/apxs
#yum apr-devel       (provides the appropriate include files)
#apr                 (it's required by apr-devel)
#apr-util-devel (it's required by httpd-devel)
#apr-util           (it's required by apr-util)
# rpm -qa | grep httpd
httpd-manual-2.2.15-28.el6.centos.noarch
httpd-devel-2.2.15-28.el6.centos.x86_64
httpd-tools-2.2.15-28.el6.centos.x86_64
httpd-2.2.15-28.el6.centos.x86_64
you will see look like this, depends on Linux architecture.
Install compiler packages
#yum install gcc gcc-cpp gcc-c++
2. Download and Install apache tomcat package http://tomcat.apache.org/download-70.cgi
#tar -zxvf apache-tomcat-7.0.29.tar.gz
3. Download tomcat-connectors   http://tomcat.apache.org/connectors-doc/
#tar -xvf tomcat-connectors-1.2.37-src.tar
# cd tomcat-connectors-1.2.32-src/native/
# which usr/sbin/apxs                                                                                                                                 
# ./configure --with-apxs=/usr/sbin/apxs --enable-api-compatibility
# make
# make install 
after completed this activity you will get mod_jk.so file in /usr/lib64/httpd/modules/mod_jk.so
if get it , going well
Installation part has been completed, let's start configuration part
4. Open httpd.conf file and add end of line.
# vi /etc/httpd/conf/httpd.conf
JkWorkersFile "/etc/httpd/conf/worker.properties"
        JkLogFile "/var/log/httpd/mod_jk.log"
        JkRequestLogFormat "%w %V %T"
        JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
        JkLogLevel info
        JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkMount / worker1           (allow for all project)
JkMount /* worker1
allow specific project like as examples 
JkMount /examples worker1          
JkMount /examples* worker1

Note : use one given above both( allow for all project or allow specific project)
5. create worker.properties file and make the entry
#vi  /etc/httpd/conf/worker.properties
worker.list=worker1
# Define Node1
worker.worker1.port=8009
orker.worker1.host=127.0.0.1
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
save and exit
6. open the server.xml file make some changes
#vi /opt/apache-tomcat-7.0.29/conf/server.xml
 <!-- You should set jvmRoute to support load-balancing via AJP ie :-->
<Engine name="Catalina" defaultHost="localhost" jvmRoute=" jvmRoute">
to 
 <Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">
and
<Engine name="Catalina" defaultHost="localhost">
to
    <!--<Engine name="Catalina" defaultHost="localhost"> -->
save and exit.
Sart process : First start Tomcat then start Apache
#/opt/apache-tomcat-7.0.29/bin/startup.sh
#/etc/init.d/httpd start
Open the Browser and check the URL : http://localhost/examples
able to find this page

Apache Tomcat Examples

You have successfully done this job congratulation!
 
 
 

Thursday 4 July 2013

How to increase ulimit open file and user processes in Linux/Centos/RHEL


Max Number of ulimit open file : It's provide open file resource availability in linux
  
Increase max number of ulimit open file in Linux.

1- Step :  open the sysctl.conf  and add this line  fs.file-max = 65536

vi /etc/sysctl.conf   add end of line
fs.file-max = 65536

save and exit.

2. Step : vi /etc/security/limits.conf  and add below the mentioned

*          soft     nproc          65535
*          hard     nproc          65535
*          soft     nofile         65535
*          hard     nofile         65535
save and exit check max open file ulimit
[root@localhost# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 127358
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65535
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

Increase max user processes in Linux

Follow the step:

vi /etc/security/limits.conf  and add below the menstioed

*          soft     nproc          65535
*          hard     nproc          65535
*          soft     nofile         65535
*          hard     nofile         65535
and  vi /etc/security/limits.d/90-nproc.conf

*          soft     nproc          65535
*          hard     nproc          65535
*          soft     nofile         65535
*          hard     nofile         65535
save and exit check the user max processes ulimit
[root@localhost# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 127358
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65535
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 65535
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited


After make changes need to reboot system.







Install XRDP in Centos 7

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum update yum groupinstall "GNOME Desktop" ...