Thursday 11 February 2016

How to install Apache Tomcat Natives on CENTOS7/RHEL7



Step 1: To install Tomcat Natives first need to install prerequisites compilers and development tools:


[root@linuxcnf ~]# yum install make gcc openssl libssldev

Step 2: Download the apr package from here and install as below:

[root@linuxcnf ~] # tar -xzf  apr-1.5.2.tar.gz
[root@linuxcnf ~] # cd apr-1.5.2/
[root@linuxcnf ~] # ./configure
[root@linuxcnf ~] # make
[root@linuxcnf ~] # make install

Now you can see the compiled files on below in path:

[root@linuxcnf ~]# ls /usr/local/apr/lib/libapr-1.*

Step 3: Install Java8/jdk1.8 from here and verify the installation.

Now we have installed all the prerequisites and we can install Tomcat Natives.

Step 4: Download the Tomcat Native source file from here:

Step 5: Now extract the downloaded file and compile the source code as below:

[root@linuxcnf ~]# tar -xzf tomcat-native-1.2.16-src.tar.gz
[root@linuxcnf ~]# cd tomcat-native-1.2.16-src/native
[root@linuxcnf ~]# ./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME
[root@linuxcnf ~]# make
[root@linuxcnf ~]# make install

Now we have installed the Tomcat Native library under /usr/local/apr/ libtcnative-1.so

Step 6: Set variable for LD Library:

Edit file /etc/profile.d/setvariables.sh and enter the below line into the end of the file and load variable:

[root@linuxcnf ~]# vi /etc/profile.d/setvariables.sh
#Add the below line
 LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
:wq
# source /etc/profile.d/setvariables.sh

Now run the ./configtest.sh from $CATALINA_HOME/bin directory and check.

No comments:

Post a Comment