HOWTO : Apache/Tomcat (at last !!)

Ok i developed my knowledge about it a bit.
i have configured vhost like that :

....
<Context path="" docBase="/home/wemax/domains/wemax.lap.pl/public_html" debug="0"/>
<Context path="/manager" docBase="/usr/local/jakarta-tomcat-4.1.30/server/webapps/manager" debug="0" privileged="true"/>
....
after installing .war file from http://vhost/manager/html it is installed in /usr/local/tomcat/APP

http://vhost/APP doesnt work , http://vhost/APP/index.jsp - works.
Then i find out by a chance , i've copied /usr/local/tomcat/APP to /home/wemax/domains/wemax.lap.pl/public_html - then http://vhost/APP start to work. Great

But i have problem with one application http://test2.lap.pl/Test1.war
after installed nothing is printed out & no errors in logs ,could you install it and try it out?
no .jsp files only
WEB-INF/classes/Test1.class
WEB-INF/src/Test.java
web.xml
tomcatd should be restarted deploying that kinda application ?

Greetings
 
yes, you must restart tomcat each time you install a WAR application.

Once Tomcat is restarted, problem is that war deployment will create a new directory; meaning that if you put a test.war file into public_html there will now be public_html/test directory. But your tomcat context entry in server.xml is pointing to public_html as its ROOT directory; therefore Tomcat Server will not know what to do with files in public_html/test;

A workout is as follows: upload all the files individually.

.jsp files should go into public_html/ directory.

.class files should go into public_html/WEB-INF/classes directory

web.xml file should go into public_html/WEB-INF/ directory

.jar files should go into public_html/WEB-INF/jar directory.
 
at step 8 during make I get

Making all in common
--mode=compile gcc -I/usr/include/apache -g -O2 -DHARD_SERVER_LIMIT=32768 -DFD_SETSIZE=32768 -funsigned-char -DMOD_SSL=208121 -DEAPI -DUSE_EXPAT -I../lib/expat-lite -g -O2 -I /include -I /include/ -c ./jk_ajp12_worker.c
--mode=compile: not found
*** Error code 127

Stop in /usr/local/java/jakarta-tomcat-connectors/jk/native/common.
*** Error code 1

the buildconf.sh gives some weird warnings as well.

FreeBSD 5.2.1
 
if I use a release version of the connector rather then the cvs and dont use the newest automake on my box I can do buildconf.sh without errors but the configure command gives me this.

root@bollocks native2 # ./configure --with-apxs=/usr/sbin/apxs
checking build system type... i386-unknown-freebsd5.2.1
checking host system type... i386-unknown-freebsd5.2.1
checking target system type... i386-unknown-freebsd5.2.1
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets ${MAKE}... yes
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for ranlib... ranlib
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
scripts/build/unix/ltconfig: scripts/build/unix/ltconfig: No such file or directory
configure: error: libtool configure failed

its looking for a file not in the package, what gives?
 
going back to the cvs I get this during buildconf.sh

rm autom4te.cache
libtoolize --force --automake --copy
aclocal
autoheader
automake -a --foreign --copy
configure.in: 8: `automake requires `AM_CONFIG_HEADER', not `AC_CONFIG_HEADER'
autoconf
rm autom4te.cache

configure works

then this in make

gcc -DUSE_APACHE_MD5 -I ../common -I /include -I /include/ -I/usr/include/apache -DHARD_SERVER_LIMIT=32768 -DFD_SETSIZE=32768 -funsigned-char -DMOD_SSL=208121 -DEAPI -DUSE_EXPAT -I../lib/expat-lite -g -O2 -I../common -c -fPIC -DPIC -o .libs/mod_jk.lo
gcc: No input files specified
*** Error code 1

Stop in /usr/local/java/jakarta-tomcat-connectors/jk/native/apache-1.3.
*** Error code 1

Stop in /usr/local/java/jakarta-tomcat-connectors/jk/native.
 
compiled now with gmake, incidently if I manage to finish I will post all of what I needed to do to get step8 to work on FreeBSD.
 
greetings,

thanks !

I am working on an auto-installer that will install/update tomcat. This auto-installer will be available for purchase under a license system.

It will update/install the current version of tomcat (you will be prompted to install tomcat 4 or tomcat5).
It will install some software like javamail.
It will install a bunch of libraries.
and more to come...
 
ok got all the way to the end but this tomcatd bin seems to be linux only not fbsd compatible I get this when starting it.

