IDependOn-Set: 1
IDependOn-Set: 13
IDependOn-Set: 15
IDependOn-Set: 2
IDependOn-Set: 302
IDependOn-Set: 303
IDependOn-Set: 310
LastModifiedSecs: 937339307
Parent: 15
SequenceNumber: 3
Title: Installing Apache JServ 1.0 on Stronghold 2.4.2
Part: 0
Author-Set: ako204@nyu.edu
LastModifiedSecs: 937339307
Type: monospaced
Lines: 124
Installing Apache JServ 1.0 on Stronghold 2.4.2
-----------------------------------------------

 1. Install JDK 1.2 {JDK} and JSDK 2.0 {JSDK}

 2. Install Stronghold 2.4.2 into {ServerRoot}
         chown root:normgroup {ServerRoot} [NOTE: normgroup is the group of a normal user]
         chmod 771 {ServerRoot}

 3. Install Stronghold 2.4.2 patch to allow recompilation

    a. cd {ServerRoot}/src/main
       Edit Makefile.tmpl
       Change line 36: $(CC) $(CFLAGS) $(LDFLAGS) -o gen_uri_delims gen_uri_delims.o $(LIBS)
                        to: $(CC) $(CFLAGS) $(LDFLAGS) -o gen_uri_delims gen_uri_delims.o
            Change line 42: $(CC) $(CFLAGS) $(LDFLAGS) -o gen_test_char gen_test_char.o $(LIBS)
                        to: $(CC) $(CFLAGS) $(LDFLAGS) -o gen_test_char gen_test_char.o

    b. cd {ServerRoot}/src
            Edit Configure
            NOTE: This part of the patch contains subsequent spaces and thusly does not show up correctly 
             in an HTML file - please very with the Source file referenced below.
         Change line 1822: sed -e 's;[     ]\([+-]\);!\1;g' -e 's/\\\"/\"/g' -e 's/\([^\\]\)"/\1/g'`
                          to: sed -e 's;[     ]\([+-]\);!\1;g' -e 's/\([^\\]\)"/\1/g' -e 's/\\\"/\"/g'`
       [SOURCE: http://www.c2.net/support/sh2/sh242.patch]

 4. Run 'Configure' just to check if the patch syntax is OK

 5. Install Apache JServ 1.0 into {ApacheJServ} (i.e. /usr/local/src/ApacheJServ-1.0)

 6. Install Apache JServ 1.0 patch
    cd {ApacheJServ}
    Edit configure
    Change line 2848: apache_include="-I${withval}/src/include -I${withval}/src/os/unix"
                  to: apache_include="-I${withval}/src/include -I${withval}/src/os/unix -I${withval}/ssl/include"

 7. Run configure as follows:
    ./configure --with-apache-src={ServerRoot}
                --with-jsdk={JSDK}/lib/jsdk.jar
                --prefix={ServerRoot}/jserv
    [NOTE: {ServerRoot} is the top level of Stronghold installation, not src directory]

 8. Run 'make'
    Run 'make install'

 9. cd {ServerRoot}/src
    Edit Configuration
    Add 'AddModule modules/jserv/mod_jserv.o' at the end of the file, but before the SSL module
    Run 'Configure'

10. Install additional patch not included in Stronghold 2.4.2 patch
    Edit Makefile
    Change line 28: EXTRA_LIBS=-L../ssl/lib -L../../ssl -Lmodules/extra -L../modules/extra -lphp
                to: EXTRA_LIBS=-L../ssl/lib -L../../ssl/lib -Lmodules/extra -L../modules/extra -lphp
    Change line 81: -o $(TARGET) buildmark.o $(OBJS) $(REGLIB) $(LIBS)
                to: -o $(TARGET) buildmark.o $(OBJS) $(REGLIB) ../ssl/lib/libssl.a ../ssl/lib/libcrypto.a $(LIBS)

11. Run 'make'
    cp {ServerRoot}/httpsd {ServerRoot}/httpsd.bak
         mv httpsd {ServerRoot}
         cd {ServerRoot}
         chmod 755 httpsd

12. cd {ServerRoot}/jserv
    mkdir conf
         cd conf

13. cp {ApacheJServ}/example/jserv.conf .
         cp {ApacheJServ}/example/jserv.properties .
    cp {ApacheJServ}/example/example.properties .

14. Edit jserv.conf
         Change ApJServProperties to: 
            {ServerRoot}/jserv/conf/jserv.properties
         Change ApJServLogFile to: 
            {ServerRoot}/jserv/conf/mod_jserv.log [NOTE: Make sure to use mod_jserv.log and not jserv.log]

15. Edit jserv.properties
    Add a line to wrapper.bin.parameters:
            wrapper.bin.parameters="-verbose"
         Change wrapper.classpath to:
       wrapper.classpath={ServerRoot}/jserv/lib/ApacheJServ.jar
    Change example.properties to:
            example.properties={ServerRoot}/jserv/conf/example.properties
         Change log to:
            log=true
         Change log.file to:
            log.file={ServerRoot}/jserv/conf/jserv.log

16. Edit example.properties
    Change repositories to:
            repositories={ServerRoot}/jserv/example

17. cd {ServerRoot}/jserv
    mkdir example
         cd example
         cp {ApacheJServ}/example/Hello.* .
         chown root:group Hello.* [NOTE: group is the group that Stronghold runs as]
         chmod 664 Hello.*
         cd {ServerRoot}/jserv/conf
         chown normuser:normgroup * [NOTE: normuser:normgroup is the user:group of a normal user]
         chmod 755 *
         cd {ServerRoot}/jserv/lib
         chown root:group * [NOTE: group is the group that Stronghold runs as]
         chmod 775 *
         cd {ServerRoot}/jserv
    chown normuser:normgroup * [NOTE: normuser:normgroup is the user:group of a normal user]
         chmod 755 *
         chown root:group conf [NOTE: group is the group that Stronghold runs as]
         chmod 777 conf

18. cd {ServerRoot}
    chown root:normgroup jserv [NOTE: normgroup is the group of a normal user]
    chmod 755 jserv

19. cd {ServerRoot}/conf
    Edit httpd.conf
         Add 'Include {ServerRoot}/jserv/conf/jserv.conf' on the last line

20. cd {ServerRoot}/bin
    Run 'stop-server'
    Run 'start-server'

21. Browse to http://localhost/example/Hello
EndPart: 0
