Build install JAVA

coldwaterphewServers

Nov 17, 2013 (4 years and 1 month ago)

97 views

Install Citrix Web Interface 2.1 on Redhat Linux:


echo "#Set a few environmental variables for Tomcat, Java, and Apache" >> /etc/profile

echo "export CATALINA_HOME=/usr/local/tomcat/" >> /etc/profile

echo "export JAVA_HOME=/usr/local/java" >> /etc/profile

echo "export APACHE_HOME=/usr/local/apache" >> /etc/profile


echo "#Set a few environmental variables for Tomcat, Java, and Apache" >> /etc/rc.local

echo "export CATALINA_HOME=/usr/local/tomcat/" >> /etc/rc.local

echo "export JAVA_HOME=/usr/local/java" >>

/etc/rc.local

echo "export APACHE_HOME=/usr/local/apache" >> /etc/rc.local

echo "/usr/local/sbin/start.sh" >> /etc/rc.local



Step 1:

Unzip the package:
unzip nfuse.zip



Step 2:

Change to the directory with the applications>
cd NfuseApache



Step 3:

Unpack Apache first:
tar zxvf httpd
-
2.0.47.tar.gz



Step 4:

Change to the Directory with the apache installation files>

cd
/usr/local/src/NfuseApache/httpd
-
2.0.47



Step 5:

Configure Apache:
./configure
--
prefix=/usr/local/apache
--
enable
-
so



Step 6:

Make the package>
make



Step 7:

Install the package>

make install



Step 8:

Test Apache configuration>
/usr/local/apache/bin/apachectl configtest



Step 9:

Set the Apache variable>
export APACHE_HOME=/usr/local/apache

Verify that the variable is set>

echo $APACHE_HOME



Install Tomcat:


Step 1:

Change to the installation directory>
cd /usr/local/src/NfuseApache



Step 2:

Copy tomcat to /usr/local/ >
cp
-
p tomcat
-
4.1.27.tar.gz /usr/local/

Verify its there>

ls /usr/local/



Step 3:

Change to the /usr/
local directory >
cd
/usr/local/



Step 4:

Unpack Tomcat>
tar zxvf tomcat
-
4.1.27.tar.gz



Step 5:

Make a symbolic link ot the tomcat installation directory>
ln
-
s /usr/local/jakarta
-
tomcat
-
4.1.27 /usr/local/tomcat

Verify its there>

ls



Step 6:

Set th
e tomcat directory variable>
export CATALINA_HOME=/usr/local/tomcat



Step 7:

Verify that it now read the new variable>
echo
$CATALINA_HOME


Build install JAVA


Step 1:

Make the java package executable>

chmod 777 chmod 777 j2sdk
-
1_4_2_03
-
linux
-
i586.bi
n



Step 2:

Copy the package to /usr/local/ >

cp j2sdk
-
1_4_2_03
-
linux
-
i586.bin /usr/local/



Step 3:

Change to the /usr/local/ directory>

cd /usr/local/



Step 2:

Unpack the Java package>

./j2sdk
-
1_4_2_03
-
linux
-
i586.bin



Step 3:

Read the Disclaimer
and except it at the end by typing>

yes





The package will unpack and create a directory called

j2sdk1.4.2_03



Step 4:

Make a symbolic link to the java directory>

ln
-
s /usr/local/j2sdk1.4.2_03/
/usr/local/java



Step 5:

Verify the /usr/local/java s
ymbolic link was created>

ls /usr/local



Step 6:

Set the java directory variable>
export JAVA_HOME=/usr/local/java


Verify the variable was set for java>
echo $JAVA_HOME



Build Tomcat/Apache Connector:


Step 1:

Change to the installation directory>
cd

/usr/local/src/NfuseApache/



Step 2:

Unpack the connector package>
tar xvzf jakarta
-
tomcat
-
connectors
-
jk
-
1.2
-
src
-
current.tar.gz


Step 3:

Set the Connector Home variable>
export
CONNECTOR_HOME=/usr/local/src/NfuseApache/jakarta
-
tomcat
-
connectors
-
jk
-
1.
2.5
-
src

Verify the variable is correct>

echo $
CONNECTOR_HOME



Step 4:

