跳轉到內容

WebObjects/Web 應用程式/部署/FreeBSD WO5.3

來自華夏公益教科書

在 FreeBSD 6.1 版本 (i386) Rev 0.8 2007-05-22 上設定 WebObjects 5.3.1 或 5.3.2 Francois BIENTZ (francois.bientz@voila.fr)

基於 How-to 的文件:在 Linux 上設定 WebObjects (Stefan Apelt) :http://www.tetlabors.de/wo/setup_webobjects_on_linux.html。其他平臺 http://www.tetlabors.de/wo/

感謝 Stefan Apelt、Ari Maniatis 和 Piotr Intres (Gentoo 安裝)


你需要什麼 

  • FreeBSD 6.1 X86 伺服器
  • 一臺 Mac 和 OSX 10.4.7 XCode 2.4,安裝了 WebObjects 開發版。
  • 或一臺 Mac 和 OSX 10.4.7 伺服器 WebObjects 5.3.1 部署版安裝。


安裝 Java 和 Apache

[編輯 | 編輯原始碼]

您可以構建和安裝原生 Java - 使用埠系統 (參見 http://www.freebsd.org/java) - 或從 FreeBSD 基金會下載 diablo Java 1.5 軟體包:http://www.freebsdfoundation.org/downloads/java.shtml 檔案:diablo-jdk-freebsd6.i386.1.5.0.07.00.tbz。

安裝 Apache :我使用了 apache+ssl-1.3.34.1.57 埠

從 OSX 安裝 WebObjects 5.3.2 或從 OSX 伺服器安裝 WebObjects 5.3.1

[編輯 | 編輯原始碼]

在 FreeBSD 上建立這些目錄

/usr/local/apple/Library
/usr/local/apple/Local/Library

要從 OSX 複製到 FreeBSD 的目錄/檔案

FreeBSD:在 /usr/local/apple/Library/Frameworks (OSX :/System/Library/Frameworks)

/JavaDirectToWeb.framework 		
/JavaDTWGeneration.framework 		
/JavaEOAccess.framework 		
/JavaEOApplication.framework 		
/JavaEOCocoa.framework 		
/JavaEOControl.framework  		
/JavaEODistribution.framework		
/JavaEOGeneration.framework 		
/JavaEOInterface.framework  		
/JavaEOInterfaceCocoa.framework 		
/JavaEOInterfaceSwing.framework 		
/JavaEOProject.framework		
/JavaEORuleSystem.framework		
/JavaFoundation.framework		
/JavaJDBCAdaptor.framework		
/JavaJNDIAdaptor.framework		
/JavaWebObjects.framework		
/JavaWebServicesClient.framework		
/JavaWebServicesGeneration.framework		
/JavaWebServicesSupport.framework		
/JavaWOExtensions.framework		
/JavaWOJSPServlet.framework		
/JavaXML.framework		

FreeBSD:在 /usr/local/apple/Library/Java (OSX :/System/Library/Java)

wojavaclient.jar

FreeBSD:在 /usr/local/apple/Library/PrivateFrameworks (OSX :/System/Library/PrivateFrameworks)

/EOPlaceholders.framework
/JavaMonitor.framework

FreeBSD:在 /usr/local/apple/Library/WebObjects (OSX :/System/Library/WebObjects)

/JavaApplications
/WODocumentRoot

FreeBSD:在 /usr/local/apple/Local/Library/WebObjects/Extensions (OSX: /Library/WebObjects/Extensions)

axis-ant.jar
axis.jar
commons-discovery.jar
commons-logging.jar
jaxrpc.jar
log4j-1.2.8.jar
saaj.jar
wsdl4j.jar

為 FreeBSD 安裝 Apache 介面卡

[編輯 | 編輯原始碼]

編輯 /etc/profile 並新增 

NEXT_ROOT=/usr/local/apple
export NEXT_ROOT
OS= FREEBSD
export OS

登出並登入 (使用使用者登入),然後 su

將 mod_WebObjects.so 複製到 /usr/local/libexec/apache。

為 WebObjects 配置 Apache

[編輯 | 編輯原始碼]

將 WebObjects 的配置檔案複製到 Apache conf 資料夾

cp webobjects.conf /usr/local/etc/apache/

webobjects.conf 檔案 

# WebObjects : Enable the WebObjects module.


LoadModule WebObjects_module /usr/local/libexec/apache/mod_WebObjects.so
#AddModule mod_WebObjects.c

# Path to the Document Root of your Webserver, 
# it should contain a directory named WebObjects
WebObjectsDocumentRoot /usr/local/www/data

# You can change the 'cgi-bin' part of WebObjectsAlias to whatever you
# prefer (such as Apps), but the 'WebObjects' part is required.
WebObjectsAlias /cgi-bin/WebObjects

# Here are the 3 possible configuration modes.
# The apache module uses one of them to get information
# about your deployed applications.
# 1085 is the reserved port on which wotaskd processes listen to by default.

# Host List Configuration
# wotaskd is started automatically on supported platforms,
# so this is the default mode.
# The apache module gets its configuration from the wotaskds
# listed on the configuration line
# For multiple hosts:
# WebObjectsConfig http://<name-of-a-host>:<port-on-a-host>,http://<name-of-another-host>:<port-on-a-host> <interval>
# For localhost: 
WebObjectsConfig https://:1085 10

# Multicast Configuration
# The apache module gets its configuration from all wotaskds
# that respond to the multicast call on the subnet
# WebObjectsConfig webobjects://239.128.14.2:1085 10

# File Configuration
# The apache module gets its configuration from one file
# WebObjectsConfig file://<path-to-a-xml-config-file> 10


# To enable public access to the WOAdaptorInfo page, uncomment the following line
# WebObjectsAdminUsername public

# To enable the WOAdaptorInfo page with restricted access,
# uncomment the next two lines and set the user and password
# To access the WOAdaptorInfo page with restricted access, 
# use a URL like: http://webserver/cgi-bin/WebObjects/WOAdaptorInfo?user+password.
# WebObjectsAdminUsername user
# WebObjectsAdminPassword password

# To change the logging options, read the following comments:
# The option name is "WebObjectsLog" and the first value indicates the path of the log file.
# The second value indicates the log level. There are five, in decreasing informational order:
# 	"Debug",    "Info",    "Warn",    "Error",    "User"
#
# Note: To enable logging, touch '/tmp/logWebObjects' as the administrator user (usually root).
#
# The following line is the default:
# WebObjectsLog /tmp/WebObjects.log Debug


編輯 /usr/local/etc/apache/httpsd.conf。搜尋“LoadModule rewrite_module …” 行,並在其_之前_插入以下行

Include /usr/local/etc/apache/webobjects.conf
<Location /cgi-bin/./>
SetHandler WebObjects
</Location>

搜尋“AddModule mod_rewrite.c” 行,並將以下行放在該行之後

AddModule mod_WebObjects.c

搜尋“ServerName …” 行,並將您的 DNS 主機名放在其中。如果您沒有,也可以使用您的 IP 地址。httpd.conf 中對此的解釋非常詳細。

ServerName yourhost.yourdomain.com

儲存並退出。現在,要檢視一切是否正確,請嘗試

/usr/local/sbin/httpsdctl configtest

如果顯示“語法正確”,則表示您沒有問題。否則,請嘗試找到並糾正它報告的錯誤。

啟動 Apache 和 WO 服務

[編輯 | 編輯原始碼]

啟動 Apache:/usr/local/sbin/httpdsctl start

啟動 wotaskd :$NEXT_ROOT/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd &


啟動 JavaMonitor 並測試安裝

[編輯 | 編輯原始碼]

在新增應用程式之前,最後一步是啟動 JavaMonitor 並檢視它是否正常工作:$NEXT_ROOT/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789

啟動 JavaMonitor 後,您將看到類似於以下內容的行

您的應用程式 URL 是:http://yourhost.yourdomain.com:56789/cgi-bin/WebObjects/JavaMonitor.woa

在網路瀏覽器中開啟此 URL。

為 wotaskd 和 javamonitor 建立啟動指令碼

[編輯 | 編輯原始碼]

從埠安裝 lsof

建立 /usr/local/etc/rc.d/110.wotaskd.sh

#!/bin/sh

NEXTROOT=/usr/local/apple

case "$1" in
        start)
                
           export PATH=/usr/local/bin:$PATH
           export NEXT_ROOT=${NEXTROOT}
           ${NEXTROOT}/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd &
           echo -n ' wotaskd'
                
           ;;
        stop)
           lsof -i tcp:1085 |grep LISTEN | sort -u | awk '{print"kill -9 " $2}' | sh
                ;;
        *)
           echo ""
           echo "Usage: `basename $0` { start | stop }"
           echo ""
           exit 64
                ;;
esac

然後

 chmod +x /usr/local/etc/rc.d/110.wotaskd.sh

建立 /usr/local/etc/rc.d/150.javamonitor.sh

#!/bin/sh

NEXTROOT=/usr/local/apple

case "$1" in
        start)
           export PATH=/usr/local/bin:$PATH
           export NEXT_ROOT=${NEXTROOT}
           ${NEXTROOT}/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789 &
           echo -n 'JavaMonitor'
                        ;;
        stop)
           lsof -i tcp:56789 |grep LISTEN | sort -u |awk '{print"kill -9 "$2}' | sh
            ;;
        *)
           echo ""
           echo "Usage: `basename $0` { start | stop }"
           echo ""
           exit 64
            ;;
esac

然後

 chmod +x /usr/local/etc/rc.d/150.javamonitor.sh

JDBC jar 位置。

[編輯 | 編輯原始碼]

對於 mySQL:將 mysql-connector-java-3.0.17-ga-bin.jar 放置在 /usr/local/apple/Local/Library/WebObjects/Extensions 中。

華夏公益教科書