Japanese | English
[ImageSearcher for Java] [Manuals] [Installation]

Installing "ImageSearcher for Web" on Linux Server

  1. System Environment

  2. Installing J2SDK

    First, you will need to install Java2 Software Development Kit (J2SDK) 1.4. J2SDK are both available at no cost from Blackdown.org or java.sun.com.

    Download J2SDK appropriate for your Linux.

    Some of the Linux distributions might have J2SDK ready beforehand. In that case, you don't have to re-install J2SDK. To install J2SDK 1.4.0 on RedHat Linux 7.1J, you may use the following commands.

    $ su
    # cd /usr/local/
    # $ARCHIVES_DIR/j2sdk-1_4_0-linux-i386.bin
    
  3. Installing Apache

    Install Apache HTTP Server 1.3 or later version. Apache HTTP Server can be downloaded from Apache Software Foundation Homepage for free.

    Please follow the INSTALL instruction to install. To install Apache1.3.20 on RedHat Linux 7.1J, you may use the following commands.

    $ su
    # cd /usr/local/src
    # tar xvfz $ARCHIVES_DIR/apache_1.3.20.tar.gz
    # cd apache_1.3.20
    # OPTIM="-O2" ./configure --enable-module=so
    # make
    # make install
    # /usr/local/apache/bin/apachectl start
    
  4. Installing Jakarta Tomcat

    Install Jakarta Tomcat 3.2 or later version. Jakarta Tomcat can be downloaded from The Jakarta Project Homepage for free.

    Please follow the README instruction to install Jakarta Tomcat and mod_jk.so. To install Jakarta Tomcat 3.2.3 on RedHat Linux 7.1J, you may use the following commands.

    $ su
    # cd /usr/local/src/
    # unzip $ARCHIVES_DIR/jsse-1_0_2-gl.zip
    # unzip $ARCHIVES_DIR/jaxp-1_0_1.zip
    # mv jaxp1.0.1 jaxp-1.0.1
    # tar xvfz $ARCHIVES_DIR/jakarta-ant-1.3-src.tar.gz
    # tar xvfz $ARCHIVES_DIR/jakarta-servletapi-3.2.3-src.tar.gz
    # tar xvfz $ARCHIVES_DIR/jakarta-tomcat-3.2.3-src.tar.gz
    # export JAVA_HOME=/usr/local/j2sdk1.4.0
    # export APACHE_HOME=/usr/local/apache
    # export PATH=$PATH:$JAVA_HOME/bin
    # export CLASSPATH=/usr/local/src/jaxp-1.0.1/jaxp.jar:/usr/local/src/jaxp-1.0.1/parser.jar:/usr/local/src/jsse1.0.2/lib/jsse.jar:/usr/local/src/jsse1.0.2/lib/jnet.jar:/usr/local/src/jsse1.0.2/lib/jcert.jar:$CLASSPATH
    # cd /usr/local/src/jakarta-ant-1.3
    # ./build.sh -Ddist.dir=/usr/local/src/jakarta-ant dist
    # export ANT_HOME=/usr/local/src/jakarta-ant
    # cd /usr/local/src/jakarta-ant/bin
    # chmod 755 ant antRun
    # chmod 644 ../lib/*.jar
    # cd /usr/local/src/jakarta-servletapi-3.2.3-src
    # chmod 755 build.sh
    # ./build.sh dist
    # cd /usr/local/src/jakarta-tomcat-3.2.3-src
    # chmod 755 build.sh
    # ./build.sh -Dservlet.jar=../dist/servletapi/lib/servlet.jar dist
    # cd /usr/local/src/jakarta-tomcat-3.2.3-src/src/native/apache1.3/
    # $APACHE_HOME/bin/apxs -o mod_jk.so -I../jk -I$JAVA_HOME/include -I$JAVA_HOME/include/linux -c *.c ../jk/*.c
    # cp mod_jk.so $APACHE_HOME/libexec
    # mv /usr/local/src/build/tomcat /usr/local/tomcat
    # /usr/local/tomcat/bin/tomcat.sh start
    
  5. Installing PostgreSQL

    Install PostgreSQL 7.1 or later version. PostgreSQL can be downloaded fromPostgreSQL Homepage for free.

    Pease follow the README instruction to install PostgreSQL and JDBC driver. To install PostgreSQL 7.1.3 on RedHat Linux 7.1J, you may use the floowing commands.

    $ su
    # adduser postgres
    # mkdir /usr/local/pgsql
    # mkdir /usr/local/src/postgresql-7.1.3
    # chown postgres /usr/local/pgsql
    # chown postgres /usr/local/src/postgresql-7.1.3
    # su postgres
    $ export ANT_HOME=/usr/local/src/jakarta-ant
    $ export JAVA_HOME=/usr/local/j2sdk1.4.0
    $ export PATH=$PATH:$ANT_HOME/bin
    $ cd /usr/local/src/
    $ tar xvfz $ARCHIVES_DIR/postgresql-7.1.3.tar.gz
    $ cd postgresql-7.1.3
    $ ./configure --enable-multibyte=EUC_JP --enable-syslog --with-java
    $ make
    $ make check
    $ make install
    $ vi ~/.bashrc
    
    Add the following at the end of ~/.bashrc.
    export PATH="$PATH":/usr/local/pgsql/bin
    PG=/usr/local/pgsql
    export PGLIB=$PG/lib
    export PGDATA=$PG/data
    export MANPATH="$MANPATH":$PG/man
    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"$PGLIB"
    
    $ source ~/.bashrc
    $ initdb
    $ vi /usr/local/pgsql/data/postgresql.conf
    
    Edit postgresql.conf as below.
    ...
    
    #
    #       Connection Parameters
    #
    tcpip_socket = true
    ...
    
    $ postmaster &
    
  6. Installing "ImageSearcher for Java"

    Install "ImageSearcher for Java 023b". The newest version can be downloaded from SRA FTP server. For infomation on the downloaded file, please see "Installing on Linux".

    When installing "ImageSearcher for Java" to /usr/local/isr4java, you may use the following commands.

    $ su
    # mkdir /usr/local/isr4java
    # chown $USER_NAME /usr/local/isr4java
    # exit
    $ cd /usr/local/isr4java
    $ unzip -a $ARCHIVES_DIR/Isr023b.zip
    
  7. Installing JIMI Software Development Kit/Java Advanced Imaging API

    Install Sun Microsystems's JIMI Software Development Kit, or Java Advanced Imaging API. JIMI Software Development Kit and Java Advanced Imaging API can be downloaded from Sun Microsystems's Java Technology Homepage for free.

    Install JIMI Software Development Kit/Java Advanced Imaging API to the lib directory of "ImageSearcher for Java".

    To install JIMI Software Development Kit, please install by using the following commands.

    $ unzip $ARCHIVES_DIR/jimi1_0.zip
    $ cp Jimi/JimiProClasses.zip /usr/local/isr4java/lib
    

    To install Java Advanced Imaging API, please install by using the following commands.

    $ tar xvfz $ARCHIVES_DIR/jai1_0_2-lib-solaris.tar.gz
    $ cp jre/lib/ext/*.jar /usr/local/isr4java/lib
    
  8. Installing com.oreilly.servlet

    Install com.oreilly.servlet. com.oreilly.servlet can be downloaded from Servlets.com Homepage for free.

    Install com.oreilly.servlet to the lib directory of "ImageSeacher for Java". Please install by using the following commands.

    $ unzip $ARCHIVES_DIR/cos-27May2002.zip
    $ cp lib/cos.jar /usr/local/isr4java/lib
    
  9. Create the database of ImageSearcher

    Create database for "ImageSearcher for Web" on PostgreSQL. In this example, "isr" are used for database name, user name, and user password. Please use the following commands to create the database.

    $ su
    # su postgres
    $ createuser --password isr
    Shall the new user be allowed to create databases? (y/n) y
    Shall the new user be allowed to create more new users? (y/n) n
    Password: isr
    CREATE USER
    $ createdb -U isr isr
    CREATE DATABASE
    $ psql isr isr < /usr/local/isr4java/sql/pgsql/image_searcher.sql
    ERROR:  table "image_searcher" does not exist
    ERROR:  table "image_searcher" does not exist
    ERROR:  sequence "image_searcher_pkey_seq" does not exist
    ERROR:  sequence "image_searcher_pkey_seq" does not exist
    CREATE
    NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index 'pk_image_searcher' for table 'image_searcher'
    NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index 'pk_image_searcher' for table 'image_searcher'
    CREATE
    CHANGE
    CHANGE
    
  10. Installing "ImageSearcher for Web"

    Install "ImageSearcher for Web"(the Servlet application of "ImageSearcher for Java") by using the following commands.

    $ cp /usr/local/pgsql/share/java/postgresql.jar /usr/local/isr4java/lib
    $ cd /usr/local/isr4java/src
    $ make install-web
    

    Set the parameters for ImageSearcher database. If you installed as written in this manual, you do not have to edit.

    $ vi /usr/local/isr4java/webapps/WEB-INF/isr.properties
    
    Editable parameters are as follows.
    Parameter NameDescription
    database.classnameDatabase class name(please do not change)
    database.urlURL of ImageSearcher database
    database.userUser name of ImageSearcher database
    database.passwordPassword of ImageSearcher database
    database.minConnectionSizeThe minimum size of connection pool(greater than 0)
    database.maxConnectionSizeThe maximum size of connection pool(greater than 1)
    database.jdbc.driverThe name of JDBC driver class
    database.jdbc.batchSizeThe batch size of JDBC driver
  11. Configuration for Jakarta Tomcat

    Set up "ImageSearcher for Web" settings in Jakarta Tomcat, and restart Jakarta Tomcat. You may do so by using the following commands.

    $ su
    # vi /usr/local/tomat/conf/server.xml
    
    Add the command below as server.xml's <ContextManager>tag element
    ...
    
     <!-- Apache AJP13 support -->
     <Connector className="org.apache.tomcat.service.PoolTcpConnector">
         <Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp13ConnectionHandler"/>
         <Parameter name="port" value="8009"/>
     </Connector>
    
    ...
    
     <!-- ImageSearcher for Web -->
     <Context path="/ImageSearcher"
         docBase="/usr/local/isr4java/webapps"
         crossContext="false"
         debug="0"
         reloadable="false"
         trusted="false" >
     </Context>
    
    ...
    
    # export JAVA_HOME=/usr/local/j2sdk1.4.0
    # /usr/local/tomcat/bin/tomcat.sh stop
    # /usr/local/tomcat/bin/tomcat.sh start
    
  12. Configuration for Apache

    Set Apache and Jakarta Tomcat in way that the two work together, and restart Apache. You may do so by using the following commands.

    $ su
    # cp /usr/local/tomcat/conf/mod_jk.conf-auto /usr/local/apache/conf/mod_jk.conf-isr
    # vi /usr/local/apache/conf/mod_jk.conf-isr
    
    Edit mod_jk.conf-isr as below.
    ...
    #########################################################
    # Auto configuration for the /ImageSearcher context starts.
    #########################################################
    
    #
    # The following line makes apache aware of the location of the /ImageSearcher context
    #
    Alias /ImageSearcher "/usr/local/isr4java/webapps"
    <Directory "/usr/local/isr4java/webapps">
        Options Indexes FollowSymLinks
    </Directory>
    
    #
    # The following line mounts all JSP files and the /servlet/ uri to tomcat
    #
    JkMount /ImageSearcher/servlet/* ajp13
    JkMount /ImageSearcher/*.jsp ajp13
    JkMount /ImageSearcher/ImageSearcher ajp13
    JkMount /ImageSearcher/GetOriginalImage ajp13
    JkMount /ImageSearcher/GetThumbnailImage ajp13
    
    #
    # The following line prohibits users from directly accessing WEB-INF
    #
    <Location "/ImageSearcher/WEB-INF/">
        AllowOverride None
        deny from all
    </Location>
    
    #
    # The following line prohibits users from directly accessing META-INF
    #
    <Location "/ImageSearcher/META-INF/">
        AllowOverride None
        deny from all
    </Location>
    
    #######################################################
    # Auto configuration for the /ImageSearcher context ends.
    #######################################################
    ...
    
    # vi /usr/local/apache/conf/httpd.conf
    
    Add the following at the end of httpd.conf.
    #
    # Jakarta Tomcat configurations for "ImageSearcher for Web"
    #
    Include /usr/local/apache/conf/mod_jk.conf-isr
    
    # /usr/local/apache/bin/apachctl restart
    
  13. Open "ImageSearcher for Web" in browser.

    When you open http://localhost/ImageSearcher/ in browser, you will see the top page of "ImageSearcher for Web"

 

*You may use Oracle8i as database. Please see the programs for more details.

NoteFCommand written in 9 will be like the one written below.

$ su
# su oracle
$ sqlplus system/manager < /usr/local/isr4java/sql/oracle/user.sql
$ sqlplus isr/isr < /usr/local/isr4java/sql/oracle/image_searcher.sql

* To operate "ImageSearcher for Web" server application with J2SDK 1.3.1 or lower. In this case, you need to run on X Windows System, or set DISPLAY variable.


translated by : Keiko Kondo