自行complie mod_jk

apache mod_jk本身並沒有提供binary版本,所以需要自行make及install,最近版本是JK 1.2.46

首先先下載source,選擇linux可用的版本tar.gz

cd /tmp
wget http://ftp.tc.edu.tw/pub/Apache/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.46-src.tar.gz

安裝編譯必需lib

sudo yum -y install gcc automake autoconf libtool make
sudo yum -y install httpd-devel

編譯及安裝

cd /tmp/tomcat-connectors-1.2.46-src/native
make
sudo make install

可以在/etc/httpd/modules看到剛才編譯好的mod_jk.so

利用raspberrypi安裝EINVTurnkey會遇到的問題排除

在Raspberry pi 安裝Linux版的 EINVTurnkey電子發票整合服務平台時會遇幾個問題

*不支援64bit SWT library

Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
	at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
	at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
	at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
	at com.tradevan.gateway.client.view.EnvironmentSetting.main(EnvironmentSetting.java:125)

這部份基本上沒解決,所以改跑 32元位版本來解決這個問題

*在32bit時找不到SWT library位置

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
	no swt-gtk-3738 in java.library.path
	no swt-gtk in java.library.path
	/home/pi/.swt/lib/linux/arm/libswt-gtk-3738.so: /home/pi/.swt/lib/linux/arm/libswt-gtk-3738.so: 無法開啟共用目的檔: 沒有此一檔案或目錄 (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)
	Can't load library: /home/pi/.swt/lib/linux/arm/libswt-gtk.so

	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
	at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
	at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
	at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
	at com.tradevan.gateway.client.view.EnvironmentSetting.main(EnvironmentSetting.java:125)
Read More

centos 7 安裝tomcat 8.5

要使用tomcat當做java web servlet container 需要java環境,所以需要再安裝jdk,這裡使用openJDK

1.安裝openJDK

參考此網站 http://openjdk.java.net/install/

sudo yum install java-1.8.0-openjdk

2.建立user 及group tomcat

useradd -r tomcat --shell /bin/false

3.下載tomcat 8.5

可至

https://tomcat.apache.org/download-80.cgi

取得url,利用wget下載tar gz檔

cd /tmp & wget http://ftp.mirror.tw/pub/apache/tomcat/tomcat-8/v8.5.23/bin/apache-tomcat-8.5.23.tar.gz

4.解壓縮tomcat tar gz檔,並修改目錄user及group

tar -zxf /tmp/apache-tomcat-*.tar.gz -C /opt
ln -s /opt/apache-tomcat-8.5.23 /opt/tomcat
chown -hR tomcat: /opt/tomcat /opt/apache-tomcat-*

5.建立start script

Read More