EJBCA 在windows上的安裝

爲了作EJBCA的封裝測試,在我本身電腦上裝了個,但是在國內的開發上面的介紹實在是太少。有的也僅僅是些傻瓜式的安裝介紹,這是介紹在Windows上安裝的過程,(後面介紹下 linux 紅帽上的),有些也是在網上看看,有一些比較關鍵的地方 在如下會指出來:html

推薦一個比較不錯的網址:https://sourceforge.net/p/ejbca/discussion/java

EJBCA Installation

EJBCA是一個基於J2EE技術的全功能的開源CA系統軟件。並提供了一個強大的、高性能並基於組件的CA。EJBCA兼具靈活性和平臺獨立性,能夠獨立使用。也能和不論什麼J2EE應用程序集成。

特性:網上很是多 不說了。
mysql



使用的軟件清單(我本身在CSDN上傳的):linux

J2SE6web

jce_policy-6.zipsql

JDK 1.6 update 12和JCE Unlimited Strength Jurisdiction Policy Files 6 Release Candidate
http://download.csdn.net/detail/liweifengwf/7391507
數據庫


JBoss:
apache

JBoss-5.0.1.GA-jdk6 (注意請下載JBoss-5.0.1.GA-jdk6.zip)  這個120兆太大了。我分了兩部分上傳了(下載後把第二部分的解壓到第一部分的service文件夾即可)。bootstrap

第一部分下載地址:http://download.csdn.net/detail/liweifengwf/7408495瀏覽器

第二部分下載地址:http://download.csdn.net/detail/liweifengwf/7408539

或者去sourceforge下載。

http://downloads.sourceforge.net/jboss/jboss-5.0.1.GA-jdk6.zip?use_mirror=jaist


EJBCA:

ejbca_4_0_10  

http://download.csdn.net/detail/liweifengwf/7391473

或者官網:http://www.ejbca.org/download.html

 

ANT:

apache-ant-1.8.4   
http://download.csdn.net/detail/liweifengwf/7391449

 

MySQL:

MySQL 5.1     
http://dev.mysql.com/downloads/mysql/5.1.html

mysql-connector-java-5.1.7.zip   
http://download.softagency.net/MySQL/Downloads/Connector-J/


安裝步驟:

 

一、安裝j2se6。

還有就是 解壓jce_policy。並將解壓後的jce_policy-1_4_2\jce中的local_policy.jar和US_export_policy.jar復 制,覆蓋C:\Program Files\Java\j2re1.4.2_02\lib\security中的同名文件。

 

二、安裝mysql。usernamepassword均爲"root」。執行開始菜單裏的mysql command line client命令行工具。輸入口令"root",並創建一個空數據庫ejbca。命令行爲"create database ejbca;"。

然後退出命令行工具,他會本身把需要的建好 不用擔憂。

 

三、解壓ejbca、jboss、ant到C盤根文件夾下。

 

四、mysql的jar文件。

把mysql-connector-java-5.1.7.zip裏的mysql-connector-java-5.1.7-bin.jar複製到%JBOSS_HOME%/server/default/lib文件夾下。

 

五、環境變量設置。(這個就不用細說了,記得在配置好後 把cmd的窗體關了在打開)

JAVA_HOME = C:/Program Files/Java/jdk1.6.0_12

JBOSS_HOME = C:/jboss-5.0.1.GA

ANT_HOME = C:/apache-ant-1.7.1

ANT_OPTS = -Xmx640m

PATH = %JAVA_HOME%/BIN;%JBOSS_HOME%/BIN;%ANT_HOME%/bin;

CLASSPATH= %JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar;%JAVA_HOME%/lib;

 

六、執行jboss的run.bat。待jboss全然啓動後,在瀏覽器中訪問http://localhost:8080 ,出現jboss歡迎頁面便表示jboss成功執行。而後必定要中止jboss執行。


7.配置ejbca

將%EJBCA_HOME%/conf/ejbca.properties.sample 複製保存爲   %EJBCA_HOME%/conf/ejbca.properties

記得必定要改動ejbca.properties文件下標紅地方

這個文件裏的如下紅色部分:

# To prevent accidental runs of tests or deploying the wrong thing in a production

# environment, we could prevent this by setting this variable to either "ca" or "ocsp"

ejbca.productionmode=ca

#ejbca.productionmode=ocsp

將%EJBCA_HOME%/conf/web.properties.sample,複製保存爲   %EJBCA_HOME%/conf/web.properties

將%EJBCA_HOME%/conf/database.properties.sample複製保存爲%EJBCA_HOME%/conf/database.properties

 

編輯database.properties例如如下 (主要是標色的地方下文中沒有'#'的幾行在原文件裏是有'#',改動就是把'#'去掉)

# ------------- Database configuration ------------------------

# jndi name of the datasource to use in deployment descriptors of ejbs.
# default: EjbcaDS
#datasource.jndi-name=EjbcaDS

# Prefix for the jndi name of the datasource to use in deployment descriptors of ejbs. 
# JBoss requires 'java:/' as prefix, while Weblogic does not want anything (''), and Glassfish wants jdbc/
# Oracle usually uses jdbc/ as well.
# For Websphere use jdbc/.
# default: java:/
#datasource.jndi-name-prefix=java:/
#datasource.jndi-name-prefix=
#datasource.jndi-name-prefix=jdbc/

