软件版本
Glassfish: V2
openCMS: 7.0.3
MySQL:5.0.18
说明:首先可以参考Glassfish的安装过程,其中需要指出的是有些机器配置JDK环境的时候只用classpath(windows下)标志出JDK的路径,这在安装Glassfish的过程中会出错,说找不到java.home,这个时候可以通过配置系统的环境变量,在其中添加一条JAVA_HOME,并指出路径就可以了。
下面开始我们的openCMS的安装。
1.从www.opencms.org上下载目前最新版本的opencms。目前最新的版本是7.0.3版。
2.http://www.mysql.com/上下载MySQL,其安装过程比较简单,这里就不冗叙了。
3.按照要求安装好Glassfish.这里用的版本是V2.
4.在下载的opencms_7.0.3.zip压缩包中,得到opencms.war,并把它拷贝到glassfish/domains/domain1/autodeploy下,然后启动Glassfish,启动Glassfish的命令是
asadmin start-domain domain1,这个命令需要到glassfish/bin下运行。等待Glassfish启动之后
等待一会看到在glassfish/domains/domain1/autodeploy下出现了opencms.war_deployed的文件。说明openCMS已经部署成功。
5.我们再把目录切换到glassfish/domains/domain1/applications/j2ee-modules下,可以看到这个时候多出了一个名字为opencms的文件夹,这个时候的opencms虽然部署好了,但是还处于未安装的状态,打开opencms的文件夹可以看到里面只有三个文件夹,其中有一个是setup
这就是我们安装过程的文件夹。
6.修改配置文件,在glassfish/domains/domain1/applications/j2ee-modules的opencms文件夹下的WEB-INF文件夹下面可以找到web.xml文件,打开该文件,把如下部分的注释删除,同时把其中<description></description>的部分也删除,然后保存我们的文件。
[部分一]
<!-- Uncomment this if using BEA WLS 9.x -->
<!-- //删除
<init-param>
<param-name>OnErrorExitWithoutException</param-name>
<param-value>true</param-value>
<description> //删除
This is important while the setup/update wizard is enabled.//删除
The default value of 'false' should work for almost all servlet containers.//删除
But if using BEA WLS 9.x, you should set it to 'true'.//删除
</description>//删除
</init-param>
<init-param>
<param-name>RequestErrorPageAttribute</param-name>
<param-value>weblogic.servlet.errorPage</param-value>
</init-param>
--> //删除
<!-- Uncomment this if using BEA WLS 9.x -->
[部分二]
<!-- Uncomment this if using BEA WLS 9.x -->
<!--//删除
<init-param>
<param-name>OnErrorExitWithoutException</param-name>
<param-value>true</param-value>
<description>//删除
This is important while the setup/update wizard is enabled.//删除
The default value of 'false' should work for almost all servlet containers.//删除
But if using BEA WLS 9.x, you should set it to 'true'.//删除
</description>//删除
</init-param>
<init-param>
<param-name>RequestErrorPageAttribute</param-name>
<param-value>weblogic.servlet.errorPage</param-value>
<description>//删除
This is only needed when the HttpServletRequest#getPathInfo() is not //删除
really working as expected like in BEA WLS 9.x, where you have to use //删除
the 'weblogic.servlet.errorPage' attribute.//删除
</description>//删除
</init-param>
-->//删除
<!-- Uncomment this if using BEA WLS 9.x -->
7.在游览器中输入管理控制台的URLhttp://localhost:4848(如果没有在安装过程中改端口的话默认是这个),输入用户名和密码,分别默认是admin,adminadmin。进入管理控制台。这里我们需要redeploy我们的opencms,在管理控制台左边的树型菜单中点击web applications,可以看到右边我们的opencms的出现在列表中,在其对应的Action列可以找到Redeploy,点击该链接,在location中选择Local packaged file or directory that is accessible from the Application Server,并点击Browse Folders,把它指定到glassfish/domains/domain1/applications/j2ee-modules/opencms,确认。这样我们刚才更改的配置文件就生效了。
8.我们这个时候可以通过访问http://localhost:8080/opencms/setup/来安装我们的openCMS了,
按提示就可以进行安装。需要说明的是当要添入MAC地址的时候,输入的格式应该是
00:00:00:00:00其中的‘-’被':'所代替。当提示安装完成之后,我们就可以访问http://localhost:8080/opencms/opencms来测试我们安装的结果了。
如果按照上面的步骤有什么问题的话可以发邮件给我,互相学习才是进步的根本。
hang.chen@sun.com