Fedora 13 インストールメモ 2010.08.10 (JAVA Servlet JSP JDBC XML UTF-8 環境)#
Linux Fedora 13
sun jdk 1.6.0_20 NetBeans 6.9
jakarta-tomcat-5.5.9
jakarta-Struts-1.1
apache-2.0.53 SSL
postgresql-8.0.2
Java Web Start 1.5.0
Axis-1.2

## tomcat-5.5.9 JDK-1.6.0-20 Struts1.1
Fedora 13 i686 KDE

LANカードIPアドレス192.168.1.78

# adduser XXXuser
# adduser postgres
 
rootでGUIログインを許可する
# vi rootlogin.sh
# chmod 755 rootlogin.sh
# su
#./rootlogin.sh

rootでログイン時にGUIログインを不許可する
# vi /root/rootlogout.sh
# vi /root/.bash_profile

javaに関係ない参考まで
flash-plugin-10.1.53.64-release.i386.rpm
livna-release.rpm
rpmfusion-free-release-stable.noarch.rpm
rpmfusion-nonfree-release-stable.noarch.rpm

KPackageKitでインストール
SoftwareManagement
Find by name --> xemacs
Find by name --> Fontmatrix
Find by name --> ttmkfdir
Find by name --> ttf-batang
Find by name --> ttf-gulim
Find by name --> dejavu-lgc (mono sans serif)
Find by name --> ipa-ex (mincho gothic)
Find by name --> ipa-pm
Find by name --> ipa-pg
Find by name --> ipa-m
Find by name --> ipa-g
Find by name --> sazanami- (mincho gothic mona)
Find by name --> uming

フォントの追加 java <-> x11 日本語
Fdedora 13 標準インストールフォントの一部を集めjava用フォントに互換のため --> /usr/share/fonts/javafonts6
# su
# emacs font_atume.sh
# chmod 755
font_atume.sh
# ./font_atume.sh

JDKフォントの追加 -->
/usr/share/fonts/javafonts6
(sun jdk添付fonts JAVA_HOME/jre/lib/fonts and /oblique-fontsにある)
LucidaBrightDemiBold.ttf
LucidaBrightDemiItalic.ttf
LucidaBrightItalic.ttf
LucidaBrightRegular.ttf
LucidaSansDemiBold.tt
LucidaSansDemiOblique.tt
LucidaSansOblique.ttf
LucidaSansRegular.ttf
LucidaTypewriterBold.ttf
LucidaTypewriterBoldOblique.ttf
LucidaTypewriterOblique.ttf
LucidaTypewriterRegular.ttf

CJKフォントの追加(多言語unicode font 外国語表示用
無くても可) --> /usr/share/fonts/javafonts6
tnrwt_j.ttf (IBM jdk)
soui.ttf (Star Suite)
CyberCJK.ttf (netscape)

言語フォントの追加 --> /usr/share/fonts/javafonts6/Multilingual
TagStyle.ttf (Tagalog TagStyle.ZIP) website
Cyberbit.ttf (Cyberbit.ZIP)
damase_v.2.ttf (Thaana Cherokee Limbu damase_v.2.zip) website
SyrCOMMardin.ttf (Syriac melthofonts-1.21.tar.gz)
SyrCOMMardin.otf->FontForge->ttf website
mongs___.ttf (Mongolian mongol_font.tar.gz) website download
NuosuSIL.ttf (Yi Syllables Yi Radicals NuosuSIL2.1.1.zip) website
Euterpe.ttf (Musical Symbols ttf-oflb-euterpe_1.1-2_all.deb) website
Quivira.ttf (Runic Buhid Tagbanwa... ) website

その他多言語フォント参考

モナーフォントの追加 --> /usr/share/fonts/javafonts6
ipamp-mona.ttf (2ch AA) website
ipagp-mona.ttf

# cd
/usr/share/fonts/javafonts6
# ttmkfdir
# ttmkfdir -o fonts.dir
# cat fonts.dir

# cd /usr/share/fonts/javafonts6
/Multilingual
# ttmkfdir
# ttmkfdir -o fonts.dir
# cat fonts.dir

# cd
/usr/share/fonts/javafonts6
# ls -R

 

fontconfig/Xft2タイプ側の設定(new)
(Font Manager -> Edit -> Reload Filtered) or # fc-cache での設定
# fc-list | sort > fc-list.txt

X11 fontsystemタイプ側の設定(old)
# cd /etc/X11/fontpath.d
# ln -s /usr/share/fonts/javafonts6 ./java-fonts
# reboot
# xlsfonts > xlsfonts.txt

1.Java SE and NetBeans Cobundle (sun jdk 6u20 and NB 6.9)
jdk-6u20-nb-6_9-linux-ml.sh
download => /usr/local/src login:root # cd /usr/local/src # chmod 755 jdk-6u20-nb-6_9-linux-ml.sh # ./jdk-6u20-nb-6_9-linux-ml.sh
インストール(日本語フォントを探し日本語で表示?)

文字のギザギザで表示対策option追加
# emacs /usr/local/netbeans-6.9/etc/netbeans.conf
netbeans_default_options="-J-Dawt.useSystemAAFontSettings=on -J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true"

