Well the problem is now fixed and the WebServer is ok. A few teething problems on the build but all is working Are there any problems with the Server in general that anyone has found ? I wish to create servlets and connections to Oracle via jdbc. Many thanks Matt --------------------------------------------------------------------- Below are the files for future ref if anyone needs them. --------------------------------------------------------------------- ################################################### # @(#)Makefile.sol 1.11 97/11/06 # # Solaris-specific makefile for building optional native library support. # Use this as a starting point for porting to other UNIX platforms. # REMEMBER THE TABS BETWEEN THE $ signs. # # Path to top of Java Web Server distribution tree TOP = .. # Name of the library we're making (given to System.loadLibrary) LIBNAME = server # Location of Java Developer's Kit (and runtime) JAVA_HOME=<Java jdk home dir maybe 1.1.7> # Java runtime flags JAVAH=$(JAVA_HOME)/bin/javah CLASSPATH=$(TOP)/classes:$(TOP)/lib/classes.zip:$(JAVA_HOME)/classes:$(JAVA_HOME )/lib/classes.zip # OS and machine type OS = genunix ARCH = unknown OBJ = $(OS)/$(ARCH) # Preprocessor, compiler, linker, and related flags CC = cc CFLAGS = -shared -fPIC CPPFLAGS = -I$(OS) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(OS) LDFLAGS = #-G -h $(LIBNAME) INSTALL = /usr/bin/install LIBDIR = $(TOP)/lib/$(OBJ) LIBRARY = $(OBJ)/lib$(LIBNAME).so OBJS = $(OBJ)/server.o \ $(OBJ)/UNIXUser.o \ $(OBJ)/UNIXUserEnumeration.o \ $(OBJ)/com_sun_server_ServerProcess.o \ $(OBJ)/com_sun_server_realm_unix_UNIXUser.o \ $(OBJ)/com_sun_server_realm_unix_UNIXUserEnumeration.o default all: $(LIBRARY) $(LIBRARY): $(OBJS) $(LINK.c) -o $@ $(OBJS) $(OBJ)/server.o: server.c $(OS)/com_sun_server_ServerProcess.h $(COMPILE.c) -o $@ server.c $(OBJ)/UNIXUser.o: UNIXUser.c $(OS)/com_sun_server_realm_unix_UNIXUser.h $(COMPILE.c) -o $@ UNIXUser.c $(OBJ)/UNIXUserEnumeration.o: UNIXUserEnumeration.c \ $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.h $(COMPILE.c) -o $@ UNIXUserEnumeration.c $(OBJ)/com_sun_server_ServerProcess.o: $(OS)/com_sun_server_ServerProcess.c $(COMPILE.c) -o $@ $(OS)/com_sun_server_ServerProcess.c $(OS)/com_sun_server_ServerProcess.c: $(JAVAH) -d $(OS) -classpath $(CLASSPATH) -stubs com.sun.server.ServerProcess $(OS)/com_sun_server_ServerProcess.h: $(JAVAH) -d $(OS) -classpath $(CLASSPATH) com.sun.server.ServerProcess $(OBJ)/com_sun_server_realm_unix_UNIXUser.o: $(OS)/com_sun_server_realm_unix_UNIXUser.c $(COMPILE.c) -o $@ $(OS)/com_sun_server_realm_unix_UNIXUser.c $(OS)/com_sun_server_realm_unix_UNIXUser.c: $(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ -stubs com.sun.server.realm.unix.UNIXUser $(OS)/com_sun_server_realm_unix_UNIXUser.h: $(JAVAH) -d $(OS) -classpath $(CLASSPATH) com.sun.server.realm.unix.UNIXUser $(OBJ)/com_sun_server_realm_unix_UNIXUserEnumeration.o: \ $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c $(COMPILE.c) -o $@ $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c: $(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ -stubs com.sun.server.realm.unix.UNIXUserEnumeration $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.h: $(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ com.sun.server.realm.unix.UNIXUserEnumeration install: $(LIBRARY) $(INSTALL) -d $(LIBDIR) $(INSTALL) -c $(LIBRARY) $(LIBDIR) clean: rm -rf $(OS) .INIT: -@mkdir -p $(OBJ) .KEEP_STATE: -------------------------------------------------------------------------------- ------- /* * @(#)UNIXUserEnumeration.c 1.4 97/09/09 * * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. * * CopyrightVersion 1.0 */ #include <pwd.h> #include "com_sun_server_realm_unix_UNIXUserEnumeration.h" /* * Native methods supporting the enumeration of user names. * * This uses the standard UNIX/POSIX calls for accessing * such names. Most systems also have APIs for modifying * the database of such user acounts, but they're not at * all portable. */ void com_sun_server_realm_unix_UNIXUserEnumeration_setpwent ( struct Hcom_sun_server_realm_unix_UNIXUserEnumeration *this ) { /* * NOTE: the POSIX (and even Solaris) APIs have a flaw in * that they only allow one such enumeration to go on in a * process at a time ... we really can't do anything about * it in a robust way. Problem #1 is telling when "the" * active enumeration is done, so we could allow another. */ setpwent (); } struct Hjava_lang_String * com_sun_server_realm_unix_UNIXUserEnumeration_getNextUserName ( struct Hcom_sun_server_realm_unix_UNIXUserEnumeration *this ) { char buf [BUFSIZ]; struct passwd value; #ifdef __GLIBC__ if (getpwent_r (&value, buf, sizeof buf, NULL) == 0) #else if (getpwent_r (&value, buf, sizeof buf) == 0) #endif return 0; } -------------------------------------------------------------------------------- ---- (above is the UNIXUserEnumeration.c file) -------------------------------------------------------------------------------- ---- /* * @(#)UNIXUser.c 1.5 97/09/09 * * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. * * CopyrightVersion 1.0 */ #include <crypt.h> #include <pwd.h> #include <string.h> #include "com_sun_server_realm_unix_UNIXUser.h" void com_sun_server_realm_unix_UNIXUser_loadFromPasswd ( struct Hcom_sun_server_realm_unix_UNIXUser *this ) { char *logname; struct passwd value; char buf [BUFSIZ]; logname = makeCString (unhand (this)->user); #ifdef __GLIBC__ if (getpwnam_r (logname, &value, buf, sizeof buf, NULL) == 0) { #else if (getpwnam_r (logname, &value, buf, sizeof buf) == 0) { #endif /* * setting homedir or passwd to null indicates an error, * and the caller throws an exception */ unhand (this)->homedir = 0; unhand (this)->passwd = 0; } else { unhand (this)->homedir = makeJavaString (value.pw_dir, strlen (value.pw_dir)); unhand (this)->passwd = makeJavaString (value.pw_passwd, strlen (value.pw_passwd)); /* * NOTE: this doesn't do "shadow password" lookups. * Some sites hide their "real" password data. */ } } long com_sun_server_realm_unix_UNIXUser_checkCrypt ( struct Hcom_sun_server_realm_unix_UNIXUser *this, struct Hjava_lang_String *password ) { char *plaintext; char *ciphertext; char *computed; plaintext = makeCString (password); ciphertext = makeCString (unhand (this)->passwd); computed = crypt (plaintext, ciphertext); /* free (plaintext); free (ciphertext); */ return strcmp (computed, ciphertext) == 0; /* * NOTE: this doesn't look up the passphrase again; in some * environments, caching at this level may be undesirable. * * To avoid the caching, look it up ... and if the users's * been deleted, return some value like "-1" (not zero or one). */ } -------------------------------------------------------------------------------- ----- (above is the UNIXUser.c) -------------------------------------------------------------------------------- ----- #!/bin/sh # # @(#)java-server.startup 1.13 97/10/29 # # Copyright (c) 1996-1997 Sun Microsystems, Inc. All Rights Reserved. # # This software is the confidential and proprietary information of Sun # Microsystems, Inc. ("Confidential Information"). You shall not # disclose such Confidential Information and shall use it only in # accordance with the terms of the license agreement you entered into # with Sun. # # SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE # SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR # PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES # SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING # THIS SOFTWARE OR ITS DERIVATIVES. # ###### # # There are some dependencies on the JavaSoft VM's use of # variables like CLASSPATH, and command line options like -noasyncgc. # You will probably have to tailor these types of things to fit your VM. # # After it is correctly set up, this script starts/stops the JavaWebServer # process as part of normal UNIX system operation, using the conventions # for scripts found in the /etc/rc.3 directory. # # To set it up, first issue these commands as root: # # # cp java-server.startup /etc/rc3.d/S42jserv # # cd /etc/rc3.d # # chmod +x S42jserv # # ln S42jserv K42jserv # # Then edit S42jserv and set the configuration variables listed below. # When those variables are correctly set up, configuration is complete. # # At this point, without rebooting, you should test your configuration. # # To test this, start the server manually by typing "./S42jserv start". # You'll know it's configured correctly if: [a] your browser can talk # to this web server on the correct port; and [b] it is running with the # correct User ID (check with "ps"). # # If you notice a configuration mistake, type "./K42jserv stop", fix # the configuration, and retest. Repeat as needed. # # SECURITY NOTE: To run this release on UNIX as some other UID # than "root" (as the server is started), you need a native code # library. Source is in the "native" directory of the release, # and a compiled Solaris library is part of the release. # # You should not run this server (or any other software) as root # when that conflicts with your site's security policies. # # Each server process can run as a specific user. Change the # server.properties file in the # # $JSERV_HOME/properties/server/<server_name>/server.properties # # file so that server.user and server.group indicate UNIX user IDs that # the web server should run under, rather than "root". # # JavaWebServer processes runs as "root" for only a very short time before # it runs under those identities; in particular, no servlet code is run # under the startup user and group IDs (e.g. root/other) when those # properties are used to control server identity. # # If any server process runs as "root" the administration server must # run as root, because it is responsible for starting and stopping the # additional server processes. # ###### START OF STUFF YOU NEED TO CONFIGURE # # Installation MUST set these variables: # # JSERV_HOME Location of the JavaWebServer distribution # JSERV_HOME=/var/JavaWebServer1.1.3 # You can also set these variables: # # USE_JRE Set to "jre" to use internal JRE instead of JDK, "nojre" # otherwise # JAVA_HOME Location of the Java executable, $JAVA_HOME/bin/java, required # if USE_JRE is "nojre" # CLASSPATH Additional settings for CLASSPATH # THREADS_TYPE Type of threads (green or native) # SSL_HOME Location of SSL distribution # USE_JRE=nojre #CLASSPATH= export JAVA_HOME=<Dir of the jdk> # THREADS_TYPE=native THREADS_TYPE=green SSL_HOME= JSERV_HOME=<root dir where jws is>/JavaWebServer1.1.3 # ###### END OF STUFF YOU NEED TO CONFIGURE #export JAVA_HOME # error "description" error () { echo $0: $* 2>&1 exit 1 } # find the named process(es) findproc() { # pid=`/bin/ps -ef | # /usr/bin/grep -w $1 | # /usr/bin/grep -v norestart | # /usr/bin/grep -v grep | # /usr/bin/awk '{print $2}'` # echo $pid pid=`/bin/ps aux | /usr/bin/grep -w $1 | /usr/bin/grep -v norestart | /usr/bin/grep -v grep | /usr/bin/awk '{print $2}'` echo $pid } # kill the named process(es) (borrowed from S15nfs.server) killproc() { pid=`findproc $1` [ "$pid" != "" ] && kill $pid } # # require /usr/bin and JavaWebServer # if [ ! -d /usr/bin ]; then error "Cannot find /usr/bin." elif [ ! -d "$JSERV_HOME" ]; then error "Cannot find JavaWebServer in JSERV_HOME ($JSERV_HOME)." fi # # Start/stop Java JSERV server, following normal conventions for # scripts found in /etc/rc3.d ... install this into that directory # as the file "S42jserv" and link that to "K42jserv", and this server # will start automatically when entering runlevel 3 (networked with # exported services) and will stop when leaving that runlevel. # case "$1" in 'start') # Avoid exporting the modified path ... just use it to exec. PATH=$JAVA_HOME/bin:$PATH SSL_ARG= if [ -n "$SSL_HOME" ]; then SSL_ARG="-ssl $SSL_HOME" fi JAVA_HOME_ARG= if [ "$USE_JRE" = "nojre" ]; then JAVA_HOME_ARG="-javahome $JAVA_HOME" fi HTTPD_CLASSPATH="lib/jws.jar:lib/javac.jar" if [ -n "$CLASSPATH" ]; then HTTPD_CLASSPATH="$HTTPD_CLASSPATH:$CLASSPATH" fi cd $JSERV_HOME # Check if the server is already running. if [ -n "`findproc jserv`" ]; then echo "JavaWebServer is already running." exit 0 fi bin/jserv -$USE_JRE $JAVA_HOME_ARG -classpath $HTTPD_CLASSPATH \ # -threads $THREADS_TYPE $SSL_ARG & -threads $THREADS_TYPE $SSL_ARG -os genunix -arch unknown & ;; 'stop') # If a graceful shutdown is possible jserv will do it. killproc jserv ;; *) echo "Usage: $0 { start | stop }" ;; esac -------------------------------------------------------------------------------- ------ (above is the java-server.startup file). -------------------------------------------------------------------------------- ------ ---------------------------------------------------------------------- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]