tomcat

Install Tomcat on Fedora VM for @msdev

This is continuation from Previous article on how to create a Fedora VM, with SFTP installed/configured (https://gridwizard.wordpress.com/2014/12/26/setup-linux-vm-with-sftp-guide-for-msdev). This article is for @msdev who’re unfamiliar with Linux environment.

STEP 1. Download Java SDK (it includes JRE). Then install Java on linux box under path /usr/java/jdk and /usr/java/jre
You may download from your Windows development box, then follow these instructions (https://gridwizard.wordpress.com/2014/12/26/setup-linux-vm-with-sftp-guide-for-msdev) to upload package to your Linux server box via SFTP.
@msdev, if you’re not familiar with Linux commands, the following commands may be handy.
cd /usr
mkdir java
cd /home/johndoe
mv jdk-8u25-linux-i586.gz /usr/java
tar -xvf jdk-8u25-linux-i586.gz
Also in case if you want to delete something:
rmdir ./SomeDirectory (SomeDirectory must be empty)
rm -rf ./SomeDirectory    (non-empty directory)
rm SomeFile (Delete a file)
Also to set environment variables for java Temporarily:
export PATH=
/usr/java/jdk1.8.0_25/bin:$PATH

To set the env var permanently, add the same line to ~/.bashrc.

export PATH=/usr/java/jdk1.8.0_25/bin:$PATH

STEP 2. Download and install Apache Tomcat under path /usr/apache/tomcat
Download Tar.gz package from here: http://tomcat.apache.org/download-70.cgi

To configure JAVA_HOME and CATALINA_HOME, place a setenv.sh in the the /usr/apache/tomcat/apache-tomcat-7.0.57/bin directory with

JAVA_HOME=/usr/java/jdk1.8.0_25/
JRE_HOME=/usr/java/jdk1.8.0_25/jre
CATALINA_HOME=/usr/apache/tomcat/apache-tomcat-7.0.57

http://stackoverflow.com/questions/1698913/how-to-set-java-home-in-tomcat-config

STEP 3. Start Tomcat

Navigate to /usr/apache/tomcat/apache-tomcat-7.0.57/bin

startup.sh

From your Windows box hosting the VM, you can access the default webpage hosted by Tomcat. Test from Browser:

http://192.168.56.102:8080/

8080 is Tomcat default port, which can be changed from server.xml in conf folder. http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port

Next, we’ll discuss how to develop a simple Java-WS (Web Service), put it on Fedora VM (on VirtualBox), the consume it from a dotnet Console Application on Windows box.

Happy Coding!

Advertisements