EJBCA 在windows上的安装

为了做EJBCA的封装測试,在我自己电脑上装了个,可是在国内的开发上面的介绍实在是太少。有的也仅仅是些傻瓜式的安装介绍,这是介绍在Windows上安装的过程,(后面介绍下 linux 红帽上的),有些也是在网上看看,有一些比較关键的地方 在以下会指出来:

推荐一个比較不错的网址:https://sourceforge.net/p/ejbca/discussion/

EJBCA Installation

EJBCA是一个基于J2EE技术的全功能的开源CA系统软件。并提供了一个强大的、高性能并基于组件的CA。EJBCA兼具灵活性和平台独立性,可以独立使用。也能和不论什么J2EE应用程序集成。

特性:网上非常多 不说了。



使用的软件清单(我自己在CSDN上传的):

J2SE6

jce_policy-6.zip

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


JBoss:

JBoss-5.0.1.GA-jdk6 (注意请下载JBoss-5.0.1.GA-jdk6.zip)  这个120兆太大了。我分了两部分上传了(下载后把第二部分的解压到第一部分的service文件夹便可)。

第一部分下载地址: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/


安装步骤:

 

1、安装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中的同名文件。

 

2、安装mysql。usernamepassword均为"root”。执行開始菜单里的mysql command line client命令行工具。输入口令"root",并建立一个空数据库ejbca。命令行为"create database ejbca;"。

而后退出命令行工具,他会自己把须要的建好 不用担心。

 

3、解压ejbca、jboss、ant到C盘根文件夹下。

 

4、mysql的jar文件。

把mysql-connector-java-5.1.7.zip里的mysql-connector-java-5.1.7-bin.jar复制到%JBOSS_HOME%/server/default/lib文件夹下。

 

5、环境变量设置。(这个就不用细说了,记得在配置好后 把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;

 

6、执行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 表明 编译完毕。


9、不用切换文件夹。敲入start run.bat,启动jboss控制台(会单独起来一个窗体,这个jboss启动的文件夹不要关)。




出现Started in tIime 表明jboss启动完毕。


10、不用切换文件夹。敲入ant install 进行ejbca的安装(安装会生成p12文件。如无此文件。检查前几步是否有漏项)。(注意)在jboss的启动窗体假设出现JCE cannot authenticate the provider BC错误。把%EJBCA_HOME%/lib/bc*.jar复制到%JBOSS_HOME%server/default/lib下。例如以下图:


安装时候 注意jboss的启动窗体的日志。出错的时候 上面的比較清楚。


11、按一下Ctrl+C。停止JBOSS。

12、不用切换文件夹,敲入ant deploy,进行ejbca的部署。


出现Total time EJBCA安装完毕。


13、去%EJBCA_HOME%/p12下,安装superadmin.p12证书,口令为"ejbca"。

改动默认证书password:(改动默认password在%EJBCA_HOME%\conf\web.properties\superadmin.password=ejbca)

14、成功安装。

cmd到%EJBCA_HOME%文件夹下。执行run.bat启动JBOSS。

在ie地址栏中敲入https://localhost:8443/ejbca/administrator出现证书选择对话框。选择SuperAdmin证书后出现管理控制台页面:


posted @ 2016-01-09 15:48  mfrbuaa  阅读(633)  评论(0编辑  收藏  举报