opencms配置去掉2个opencms总结

准备:
jdk1.6
下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html
tomcat6
下载地址:http://tomcat.apache.org/download-60.cgi
opencms8.02
下载地址:http://www.opencms.org/downloads/opencms/opencms_8.0.2.zip
apache2.2
下载地址:
http://mirror.bit.edu.cn/apache//httpd/binaries/win32/httpd-2.2.22-win32-x86-no_ssl.msi

安装步骤...省略...

去掉第一个opencms:
第一步:
修改E:\apache-tomcat-6.0.35\conf下的server.xml文件
找到以下内容修改:
	<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

修改成以下形式:
	<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="false"
			deployOnStartup="false">
            <Context path="" docBase="E:\apache-tomcat-6.0.35\webapps\opencms"/>


注意autoDeploy="false"、deployOnStartup="false" 和 docBase的路径

第二步:
修改webapps\opencms\WEB-INF\web.xml文件
找到如下内容:
    <context-param>
        <param-name>DefaultWebApplication</param-name>
        <param-value>ROOT</param-value>
    </context-param>   

修改ROOT为opencms如下所示
    <context-param>
        <param-name>DefaultWebApplication</param-name>
        <param-value>opencms</param-value>
    </context-param>   

现在重启tomcat  输入:http://localhost:8080/opencms 你会发现已成功去除了第一个opencms

去掉第二步opencms

第一步:
修改apache2.2路径下:C:\Program Files\Apache Software Foundation\Apache2.2\conf 的httpd.conf文件

找到:
引用
LoadModule proxy_module modules/mod_proxy.so 去掉#号
LoadModule proxy_http_module modules/mod_proxy_http.so 去掉#号
然后在内容的最后添加上:
引用
NameVirtualHost *:80
<VirtualHost *:80>
<Directory "E:/apache-tomcat-6.0.35/webapps/opencms">
Order  allow,deny
Allow  from all
</Directory>
ServerName  localhost
ServerAdmin  [email protected]
DocumentRoot  "E:/apache-tomcat-6.0.35/webapps/opencms"
ErrorLog  logs/error.log
SetEnvIf Request_URI  "\/opencms\/*" redirect
CustomLog  logs/localhost-access.log  common env=!redirect
ProxyPass               /opencms/ !
RedirectPermanent       /opencms/ http://localhost/   
ProxyPass               /resources/ !
ProxyPass               /export/ !
ProxyPass               / http://localhost:8080/opencms/   
ProxyPassReverse        / http://localhost:8080/opencms/
</VirtualHost>


第二步:在opencms\WEB-INF\config\opencms-importexport.xml配置文件中找到以下配置片段:
<vfs-prefix>${CONTEXT_NAME}${SERVLET_NAME}</vfs-prefix>

从以上配置片段中删除${SERVLET_NAME},修改为以下形式:
<vfs-prefix>${CONTEXT_NAME}</vfs-prefix>


第三步:在opencms\WEB-INF\config\opencms-system.xml配置文件中找到以下配置片段:
<sites>
      <workplace-server>http://localhost:8080</workplace-server>
      <default-uri>/sites/default/</default-uri>
      <shared-folder>/shared/</shared-folder>
      <site server="http://localhost:8080" uri="/sites/default/"/>
    </sites>

把以上配置片段修改为以下形式:
<sites>
    <workplace-server>http://localhost</workplace-server>
    <default-uri>/sites/default/</default-uri>
	<shared-folder>/shared/</shared-folder>
    <site server="http://localhost" uri="/sites/default/"/>
</sites>


第四步:修改E:\apache-tomcat-6.0.35\conf下的server.xml文件
找到Connector的配置
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />

修改为以下形式:
<Connector port="8080"
    maxHttpHeaderSize="8192" maxThreads="150"
    minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443"
    acceptCount="100" connectionTimeout="20000"
    disableUploadTimeout="true"
    proxyName="localhost" proxyPort="80"/>


第五步:重启Apache服务和Tomcat服务,输入http://localhost,看是否成功

你可能感兴趣的:(java,tomcat,xml,Web,OpenCMS)