JDKがフォントを探す場所 (fontconfig.RedHat.propertiesで設定する場合は必要ない)
# su
# cd /usr/local/jdk1.6.0_20/jre/lib/fonts

# ln -s /usr/share/fonts/javafonts6 ./fallback


# emacs /etc/bashrc export JAVA_HOME=/usr/local/jdk1.6.0_20 # source /etc/bashrc # java -server -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6._20-b02) Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode) # cd $JAVA_HOME/jre/lib
# rm fontconfig.*
# emacs fontconfig.RedHat.properties.src
# mv fontconfig.RedHat.properties.src fontconfig.RedHat.properties
(emacs
文字列置換コマンド ESC x replace-string RET b&h RET jdk RET)
(emacs 文字列並び替えコマンド ESC x sort-lines RET)
 

# cd $JAVA_HOME/demo/jfc/Font2DTest # java -jar Font2DTest.jar
テスト
多言語テスト

参考 openjdk
JDKがフォントを探す場所 (fontconfig.Fedora.propertiesで設定する場合は必要ない)
# su
# cd /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib
# mkdir fonts
# cd ./fonts
# ln -s /usr/share/fonts/javafonts6 ./fallback

# emacs /etc/bashrc
export JAVA_HOME=
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0
# source /etc/bashrc
# java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8) (fedora-41.b18.fc13-i386)
OpenJDK Client VM (build 14.0-b16, mixed mode)

# cd $JAVA_HOME/jre/lib
# rm fontconfig.*
# emacs fontconfig.Fedora.properties.src

(行末にタブ スペースがあるとNG)
# mv fontconfig.Fedora.properties.src fontconfig.Fedora.properties

# cd $JAVA_HOME/demo/jfc/Font2DTest
# java -jar Font2DTest.jar
テスト Oriya Sinhala アボート

fontconfigバイナリー化
openjdk-6-jre-lib_6b20~pre1-2_all.deb アーカイブを展開compilefontconfig.jarを取り出し
# cd /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib
# java -jar compilefontconfig.jar fontconfig.Fedora.properties.src fontconfig.Fedora.bfc
# rm fontconfig.Fedora.properties
IPAMonaP IPAex IPAP Sazanami ほかバイナリーfontconfig.20100808.tar.gz

/usr/share/fonts/javafonts6用
fontconfig.RedHat.bfc Fedora 13 sun jdk用
fontconfig.Fedora.bfc
Fedora 13 openjdk用
テスト

