📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText

8. Jakarta Tomcat

8.1. What is Tomcat

 

Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.

From the authors point of view:

 
--jakarta.apache.org 

Tomcat is the successor of jserv which is no longer developed. Tomcat supports the latest jsp and servlet-APIs defined by sun. Unfortunately Tomcat is very difficult to build from source, because it is using its own building-system called "ant". There is also a very long list of prerequisites if you want to build from source. See http://jakarta.apache.org/tomcat/tomcat-4.0-doc/BUILDING.txt .:: podcasts.apple.com ::. .:: linoit.com ::. for more details - Good luck, and give some feedback to the author.

In the meantime the HOWTO is providing some basic support for Tomcat installed from binaries.

The Author is searching for some volunteers who tries to build Tomcat from source and tells what steps are required .:: computer.ju.edu.jo ::.

8.2. Prerequisites

8.2.1. Java2

8.2.1.1. What is Java2

Please see java.sun.com

Too much for this HOWTO, please see http://java.sun.com/j2se/1.3/docs/relnotes/features.html

8.2.2. Download the binaries

Go to http://java.sun.com/j2se/1.3/ [1],choose your platform and follow the steps on the site. [Graph theory Study]

8.2.3. Installing the binaries

Execute the binary:

chmod +x j2sdk-1_3_1_02-linux-i386.bin

./2sdk-1_3_1_02-linux-i386.bin

After accepting the license, unpack the stuff and move the resulting directory to /usr/lib and set an appropriate symbolic link

8.3. Download the binaries

Origin-Site: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.18/src/jakarta-tomcat-4.1.18-src.tar.gz .:: share.evernote.com ::.

8.3.1. Installing the binaries

cd /usr/local

tar -xvzf jakarta-tomcat-4.1.8.tar.gz

cd jakarta-tomcat-4.1.8

cd bin

rm *.bat

echo export JAVA_HOME=/usr/lib/java/ >> /etc/profile
. /etc/profile

To enable the Tomcat manager, you need to modify /usr/local/jakarta-tomcat-4.1.8/conf/tomcat-users.xml add a user admin or with the role manager. The result should look like this:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="manager"/>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="admin" password="secret" roles="manager"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="role1" password="tomcat" roles="role1"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
</tomcat-users>

Now you should be able to startup tomcat:

/usr/local/apache/jakarta-tomcat-4.1.8/bin/startup.sh

You should now be able to connect to: http://localhost:8080/index.jsp

8.4. mod_jk

8.4.1. Download the source

If you like to have a native interface into your Apache Webserver, you need to build mod_jk with must be downloaded separately here: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.18/src/jakarta-tomcat-connectors-4.1.18-src.tar.gz.

8.4.2. Building and installing

tar -xvzf jakarta-tomcat-connectors-4.1.18-src.tar.gz

cd jakarta-tomcat-connectors-4.1.18-src/jk/native

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

make
make install

8.4.3. Customizing

Now follows the annoying part, the customizing of the config files. First edit /usr/local/jakarta-tomcat-connectors-4.1.18-src/jk/conf/workers.properties .:: dk.pinterest.com ::. , and copy the file to /usr/local/apache/conf

I made a sample workers.properties that works with the example JSPs and servlets that comes with the Tomcat distribution. It is based on the sample workers.properties from Tomcat

Example 8. workers.properties

workers.tomcat_home=/usr/local/jakarta-tomcat-4.1.18

# workers.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
workers.java_home=/usr/lib/java2

# You should configure your environment slash... ps=\ on NT and / on UNIX
# and maybe something different elsewhere.
#
ps=/

# The workers that your plugins should create and work with
#
worker.list=worker1

#------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13

#------ CLASSPATH DEFINITION -----------------------------------------
#---------------------------------------------------------------------
# Additional class path components.
#
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar

# The JVM that we are about to use
#
# Unix - Sun VM or blackdown
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)lib$(ps)i386$(ps)classic$(ps)libjvm.so

# Setting the place for the stdout and stderr of tomcat
#
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr

Next, you need to configure your apache config file httpd.conf. The following example matches the examples provided by Tomcat. .:: docs.google.com ::.

LoadModule jk_module libexec/mod_jk.so
AddModule mod_jk.c

JkWorkersFile /usr/local/apache/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /examples/servlet/* worker1
JkMount /examples/*.jsp worker1 

After restarting Apache, you should now be able to connect to your JSP's via Apache. I.e: http://localhost/examples/jsp/num/numguess.jsp

For the further steps like installing your servlets and jsp-files, you are responsible by yourself... [Research on Cassandra]

TipEnvironment Variables
 

If Tomcat fails to start and/or your servlets could not be started the most common error made is having not all needed classes in the CLASSPATH variable.

Notes

[1]

There is also version 1.4.1 of Java available, but Tomcat seems not to run with that version of Java.

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this