EJBCA安装步骤
[本文引用自(有修改):http://job2job.blog.163.com/blog/static/1416633120071162154863/ 感谢原作者!]
必备软件:
- J2EE jdk 1.5
http://java.sun.com/javaee/downloads/index.jsp - JBOSS-4.0.4.GA
http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=16942 - EJBCA_3_4_1
http://sourceforge.net/project/showfiles.php?group_id=39716&package_id=108797 - apache-ant-1.7.0-bin.zip
http://apache.mirror.phpchina.com/ant/binaries/apache-ant-1.7.0-bin.zip - mysql-4.1.11-win32.zip
http://sd-http.skycn.net:8180/down/mysql-4.1.11-win32.zip - mysql-connector-java-3.1.14.zip
http://download.softagency.net/MySQL/Downloads/Connector-J/ - jce_policy-1_4_2.zip
https://sdlc4d.sun.com/ECom/EComActionServlet;jsessionid=89ED1B4A06DA705654032D608A62F9B7
安装步骤:
- 安装J2EE,mysql 。解压ejbca,jboss,apache-ant,connector,jce_policy。
- 设置环境变量
JAVA_HOME = C:\Sun\AppServer\jdk
JBOSS_HOME = C:\CA\jboss
ANT_HOME = C:\CA\apache-ant-1.6.3beta1
PATH = %JAVA_HOME%\BIN;%JBOSS_HOME%\BIN;%ANT_HOME%\bin;
CLASSPATH= .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib;
将无限加密包jce_policy_1.4.2 的几个文件覆盖到 %jre path%\lib\security ,覆盖jdk下就行 - 安装mysql,用户名和密码均为root,创建数据库ejbca(以后设置ejbca和SQL链接时,用这个密码)
- 将mysql-connector-java-5.0.5解压缩。
- 将其中的mysql-connector-java-5.0.5-bin.jar拷贝到了%JBOSS_HOME%\server\default\lib目录下。
- 将%EJBCA_HOME%\conf\ejbca.properties.sample 复制保存为 %EJBCA_HOME%\conf\ejbca.properties
- 将%EJBCA_HOME%\conf\web.properties.sample, 复制保存为 %EJBCA_HOME%\conf\web.properties,如要设置显示中文界面要修改如下(红字为对应修改)
# Defines the available languages by languagecodes separated with a comma (example EN,ZH).
# If you are not sure that you know how to add a new language (languagefile.XX.properties etc),
# we suggest you stick with the default the first time you install if you wan't to add your own language.
# Otherwise you may not be able to log in to the admin-GUI.
# Default: EN,FR,IT,ES,SE,ZH
web.availablelanguages=ZH,EN,FR,IT,ES,SE
# Default content encoding used to display JSP pages, for example ISO-8859-1, UTF-8 or GBK.
# Default: ISO-8859-1
web.contentencoding=GBK - 将%EJBCA_HOME%\conf\database.properties.sample复制保存为 %EJBCA_HOME%\conf\database.properties,并修改如下(红字为对应修改)
# Default: hsqldb
database.name=mysql
# 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
# 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?characterEncoding=UTF-8
# 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 username.
# Default: sa (works with hsqldb)
database.username=root
# Database password.
# Default: (blank works with hsqldb)
database.password=root
- cmd到%EJBCA_HOME%目录下,运行ant bootstrap ,并将生成的%EJBCA_HOME%\dist\下的ejbca.ear拷贝到\%jboss-4.0.5%\server\default\deploy(高版本ejbca不需要)
- cmd到%JBOSS_HOME%目录下,运行run.bat启动jboss控制台
- cmd到%EJBCA_HOME%目录下,运行ant install (安装会生成p12文件,如无此文件,检查前几步是否有漏项)
- 如果要使用中文的管理界面则需要修改%ejbcahome%\src\adminweb\WEB-INF下的web.xml文件
<env-entry>
<description><![CDATA[Defines the available languages by languagecodes separated with a comma]]></description>
<env-entry-name>AVAILABLELANGUAGES</env-entry-name>
<env-entry-value>ZH,EN</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry><env-entry>
<description><![CDATA[Default content encoding used to display JSP pages]]></description>
<env-entry-name>contentEncoding</env-entry-name>
<env-entry-value>GBK</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
并保证资源文件languagefile.zh.properties存在,还要修改jsp文件的编码类型,具体来说就是在jsp中把它默认的编码改为<%@ page pageEncoding="GBK"%>。 - 停止JBOSS,%EJBCA_HOME%目录下,运行ant deploy (ejbca配置更改,EX.语言文件修改,需重新deploy)
- cmd到%JBOSS_HOME%目录下,运行run.bat启动jboss,访问http://localhost:8080/ejbca
- 进入adminstrator,浏览器需导入p12,默认密码是ejbca.
- 选择中文界面:访问http://localhost:8080/ejbca/adminweb/mypreferences.jsp修改首选语言为我们刚才配置的ZH。