/usr/local/sbin/tomcatd: line 20: /etc/rc.d/init.d/functions: No such file or directory
/usr/local/sbin/tomcatd: line 23: /etc/sysconfig/network: No such file or directory
/usr/local/sbin/tomcatd: line 26: [: =: unary operator expected
Starting Tomcat: Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JAVA_HOME: /usr/local/java/java

touch: /var/lock/subsys/tomcatd: No such file or directory
 
sorry yeah this is what I changed in the binary.

#!/usr/local/bin/bash
(as bash isnt in /bin/bash in freebsd)

# Source function library.
. //usr/local/etc/rc.d/functions
(I have no idea if this is the same as the linux version but I pointed to where I have the same type of file)

# Source networking configuration.
. /etc/rc.conf
(this is where ip's etc. are set in freebsd)

touch /usr/compat/linux/var/lock/subsys/tomcatd
(i have linux compat installed so used the linux compat path which stopped the last error)

with all these changes when I run the command there is no errors on the screen but unfortenatly it doesnt stay running so I guess it simply isn't runnable in freebsd but I will have another look at it tommorow after some sleep. I will also post what other stuff I changed to get it working on FBSD, mostly part 8, thanks for the grea guide tho, I believe this tomcatd is all I need to get thru to have it working. :)
 
glad to here you bypassed this error :)

if tomcatd fails when it starts, you should take a look at $CATALINA_HOME/logs/catalina.out
and see if something goes wrong when it initiates.
 
it must point to an existent directory.

This server.xml file is being used for example on howto add JSP support to a specified domain name.

regards,
 
I see yeah, was kind of dumb what I did but now its corrected and still doesnt stay running.

<Logger className="org.apache.catalina.logger.FileLogger" directory="/home/admin/logs" prefix="context_log." suffix=".log" timestamp="true"/>

is the above classname ok if not what it should it be set to?
 
StandardServer.await: create[8005]: java.net.BindException: Address already in $
java.net.BindException: Address already in use

could that be why its failing, looks like a port/ip conflict.
 
an aweful lot of processes, is this tomcatd or something else?

root java 8666 8 tcp4 *:8009 *:*
root java 8666 10 tcp4 127.0.0.1:8005 *:*
root java 8665 8 tcp4 *:8009 *:*
root java 8665 10 tcp4 127.0.0.1:8005 *:*
root java 8664 8 tcp4 *:8009 *:*
root java 8664 10 tcp4 127.0.0.1:8005 *:*
root java 8663 8 tcp4 *:8009 *:*
root java 8663 10 tcp4 127.0.0.1:8005 *:*
root java 8662 8 tcp4 *:8009 *:*
root java 8662 10 tcp4 127.0.0.1:8005 *:*
root java 8661 8 tcp4 *:8009 *:*
root java 8661 10 tcp4 127.0.0.1:8005 *:*
root java 8660 8 tcp4 *:8009 *:*
root java 8660 10 tcp4 127.0.0.1:8005 *:*
root java 8659 8 tcp4 *:8009 *:*
root java 8659 10 tcp4 127.0.0.1:8005 *:*
root java 8658 8 tcp4 *:8009 *:*
root java 8658 10 tcp4 127.0.0.1:8005 *:*
root java 8657 8 tcp4 *:8009 *:*
root java 8657 10 tcp4 127.0.0.1:8005 *:*
root java 8656 8 tcp4 *:8009 *:*
root java 8656 10 tcp4 127.0.0.1:8005 *:*
root java 8655 8 tcp4 *:8009 *:*
root java 8655 10 tcp4 127.0.0.1:8005 *:*
root java 8654 8 tcp4 *:8009 *:*
root java 8654 10 tcp4 127.0.0.1:8005 *:*
root java 8653 8 tcp4 *:8009 *:*
root java 8653 10 tcp4 127.0.0.1:8005 *:*
root java 8652 8 tcp4 *:8009 *:*
root java 8652 10 tcp4 127.0.0.1:8005 *:*
root java 8649 8 tcp4 *:8009 *:*
root java 8649 10 tcp4 127.0.0.1:8005 *:*
root java 8648 8 tcp4 *:8009 *:*
root java 8648 10 tcp4 127.0.0.1:8005 *:*
root java 8647 8 tcp4 *:8009 *:*
root java 8647 10 tcp4 127.0.0.1:8005 *:*
root java 8646 8 tcp4 *:8009 *:*
root java 8646 10 tcp4 127.0.0.1:8005 *:*
root java 8645 8 tcp4 *:8009 *:*
root java 8645 10 tcp4 127.0.0.1:8005 *:*
root java 8644 8 tcp4 *:8009 *:*
root java 8644 10 tcp4 127.0.0.1:8005 *:*
root java 8643 8 tcp4 *:8009 *:*
root java 8643 10 tcp4 127.0.0.1:8005 *:*
root java 8642 8 tcp4 *:8009 *:*
root java 8642 10 tcp4 127.0.0.1:8005 *:*
root java 8641 8 tcp4 *:8009 *:*
root java 8641 10 tcp4 127.0.0.1:8005 *:*
root java 8638 8 tcp4 *:8009 *:*
root java 8638 10 tcp4 127.0.0.1:8005 *:*
 
Back
Top