Change to the connector installation directory>
cd $CONNECTOR_HOME/jk/native



Step 5:

Run the build command>
./buildconf.sh



Step 6:

Run the configure command to link it to apache>

./configure
--
with
-
apxs=/usr/local/apache/bin/apxs



Step 7:

Make the package>
make



Step 8:

Install the package>
make
install


Step 9:

Verify it made the file mod_jk.so>
find /
-
name mod_jk.so

print

You will see it in /usr/local/apache/modules/



S
tep 10:

Configure the Tomcat Connector to talk to apache>
cd $CATALINA_HOME/conf


Step 11:

Backup the server.xml file>

cp
-
p server.xml server.xml.ORIG

Verify a copy was made>

ls



Step 12:

Edit the server.xml file>
vi server.xml



Step 13:

Place the fol
lowing line under <Server port="8005" shutdown="SHUTDOWN"
debug="0">


<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
modJk="/usr/local/apache/modules/mod_jk.so" />


You can search in vi by typing

/8005




Insert the line by pressing the

Ins

key and right clicking with the mouse. It will look
exactly as below.



Step 14:

Press
ESC

key to get out of insert. Then type
:w!
to save to the file without exiting the
file.



Step 14:

Search for this line by pressing the
/

key and typing the fl
owing
/<Host name=



It will put you at the correct section to add the following line below. Press the
Ins

key,
cut and paste the line below>

<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
append="true" forwardAll="false" modJk="/usr/loc
al/apache/modules/mod_jk.so"
/>

Change localhost to the servers ip address! The screen will look exactly as below except
the ip will be of the server your working on.



Step 15:

Press
ESC

and the type
:wq

to save and exit the file.



Step 16:

Edit Apache

to call the Tomcat Connector>
vi /usr/local/apache/conf/httpd.conf



Step 17:

Scroll down to the very end of the httpd.conf file and add the following line by pressing
Ins

key>

Include /usr/local/tomcat/conf/auto/mod_jk.conf


Press the
ESC

key and type
:
wq

to save and exit the file.



Step 18:

You will need to create a file called

worker.properties.

Change to>

cd $CATALINA_HOME/conf


Step 19:

Make the directory jk>
mkdir jk

Verify its there>
ls



Step 20:

Change to the new directory you created>
cd $C
ATALINA_HOME/conf/jk



Step 21:

Create a file called workers.properties>
vi workers.properties



Step 22:

Add the following line to workers.properties, press the Ins key and the cut and paste the
lines below>

worker.list=ajp13

worker.ajp13.port=8009

wor
ker.ajp13.host=192.168.92.13

worker.ajp13.type=ajp13



Press
ESC

key then type
:wq

to save and exit the file.



Step 23:

Next we need to create a startup script and a shutdown script for apache and Tomcat as
they need to be started in a certain order with

enough time for Tomcat to load first.

Change to the directory>
cd /usr/local/sbin/



Step 24:

To create the start.sh script type>
vi start.sh



Step 25:

Add the flowing line to the file, press the
Ins

key and cut and paste the lines below>

echo "Starti
ng Tomcat.................."

/usr/local/tomcat/bin/startup.sh

echo "Waiting 20 seconds to start Apache............."

sleep 20

echo "Starting Apache..............."

/usr/local/apache/bin/apachectl start


To save the file press
ESC

and then type
:wq

to save
and exit the file.



Step 26:

To create the stop script type>
vi stop.sh



Step 27:

Add the flowing line to the file, press the
Ins

key and cut and paste the lines below>

echo "Stopping Tomcat.................."

/usr/local/tomcat/bin/shutdown.sh

echo "St
opping Apache..............."

/usr/local/apache/bin/apachectl stop


To save the file press
ESC

and then type
:wq

to save and exit the file.



Step 28:

We need to make the start.sh script executable.

Type>
chmod 777 start.sh



Step 29:

We need to make th
e stop.sh script executable.

Type>
chmod 777 stop.sh



START THE SERVER:

Type>

/usr/local/sbin/start.sh



RUN YOUR APPLICATIONS !!!


To test tomcat you can connect to the server on port 8080
http://<ip>:8080

(it’s the
tom
cat default) but with the connector apache is calling tomcat so port 80 is all you
need to let out on your firewall.