簡易設定(Fedora 13 openjdk 日本語がでればいい)fontconfig.20100808.tar.gzをダウンロード
$ cd ダウンロード
$ tar xzvf fontconfig.20100808.tar.gz
$ cd fontconfig.20100808/VL_P
$ su
パスワード:
# mkdir /usr/share/fonts/javafonts6
# cp /usr/share/fonts/vlgothic/*.ttf /usr/share/fonts/javafonts6
# cp fontconfig.Fedora.bfc /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib
cp: `/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/fontconfig.Fedora.bfc' を上書きしてもよろしいですか(yes/no)? y
jdk includesでない方のNetBeans
netbeans-6.9.1-ml-linux.sh
   download => /usr/local/src
以下kouji
2.jakarta-tomcat-5.5.9 # mkdir /usr/local/jakarta # mkdir /usr/local/jakarta/src jakarta-tomcat-5.5.9.tar.gz download => /usr/local/jakarta/src jakarta-tomcat-5.5.9-admin.tar.gz download => /usr/local/jakarta/src jakarta-tomcat-5.5.9-src.tar.gz download => /usr/local/jakarta/src apache-ant-1.6.2-bin.tar.gz download => /usr/local/jakarta/src # cd /usr/local/jakarta # tar xzvf apache-ant-1.6.2-bin.tar.gz -C /usr/local/jakarta # cd /usr/local/jakarta/apache-ant-1.6.2 # ./bootstrap.sh # emacs /etc/ant.conf ANT_HOME=/usr/local/jakarta/apache-ant-1.6.2 # cd /usr/local/jakarta/src # tar xzvf jakarta-tomcat-5.5.9.tar.gz -C /usr/local/jakarta/ # tar xzvf jakarta-tomcat-5.5.9-admin.tar.gz -C /usr/local/jakarta/ # cd ../ # cp -a ./jakarta-tomcat-5.5.9 ./tomcat-5.5 # emacs /etc/bashrc export JAKARTA_HOME=/usr/local/jakarta export CATALINA_HOME=$JAKARTA_HOME/tomcat-5.5 export CATALINA_OPTS=-server # source /etc/bashrc # $CATALINA_HOME/bin/startup.sh http://192.168.1.78:8080/examples/servlets/index.html 動作してればメニュー画面からサンプルが動作する http://192.168.1.78:8080/examples/jsp/index.html 動作してればメニュー画面からサンプルが動作する ************************************************************************************************** jakarta-tomcat-5-src-20041231.tar.gz download => /usr/local/jakarta/src (79M) mx4j-2.1.0.tar.gz download => /usr/local/src jta-spec1_0_1.zip download => /usr/local/src javamail-1_3_2.zip download => /usr/local/src jaf-1_0_2-upd.zip download => /usr/local/src junit3.8.1.zip download => /usr/local/src Xerces-J-bin.2.6.2.tar.gz download => /usr/local/src
**************************************************************************************************
3.jakarta-Struts-1.2.6 (Model-View-Controller)
jakarta-struts-1.2.6.tar.gz                       download => /usr/local/jakarta/src

# cd /usr/local/jakarta/src
# tar xzvf jakarta-struts-1.2.6.tar.gz -C /usr/local/jakarta/
# cd ../
# cd ./jakarta-struts-1.2.6/webapps
# cp *.war /usr/local/jakarta/tomcat-5.5/webapps/

# $CATALINA_HOME/bin/shutdown.sh
# $CATALINA_HOME/bin/startup.sh
 
(template Test demo) 
 http://192.168.1.78:8080/struts-blank
 http://192.168.1.78:8080/struts-documentation
 http://192.168.1.78:8080/struts-example
 http://192.168.1.78:8080/struts-mailreader
 http://192.168.1.78:8080/tiles-documentation
4.apache-2.0.53 SSL MPM  Apache HTTP Server Project
httpd-2.0.53.tar.gz                                download => /usr/local/src  
openssl-0.9.7e.tar.gz ____________________________ download => /usr/local/src
jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz     download => /usr/local/src

# tar xzvf openssl-0.9.7e.tar.gz -C /usr/local/src

# cd /usr/local/src/openssl-0.9.7e
# ./config --prefix=/usr --openssldir=/usr/share/ssl -fPIC

# make
# make test
# make install

# openssl version -a
OpenSSL 0.9.7e
              
login:root                           
# cd /usr/local/src
# tar xzvf httpd-2.0.53.tar.gz -C /usr/local/src

# cd /usr/local/src/httpd-2.0.53
# emacs configure-apa2.sh
./configure \
--prefix=/usr/local/apache2 \
--with-mpm=worker \
--enable-so \
--with-ssl=/usr/share/ssl \
--enable-ssl=shared 

# chmod 755 configure-apa2.sh
# ./configure-apa2.sh

# make
# make install

# emacs /usr/local/apache2/conf/httpd.conf
ServerName 192.168.1.78:80

# cd /usr/share/ssl/misc
# ./CA -newca       (cakey.pem CA秘密鍵 cacert.pem CA証明書)
( enter ca-password ca-password JP saitama okegawa myca casection 192.168.1.78 email )
# chmod 400 ./demoCA/private/cakey.pem

# openssl genrsa -des3 -out server.key 1024         (サーバーの秘密鍵の作成)
( password password )
# openssl rsa -noout -text -in server.key
( password )
# chmod 400 server.key
# openssl req -new -key server.key -out server.csr   (証明書の署名要求の作成)
( password JP saitama okegawa kaisya busyo 192.168.1.78 email enter enter )
# openssl req -noout -text -in server.csr
                                                     (私的CA局で署名)
# openssl ca -policy policy_anything -out server.crt -infiles server.csr
( ca-password y y ) 
# openssl x509 -noout -text -in server.crt

# mkdir /usr/local/apache2/conf/ssl.key
# mkdir /usr/local/apache2/conf/ssl.crt
# cp server.crt /usr/local/apache2/conf/ssl.crt
# cp server.key /usr/local/apache2/conf/ssl.key
# cp ./demoCA/cacert.pem /usr/local/apache2/conf/ssl.crt

# emacs /usr/local/apache2/conf/ssl.conf
SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server.key
SSLCACertificateFile /usr/local/apache2/conf/ssl.crt/cacert.pem

Apache2-SSL TEST
# /usr/local/apache2/bin/apachectl configtest
Syntax OK

Apache起動時のPassword pass
# cd /usr/local/apache2/conf/ssl.key
# cp -p server.key server.key.org
# openssl rsa -in server.key.org -out server.key
Enter PEM pass phrase:( password )

# /usr/local/apache2/bin/apachectl startssl
# /usr/local/apache2/bin/apachectl stop

# cd /usr/local/jakarta/jakarta-tomcat-5.5.9-src/jakarta-tomcat-connectors/jk

(ant build)
# emacs build.properties
# cd native2
# ant

(make build)
# cd native2
# emacs connfigure.in  (apache2 build なのでコメントアウトしてしまいました L164-166)
dnl        if ${TEST} -z "$APR_BUILD"; then
dnl               AC_MSG_ERROR([Apache 1.3 requires apr to built from source, use --with-apr and --with-apr-util])
dnl        fi

# chmod 755 buildconf.sh
# ./buildconf.sh

# emacs configure-modjk2.sh
./configure \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-apache2=/usr/local/apache2 \
--with-java-home=$JAVA_HOME \
--with-jni

# chmod 755 configure-modjk2.sh
# ./configure-modjk2.sh
# make

# cd ../build/jk2/apache2
# cp mod_jk2.so /usr/local/apache2/modules
# cp libjkjni.so /usr/local/apache2/modules
サンプル(Fedora-Core-3-i686.tar.gz)

# cd /usr/local/jakarta/jakarta-tomcat-5.5.6-src/jakarta-tomcat-connectors/jk/conf 
# cp workers2.propertis /usr/local/apache2/conf
# cd /usr/local/apache2/conf
追加修正編集
# emacs workers2.propertis

[uri:/jsp-examples/*.jsp]
info=JSP-Examples webapp
[uri:/servlets-examples/*]
info=Servlets-Examples webapp

追加編集
# emacs /usr/local/apache2/conf/httpd.conf

# Dynamic Shared Object (DOS) Support
LoadModule jk2_module modules/mod_jk2.so

# $CATALINA_HOME/bin/startup.sh
# $APACHE_HOME/bin/apachectl startssl

 http://192.168.1.78/examples/servlets/index.html
 https://192.168.1.78/examples/servlets/index.html
 動作してればメニュー画面からサンプルが動作する

 http://192.168.1.78/examples/jsp/index.html
 https://192.168.1.78/examples/jsp/index.html
 動作してればメニュー画面からサンプルが動作する

 http://localhost/jkstatus/
 https://localhost/jkstatus/   jkstatus画面       
 https:( Netscape 右下の鍵ロック)
5.postgresql-8.0.2               
postgresql-8.0.2.tar.gz                            download => /usr/local/src/pg    
pg80b1.308.src.tar.gz download => /usr/local/src/pg

# mkdir /usr/local/pgsql # chown postgres:postgres /usr/local/pgsql # mkdir /usr/local/src/pg # chown -R postgres:postgres /usr/local/src/pg login:postgres # cd /usr/local/src/pg # tar xzvf postgresql-.8.0.2.tar.gz # cd /usr/local/src/pg/postgresql-8.0.2 # emacs configure-pgsql.sh ./comfigure \ --enable-nls=utf8 \ --with-openssl=/usr/share/ssl # chmod 755 configure-pgsql.sh # ./configure-pgsql.sh # make ALL of PostgreSQL is successfully made. Ready to install. # make check All 96 tests passed # make install # initdb -E UTF-8 --no-locale # cd /usr/local/pgsql/data # emacs postgresql.conf listen_addresses = 'localhost','192.168.1.76' # what IP interface(s) to listen on; port = 5432 postgresql.conf => listen_addresses = '*' # what IP interface(s) to listen on; pg_hba.conf => host all all 192.168.1.0/24 trust # cd /usr/local/src/pg # tar xzvf pg80b1.308.src.tar.gz # cd pg80b1.308.src # ant all # mkdir /usr/local/pgsql/share/java # cp ./jars/* /usr/local/pgsql/share/java # emacs /etc/bashrc export POSTGRES_HOME=/usr/local/pgsql export CLASSPATH=.:$POSTGRES_HOME/share/java/postgresql.jar:$POSTGRES_HOME/share/java/postgresql-examples.jar: # emacs /etc/rc.d/rc.local su - postgres -c "/usr/local/pgsql/bin/postmaster -S -i" # reboot login:postgres # cd /usr/local/src/pg/postgresql-8.0.2/src/test/mb/mbregress.sh # ./mbregress.sh $ psql -l List of databases Name | Owner | Encoding ---------------+----------+--------------- euc_cn | postgres | EUC_CN euc_jp | postgres | EUC_JP euc_kr | postgres | EUC_KR euc_tw | postgres | EUC_TW mule_internal | postgres | MULE_INTERNAL template0 | postgres | UNICODE template1 | postgres | UNICODE unicode | postgres | UNICODE unitest | postgres | UNICODE (10 rows) Tomcat5.5で使うデーターベース # createuser root <!-- y y --> # createuser userxxx <!-- y n --> # createdb authority # psql -l # psql authority < sqltomcat.sql # psql authority authority=# \d authority=# insert into users (user_name,user_pass) values('tomcat5um','tomcat5pm'); authority=# insert into users (user_name,user_pass) values('tomcat5ua','tomcat5pa'); authority=# select * from users; authority=# insert into roles (role_name) values('manager'); authority=# insert into roles (role_name) values('admin'); authority=# select * from roles; authority=# insert into user_roles (role_name,user_name) values('manager','tomcat5um'); authority=# insert into user_roles (role_name,user_name) values('admin','tomcat5ua'); authority=# select * from user_roles; authority=# grant select on users to root; authority=# grant select on roles to root; authority=# grant select on user_roles to root; authority=# \z authority=# \q # exit login:root # cd /usr/local/jakarta/tomcat-5.5/conf # emacs server.xml 追加編集 <!-- <Realm className="org.apache.catalina.realm.UserDatabaseRealm" debug="0" resourceName="UserDatabase"/> --> <!-- Replace the above Realm with one of the following to get a Realm stored in a database and accessed via JDBC --> <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="org.postgresql.Driver" connectionURL="jdbc:postgresql://localhost:5432/authority" connectionName="root" connectionPassword="tomcat" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name" /> # cp /usr/local/pgsql/share/java/postgresql.jar /uar/local/jakarta/tomcat-5.5/common/lib ************************************** MEMO ********************************************* DB-バックアップ postgres $ pg_dumpall -o > pgsqldball.out postgres $ psql -e template1 < pgsqldball.out DB-クリーニング (VACUUM) ***************************************************************************************** Tomcat Administration http://localhost:8080/admin (tomcat5ua tomcat5pa) LOGIN -> admin画面 Tomcat Manager http://localhost:8080/manager (tomcat5um tomcat5pm) LOGIN -> manager画面 ************************************** MEMO ********************************************* OpenOffice SDBC Postgresql OOo_1.1.2_LinuxIntel_install_ja.tar.gz download => /usr/local/src (Fedora rpm OpenOffice1.1 Install) postgresql-sdbc-0.6.2.zip download => /usr/local/src # cd # cp /usr/local/src/postgresql-sdbc-0.6.2.zip ./.rhopenoffice1.1/user/uno_packages/postgresql-sdbc-0.6.2.zip # cd /usr/lib/ooo-1.1/program/ # ./pkgchk.bin ツール -> データソース 新しいデータソース authority データベースの種類(T) postgresql sdbc:postgresql:hostaddr=127.0.0.1 port=5432 dbname=authority 実行画面 日本語表示(UTF-8) クエリー実行 *****************************************************************************************
6.JAVA WEB START  (servlet-JNLP)
(Apache サーバー設定)
追加編集
# emacs /usr/local/apache/conf/mime.types
application/x-java-jnlp-file JNLP

(tomcat サーバー設定済み) 
# emacs /usr/local/jakarta/tomcat-5.5/conf/web.xml
<mime-mapping>
   <extension>jardiff</extension>
   <mime-type>application/x-java-archive-diff</mime-type>
</mime-mapping>

# cd $JAVA_HOME/sample/jnlp/servlet
# cp *.jar $JAVA_HOME/jre/javaws
emacs /etc/bashrc
export JNLP_HOME=$JAVA_HOME/jre/javaws
export CLASSPATH=.:$JNLP_HOME/jnlp.jar:$JNLP_HOME/jnlp-servlet.jar:$JNLP_HOME/jardiff.jar:

# mkdir /usr/local/src/jnlp
# cd /usr/local/src/jnlp
# mkdir build
# mkdir ./build/WEB-INF
# mkdir ./build/WEB-INF/lib
# mkdir ./build/app
# mkdir ./build/app/lib
# mkdir ./build/app/images

emacs ./build/index.html (utf-8 text)
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=UTF-8">
<title>マバイットのJDBC</title>
</head>
<body>
<h2>Java Web Start Postgres JDBC テスト</h2>
<a href="app/post-code.jnlp">JWS JDBC TEST</a>
</body>
</html>
emacs ./build/app/version.xml
<jnlp-versions>
 <resource>
 <pattern>
  <name>post-code.jar</name>
  <version-id>1.4</version-id>
 </pattern>
  <file>post-code.jar</file>
 </resource>
</jnlp-versions>
emacs ./build/app/post-code.jnlp
TS: 2005-07-07 00:00:07
   <?xml version="1.0" encoding="UTF-8"?>
   <jnlp codebase="$$codebase" href="$$name">
     <information>
         <title>Postno JDBC</title>
         <vendor>u-osamu</vendor>
         <description>postgresql java web start test</description>
	 <offline-allowed/>
         <icon href="images/icon.gif"/>
     </information>
     <security>
        <all-permissions/>
     </security>
     <resources>
       <j2se version="1.5"/>
       <jar href="post-code.jar" version="1.4"/>
       <jar href="lib/postgresql.jar"/>
     </resources>
     <application-desc/>
   </jnlp>

./build/app/post-code.jar
./build/app/lib/postgresql.jar
./build/app/images/icon.gif

emacs ./build/WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 
'http://java.sun.com/dtds/web-app_2_3.dtd'> 
 <web-app>
      <servlet>
        <servlet-name>JnlpDownloadServlet</servlet-name>
        <servlet-class>jnlp.sample.servlet.JnlpDownloadServlet</servlet-class>	
    <init-param>
      <param-name>logLevel</param-name>
      <param-value>DEBUG</param-value>
    </init-param>
    <init-param>
      <param-name> logPath</param-name>
     <param-value>/usr/local/jakarta/tomcat-5.5/logs/jnlpdownloadservlet.log</param-value>
    </init-param>    
     </servlet>     
     <servlet-mapping>
        <servlet-name>JnlpDownloadServlet</servlet-name>
        <url-pattern>*.jnlp</url-pattern>
     </servlet-mapping>  
    <servlet-mapping>
      <servlet-name>JnlpDownloadServlet</servlet-name>
      <url-pattern>*.jar</url-pattern>
  </servlet-mapping>
</web-app>

# cp $JNLP_HOME/jnlp-servlet.jar ./build/WEB-INF/lib/jnlp-servlet.jar
# cp $JNLP_HOME/jardiff.jar ./build/WEB-INF/lib/jardiff.jar
# cp $POSTGRES_HOME/share/java/postgresql.jar ./build/WEB-INF/lib/postgresql.jar

参考 データベース・アプリケーション
# cp post-code.jar /usr/local/src/jnlp
# cd /usr/local/src/jnlp

自己署名
# keytool -genkey -keystore myKeystore -alias myself
# keytool -selfcert -alias myself -keystore myKeystore
# keytool -list -keystore myKeystore
# jarsigner -keystore myKeystore post-code.jar myself
# jarsigner -keystore myKeystore lib/postgresql.jar myself
 
# cp post-code.jar ./build/app/
# cp postgresql.jar ./build/app/lib
アイコン作成したらヘ ./build/app/images/icon.gif

# cd build
# jar cvf postcode.war *
# cp postcode.war /usr/local/jakarta/tomcat-5.5/webapps/
(postcode.war.25k0707.tar.gz)

http://localhost:8080/postcode/index.html
実行画面 

http version
http://www5f.biglobe.ne.jp/~u-osamu/javaws/postnohttp/index.html
7.Axis-1.2.1
axis-bin-1_2_1-bin.tar.gz                         download => /usr/local/jakarta/src
jaf-1_0_2-upd2.zip                                download => /usr/local/src 
javamail-1_3_2.zip download => /usr/local/src
xml-security-bin-1_2_0.zip download => /usr/local/src
junit3.8.1.zip download => /usr/local/src jsse-1_0_3_03-gl.zip download => /usr/local/src Xerces-J-bin.2.6.2.tar.gz download => /usr/local/src xalan-j_2_6_0-bin.tar.gz download => /usr/local/src commons-httpclient-3.0-rc2.tar.gz download => /usr/local/src j2sdk-1_3_1_15-linux-i586.bin download => /usr/local/src # cd /usr/local/src # cp jdk-1_3_1_15-linux-i586.bin /usr/local # cd /usr/local # chmod 755 jdk-1_3_1_15-linux-i586.bin # ./jdk-1_3_1_15-linux-i586.bin yes # rm jdk-1_3_1_15-linux-i586.bin # cd /usr/local/jakarta/src # tar xzvf axis-bin-1_2_1-bin.tar.gz -C /usr/local/jakarta/ # cd /usr/local/src # cp jaf-1_0_2-upd2.zip /usr/local # cd /usr/local # unzip jaf-1_0_2-upd2.zip # rm jaf-1_0_2-upd2.zip # cp ./jaf-1.0.2/activation.jar /usr/local/jakarta/axis-1_2_1/lib (activation.jar 53.9KB = ok) # cd /usr/local/src # cp javamail-1_3_2.zip /usr/local # cd /usr/local # unzip javamail-1_3_2.zip # rm javamail-1_3_2.zip # cp ./javamail-1.3.2/lib/mailapi.jar /usr/local/jakarta/axis-1_2_1/lib # cd /usr/local/src # cp xml-security-bin-1_2_0.zip /usr/local # cd /usr/local # unzip xml-security-bin-1_2_0.zip # rm xml-security-bin-1_2_0.zip # cp ./xml-security-1_2_0/libs/xmlsec.jar /usr/local/jakarta/axis-1_2_1/lib # cd /usr/local/src # tar xzvf commons-httpclient-3.0-rc2.tar.gz # cp ./commons-httpclient-3.0-rc2/commons-httpclient-3.0-rc2.jar /usr/local/jakarta/axis-1_2_1/lib # cd /usr/local/src # unzip jsse-1_0_3_03-gl.zip # cp ./jsse-1_0_3_03/lib/*.jar /usr/local/jakarta/axis-1_2_1/lib # cd /usr/local/src # tar czvf xalan-j_2_6_0-bin.tar.gz -C /usr/local # cp /usr/local/xalan-j_2_6_0/bin/xalan.jar /usr/local/jakarta/axis-1_2_1/lib # cd /usr/local/src # tar czvf Xerces-J-bin.2.6.2.tar.gz -C /usr/local # cp /usr/local/xerces-2_6_2/xercesImpl.jar /usr/local/jakarta/axis-1_2_1/lib # cp /usr/local/xerces-2_6_2/xml-apis.jar /usr/local/jakarta/axis-1_2_1/lib # cd /usr/local/jakarta/axis-1_2_1/lib # cp *.jar /usr/local/jakarta/axis-1_2_1/webapps/axis/WEB-INF/lib # cd /usr/local/jakarta/tomcat-5.5/webapps/axis/WEB-INF/ 編集削除 # emacs web.xml <!-- <servlet-mapping> <servlet-name>AdminServlet</servlet-name> <url-pattern>/servlet/AdminServlet</url-pattern> </servlet-mapping> --> ****************** SOAPMonitor SETUP Applet version & GUI version ********************* # cd /usr/local/jakarta/tomcat-5.5/webapps/axis/ # javac -classpath $AXIS_HOME/lib/axis.jar SOAPMonitorApplet.java # cd /usr/local/jakarta/tomcat-5.5/webapps/axis/WEB-INF # emacs users.list admin passwordXXXX mozilla java plugin # cd /usr/lib/mozilla/plugins # ln -s /usr/local/jdk1.5.0_03/jre/plugin/i386/ns7/libjavaplugin_oji.so # emacs deploy-monitor.wsdd # java -cp $CLASSPATH org.apache.axis.client.AdminClient -lhttp://localhost:8080/axis/services/AdminService deploy-monitor.wsdd http://localhost:8080/axis 検証 リスト SOAPMonitorServiceが追加されていればSOAPMonitorが使える 呼出し 訪問 Axisの管理 SOAPモニタ *********** PostgreSQL JDBC - TOMCAT - JAVA WEB START - AXIS SSL アプリケーション *********** SSL (USER PASSWORD IP 認証 and http://192.168.1.78:80/axis/services/HelloJdbc2) # emacs ip_user_pass.sql create table ip_user_pass_tb ( user_name text not null, password_x text not null, ip4_add inet not null ); # psql mabait < ip_user_pass.sql # emacs ip_user_pass.csv axis-user121,axis-password121,192.168.1.5/32 axis-user121,axis-password121,192.168.1.74/32 axis-user121,axis-password121,192.168.1.78/32 # psql mabait mabait=#copy ip_user_pass_tb from '/usr/local/src/pg/ip_user_pass.csv'using delimiters ','; 便利なのでOpenOfficeで確認 # cd /usr/local/apache2/conf 追加修正編集 # emacs workers2.propertis [uri:/axis/*] info=AXIS Servlets webapp context=/axis [uri:/Axispostcode2/*] info=JNLP JDBC AXIS webapp post-code.jar --> axis version + --> axispostcode2.jar /Main.class /PostJFrame.class --> display --> client side /HellJdbcClass.class --> JDBC control --> server side /GetIpAddress.class *************************** SERVER SIDE ************************************************** # cd $AXIS_HOME # mkdir axis-tmp-server # cd axis-tmp-server # emacs HelloJdbc2.java (HellJdbcClass.classMethod interfaceを書く) package axispostcode2; public interface HelloJdbc2 { public String getJdbcDate2(String sqltext , int sentaku , String ipuserpass); } # javac HelloJdbc2.java # emacs java2WSDL.sh (Method interface => HelloJdbc2.wsdl) java org.apache.axis.wsdl.Java2WSDL -o HelloJdbc2.wsdl\ -l "http://192.168.1.78:80/axis/services/HelloJdbc2"\ -n "urn:axispostcode2"\ HelloJdbc2 # chmod 755 java2WSDL.sh # ./java2WSDL.sh # cat HelloJdbc2.wsdl # emacs WSDL2java.sh (HelloJdbc2.wsdl => *.java) java org.apache.axis.wsdl.WSDL2Java -o . -d Session -t -s -S true HelloJdbc2.wsdl # chmod 755 WSDLjava.sh # ./WSDLjava.sh # cd ./axispostcode2 # ls HelloJdbc2.class HelloJdbc2.java HelloJdbc2Service.java HelloJdbc2ServiceLocator.java HelloJdbc2SoapBindingImpl.java HelloJdbc2SoapBindingSkeleton.java HelloJdbc2SoapBindingStub.java HelloJdbc2ServiceTestCase.java deploy.wsdd undeploy.wsdd # emacs HelloJdbc2SoapBindingImpl.java (中身がないただreturn nullのみここにHellJdbcClass.classを実装) package axispostcode2; import java.sql.*; public class HelloJdbc2SoapBindingImpl implements HelloJdbc2{ String sqltext; int sentaku; String ipuserpass; String str1; String str2; int cunt = 0; int login = 0; public java.lang.String getJdbcDate2(java.lang.String in0, int in1, java.lang.String in2) throws java.rmi.RemoteException { /** Creates a new instance of HelloJdbc2 */ this.sqltext = in0; this.sentaku = in1; this.ipuserpass = in2; 以下省略 # javac *.java (Method interface HelloJdbc2.class は上書きされる) # mkdir $CATALINA_HOME/webapps/axis/WEB-INF/classes/axispostcode2 # cp HelloJdbc2.class $CATALINA_HOME/webapps/axis/WEB-INF/classes/axispostcode2 # cp HelloJdbc2SoapBindingImpl.class $CATALINA_HOME/webapps/axis/WEB-INF/classes/axispostcode2 # cp HelloJdbc2SoapBindingSkeleton.class $CATALINA_HOME/webapps/axis/WEB-INF/classes/axispostcode2 (Axispostcode2-server-side-IP78.tar.gz) 追加編集 (SOAPMonitor) # emacs deploy.wsdd <service name="HelloJdbc2" provider="java:RPC" style="rpc" use="encoded"> <requestFlow> <handler type="soapmonitor"/> </requestFlow> <responseFlow> <handler type="soapmonitor"/> </responseFlow> <parameter name="wsdlTargetNamespace" value="urn:axispostcode2"/> <parameter name="wsdlServiceElement" value="HelloJdbc2Service"/> <parameter name="wsdlServicePort" value="HelloJdbc2"/> <parameter name="className" value="axispostcode2.HelloJdbc2SoapBindingSkeleton"/> <parameter name="wsdlPortType" value="HelloJdbc2"/> <parameter name="typeMappingVersion" value="1.2"/> <parameter name="allowedMethods" value="*"/> <parameter name="scope" value="Session"/> </service> </deployment> デプロイする # java -cp $CLASSPATH org.apache.axis.client.AdminClient -lhttp://localhost:8080/axis/services/AdminService deploy.wsdd デプロイ削除 java -cp $CLASSPATH org.apache.axis.client.AdminClient -lhttp://localhost:8080/axis/services/AdminService undeploy.wsdd デプロイ確認 *************************** CLIENT SIDE ************************************************** java axis classpath を設定しておく # cd /usr/local # mkdir axis-tmp-client # cd axis-tmp-client # emacs WSDL2javahttp.sh (HelloJdbc2.wsdl => *.java) java org.apache.axis.wsdl.WSDL2Java -o . -d Session -t -S true\ http://192.168.1.78:8080/axis/services/HelloJdbc2?wsdl # chmod 755 WSDLjavahttp.sh # ./WSDLjavahttp.sh # cd ./axispostcode2 (server side と同じコードが出来ました # ls HelloJdbc2.java HelloJdbc2Service.java HelloJdbc2ServiceLocator.java HelloJdbc2SoapBindingStub.java HelloJdbc2ServiceTestCase.java # emacs HelloGetjdbc2.java (PostJFrameから呼び出していたHellJdbcClassからHelloGetjdbc2.getJdbcDate2に修正) package axispostcode2; import org.apache.axis.*; public class HelloGetJdbc2 { String sqltext; int sentaku; String jdbcip; String str1; String str2; /** Creates a new instance of HelloGetjdbcDate */ public HelloGetJdbc2(String sqltext , int sentaku , String ipuserpass) { this.sqltext = sqltext; this.sentaku = sentaku; this.jdbcip = ipuserpass; try { HelloJdbc2 port = new axispostcode2.HelloJdbc2ServiceLocator().getHelloJdbc2(); str2 = ((axispostcode2.HelloJdbc2SoapBindingStub)port).getJdbcDate2(sqltext , sentaku , ipuserpass); } catch (javax.xml.rpc.ServiceException re) { str2 = ("RPC Service Exception" + re); } catch (java.rmi.RemoteException re) { str2 = (str2 + "Remote Exception" + re); } } public String toString(){ return str2;} } # ls Main.java GetIpAddress.java PostJFrame.java HelloGetjdbc2.java HelloJdbc2.java HelloJdbc2Service.java HelloJdbc2ServiceLocator.java HelloJdbc2SoapBindingStub.java # javac *.java # cd ../ # emacs manifest.mf Manifest-Version: 1.0 Main-Class: axispostcode2.Main X-COMMENT: Main-Class will be added automatically by build # jar cvfm Axispostcode2.jar manifest.mf ./axispostcode2 # jar -jar Axispostcode2.jar NetBeansIDE build Axispostcode2 (使った方が便利) ******************* 使用するJARを適当な場所で自己署名してから下記に配置 ********************** keytool -genkey -keystore myKeystore -alias myself keytool -selfcert -alias myself -keystore myKeystore keytool -list -keystore myKeystore jarsigner -keystore myKeystore Axispostcode2.jar myself jarsigner -keystore myKeystore axis-ant.jar myself jarsigner -keystore myKeystore axis.jar myself jarsigner -keystore myKeystore commons-discovery-0.2.jar myself jarsigner -keystore myKeystore commons-logging-1.0.4.jar myself jarsigner -keystore myKeystore jaxrpc.jar myself jarsigner -keystore myKeystore log4j-1.2.8.jar myself jarsigner -keystore myKeystore saaj.jar myself jarsigner -keystore myKeystore wsdl4j-1.5.1.jar myself ********************************************************************************** # mkdir /usr/local/src/jnlp # cd /usr/local/src/jnlp # mkdir axis-build2 index.html # mkdir ./axis-build2/WEB-INF web.xml # mkdir ./axis-build2/WEB-INF/lib jardiff.jar jnlp-servlet.jar # mkdir ./axis-build2/app Axispostcode2.jar Axispostcode2.jnlp version.xml # mkdir ./axis-build2/app/lib axis.jar axis-ant.jar commons-discovery-0.2.jar commons-logging-1.0.4.jar jaxrpc.jar log4j-1.2.8.jar saaj.jar wsdl4j-1.5.1.jar # mkdir ./axis-build2/app/images icon.gif # cd axis-build2 # jar cvf Axispostcode2.war * # cp Axispostcode2.war /usr/local/jakarta/tomcat-5.5/webapps/ (Axispostcode2.war.25k0710-2.IP78.tar.gz) http://192.168.1.78/Axispostcode2/index.html 実行画面 http://192.168.1.78/axis/SOAPMonitor 実行画面 Applet version # java org.apache.axis.utils.SOAPMonitor -u admin -w passwordXXXX -l http://localhost:8080/axis/servlet/AxisServlet 実行画面 GUI version
LINK