# Weblogic in combination with Oracle requires special handling of LONG/BLOB columns
# If, and only if, you are using Weblogic and Oracle, uncomment the row below.
# Use OracleBlob in Weblogic 8.x and Blob in Weblogic 9.x
# Note: This setting is not needed in Weblogic 9.2. Leave it commented out.
# default: 
#weblogic-oracle-columntype=@weblogic.dbms-column-type Blob

# The database name selected for deployment, used to copy XDoclet merge files.
# All supported databases are defined below, others can easily be added
# See the document doc/howto/HOWTO-database.txt for database specifics and tips and tricks.
# Default: hsqldb
database.name=mysql
#database.name=postgres
#database.name=mssql2000
#database.name=oracle
#database.name=sapdb
#database.name=sybase
#database.name=informix
#database.name=derby
#database.name=db2

# The datasource mapping selected for deployment.
# The J2EE server needs to be configured with the appropriate datasource mapping. 
# For JBoss this maps to a setting in standardjbosscmp-jdbc.xml and must match the database chosen above.
# All supported mappings are defined below, others can easily be added
# Default: Hypersonic SQL
datasource.mapping=mySQL
#datasource.mapping=PostgreSQL 7.2
#datasource.mapping=PostgreSQL 8.0
#datasource.mapping=MS SQLSERVER2000
#datasource.mapping=Oracle8
#datasource.mapping=Oracle9i
#datasource.mapping=SapDB
#datasource.mapping=Sybase
#datasource.mapping=Informix92
#datasource.mapping=InformixDB
#datasource.mapping=Derby
#datasource.mapping=DB2

# Database connection url.
# This is the URL used to connect to the database, used to configure a new datasource in JBoss.
# Default: jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB
#database.url=jdbc:mysql://127.0.0.1:3306/ejbca
database.url=jdbc:mysql://127.0.0.1:3306/ejbca?characterEncoding=UTF-8
#database.url=jdbc:postgresql://127.0.0.1/ejbca
#database.url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=ejbca
#database.url=jdbc:oracle:thin:@127.0.0.1:1521:ejbca
#database.url=jdbc:datadirect:oracle://127.0.0.1:1521;SID=ejbca
#database.url=jdbc:informix-sqli://127.0.0.1:1525/ejbca:informixserver=mydbservername;DBDATE=DMY4/;
#database.url=jdbc:derby://127.0.0.1/ejbca;create=true
#database.url=jdbc:db2://127.0.0.1:50000/ejbca

# JDBC driver classname.
# The J2EE server needs to be configured with the appropriate JDBC driver for the selected database
# Default: org.hsqldb.jdbcDriver
database.driver=com.mysql.jdbc.Driver
#database.driver=org.postgresql.Driver
#database.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
#database.driver=oracle.jdbc.driver.OracleDriver
#database.driver=com.ddtek.jdbc.oracle.OracleDriver
#database.driver=com.informix.jdbc.IfxDriver
#database.driver=org.apache.derby.jdbc.ClientDriver
#database.driver=com.ibm.db2.jcc.DB2Driver

# Database username.
# Default: sa (works with hsqldb)
#database.username=ejbca
#database.username=postgres
database.username=root

# Database password.
# Default: (blank works with hsqldb)
#database.password=ejbca
#database.password=postgres
database.password=root


配置JBOSS  :改動jboss如下的文件夾中的文件內容:

JOBSS_HOME/server/default/deployers/jbossws.deployer/META-INF/jboss-beans.xml

凝視掉

<property name="webServiceHost">${jboss.bind.address}</property>
 不然在使用代碼訪問wsdl時候 會出現:
ClientTransportException : server發送了 HTTP 狀態代碼 302: Moved Temporarily 異常


配置完了,接下來就按如下的步驟走便可。

8.cmd到%EJBCA_HOME%文件夾下,執行ant bootstrap。進行ejbca的編譯(假設是老的版本號需要在編譯以後把C:\ejbca_4_0_10\dist下的ejbca.ear文件拷到C:\jboss-5.1.0.GA\server\default\deploy文件夾下。新版本號會本身主動編譯進去的)。


出現Total time 代表 編譯完畢。


九、不用切換文件夾。敲入start run.bat,啓動jboss控制檯(會單獨起來一個窗體,這個jboss啓動的文件夾不要關)。




出現Started in tIime 代表jboss啓動完畢。


十、不用切換文件夾。敲入ant install 進行ejbca的安裝(安裝會生成p12文件。如無此文件。檢查前幾步是否有漏項)。(注意)在jboss的啓動窗體假設出現JCE cannot authenticate the provider BC錯誤。把%EJBCA_HOME%/lib/bc*.jar複製到%JBOSS_HOME%server/default/lib下。例如如下圖:


安裝時候 注意jboss的啓動窗體的日誌。出錯的時候 上面的比較清楚。


十一、按一下Ctrl+C。中止JBOSS。

十二、不用切換文件夾,敲入ant deploy,進行ejbca的部署。


出現Total time EJBCA安裝完畢。


1三、去%EJBCA_HOME%/p12下,安裝superadmin.p12證書,口令爲"ejbca"。

改動默認證書password:(改動默認password在%EJBCA_HOME%\conf\web.properties\superadmin.password=ejbca)

1四、成功安裝。

cmd到%EJBCA_HOME%文件夾下。執行run.bat啓動JBOSS。

在ie地址欄中敲入https://localhost:8443/ejbca/administrator出現證書選擇對話框。選擇SuperAdmin證書後出現管理控制檯頁面:

相關文章
相關標籤/搜索