已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Using mod_proxyThis page explains how to integrate the Apache httpd, Apache Tomcat and OpenCms 7 so that all static resources (e.g. images or binaries) are served directly by the Apache Webserver dynamic resources are served by OpenCms through Tomcat The /opencms/opencms/ prefix usually required for OpenCms will be supressedThis configuration has been tested with the following components: Apache httpd webserver 2.0.54 (should work with all stable versions of Apache httpd 2.0, version 1.3 will not work) Apache Tomcat 5.5.7 (other versions that support the CoyoteConnector should work fine) OpenCms 7Please note: Make sure that all your server names are correctly configured in your DNS before you continue with this installation. If a server can not be reached with the name(s) used in the configuration files below, the setup will not work.This document describes the required steps to setup the following scenario:1. The OpenCms server is named $DOMAIN_NAME 2. The server will be served from a Tomcat installation located in the directroy $TOMCAT_HOME 3. Tomcat and Apache do run on the same machine (server hardware)Please note:Replace the previous defined variables for your environment, ie. insteadof$DOMAIN_NAME use your domain name, , and instead of $TOMCAT_HOMEuse yourtomcat home path, ie. /opt/tomcat/.Please note: This document does not enable the Static-Export feature that needs additional configuration steps, a related Static-Export feature configuration document is available in the com.alkacon.documentation.documentation_staticexport documentation module.Step 1: Installing OpenCmsProvided that you have a basic setup of Apache Tomcat and Apache httpd, you should install OpenCms in the $TOMCAT_HOME/webapps/ directory first, without modifiying the default Tomcat configuration.In order for this setup to work you must install OpenCms as the ROOT Tomcat servlet context. Read on to learn how to do so. You have to delete or rename the Tomcat default web application ROOT/ .Important: Make sure that NO web application named opencms/ is installed in $TOMCAT_HOME/webapps/, otherwise this setup will not work.1. Delete or rename the Tomcat default web application ROOT/. 2. Rename the file opencms.war to ROOT.war 3. Restart Tomcat and proceed as described in the basic installation manual, available e.g. in the org.opencms.welcome module. This example will install OpenCms onthe $DOMAIN_NAME server, so the path to the setup wizard will be http:/$DOMAIN_NAME:8080/setup.The setup wizard should work fine now and you should be able to login into your OpenCms system. You might note that some images do not appear as they should. We will fix that in the next step.Step 2: Configuring OpenCmsIn the $TOMCAT_HOME/webapps/ROOT/WEB-INF/config/opencms-importexport.xml configuration file, into the staticexport/rendersettings/.prefix nodes you have to remove any occurrence of the $SERVLET_NAME variable. After editing, it has to look similar to: $CONTEXT_NAME/export $CONTEXT_NAME false :8081$CONTEXT_NAME/handle404 . In the $TOMCAT_HOME/webapps/ROOT/WEB-INF/config/opencms-system.xml configuration file, into the system/sites node you have to configure your site, in this example it has to look similar to: http:/$DOMAIN_NAME /sites/default/ This is all that you have to do in the OpenCms configuration.Please note: After you have made these changes, OpenCms will not run properly until you have also made the changes described below in the Tomcat and Apache configuration.Specifying AliasesYou can have more than one server name pointing to the same root folder by adding an alias to the site node. Take care that you assign every server name only once.An example of such a configuration can be seen from the listing beneath: How to secure a siteYoualso have the option tosecure resources, so that they are transmitted via the https protocol.To activate this feature for your site,you have to add a node secure in the site configuration: Of course, aliases and a secure site can be combined in one site node. However, you can have only one secure server. To secure a file, select the export/secure option in the context-menu of your resource. Now, you get a dialog with a radio inputsfor securing a resouce, for activating the static export, and for marking the resource as internal, so that the page cannot be requested any more.If the secure page contains external data like images, stylesheets or javascripts, they need to be locatedin the/system folder, so that they can be transmitted via a secure and a normal server. Flags given to a folder are valid for all resources that are inside this folder.Step 3: Configuring TomcatLocate the file server.xml in the $TOMCAT_HOME/conf/ directory. Before making any changes, please make a backup copy of this file. Here is how the server.xml file looks after making all required changes to it: You should copy and paste this code to your server.xml and change the server name $DOMAIN_NAME to your own server name.This should be all you need to configure Tomcat. Setting useBodyEncodingForURI to true ensures that GET-Requests are decoded in the appropriate encoding of the target page. Otherwise, passing parameters using GET Requests will lead to wrong parameter values if the encoding is not done with ISO-8859-1 (typically, Browsers will encode values using UTF-8). Alternatively, you can specify the encoding by setting the Attribute URIEncoding to UTF-8 or the appropriate value. Please note that the standard standalone connector usually available at port 8080 has been removed, and so is not longer available. Also, all Tomcat options unrelated to OpenCms have been removed. In case you are using other Tomcat web applications that require further settings for in your server.xml , you must merge these with the OpenCms settings decribed above. Please note: You must first finish the Apache configuration described in the next step to check if Tomcat and OpenCms work correctly. Step 4: Configuring ApacheLocate the file httpd.conf in the $APACHE_HOME/conf/ directory. Before making any changes, please make a backup copy of this file. First, make sure you have the following Apache modules enabled (around line 130 in the Apache httpd.conf ). LoadModule alias_module modules/mod_alias.soLoadModule proxy_module modules/mod_proxy.soLoadModule proxy_http_module modules/mod_proxy_http.so Now you have to configure the entries for your OpenCms installation. In this example, you have to adda entry like this: Order allow,denyAllow from all ServerName $DOMAIN_NAME ServerAdmin DocumentRoot $TOMCAT_HOME/webapps/ROOT/ ErrorLog logs/error.lo
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025医院护理三基培训考试试题(附答案)
- 2025年项目管理与实施知识考察试题及答案解析
- 药店GSP认证质量管理体系文件培训考试试题及答案
- 2025年安全员考试考题及参考答案
- 2025年酒店前台服务员技能考核试题及答案
- 2025年文书档案考试题库及答案
- 2025年人工智能应用开发考试试题及答案
- 内科主治医师内科学考试历年真题及答案
- 交通事故伤残赔偿项目计算标准
- 2025年科普知识竞赛题及答案
- 物业服务满意度测评方法
- 2024珠海辅警考试题库及答案
- 开挖管道施工方案及地下管线保护措施
- 文旅市场安全生产课件
- 高中英语非谓语动词专项训练题库
- 河南省青桐鸣大联考2025-2026学年高一上学期10月联考物理试卷(含解析)
- 【初中地理】矿产资源课件2025-2026学年八年级上册地理(人教版2024)
- 2025成考数学试卷及答案
- 广东省广州市黄埔广附教育集团2024-2025学年八年级上学期期中考试英语试题(含答案)
- 国企中层领导竞聘笔试题及答案
- 浙江金华义乌市人才发展集团有限公司招聘笔试题库2025
评论
0/150
提交评论