intra-mart Accel Platform安装指南 第33版2020-09-01

4.4.1. Apache HTTP服务器

4.4.1.1。使用mod_proxy / mod_rewrite

在这里,在不使用Resin内置模块情况下,使用Apache 模块 (mod_proxy / mod_rewrite)链接Web服务器和intra-mart Accel Platform进行设置。

4.4.1.2。获取mod_proxy / mod_rewrite

请参阅产品制造商的文档。

4.4.1.3。编辑apache配置文件

  1. 打开<%APACHE_HOME%/ conf / httpd.conf>文件。

  2. 在“动态共享对象(DSO)支持”区域中添加或取消注释以下设置。

    LoadModule rewrite_module模块/ mod_rewrite.so LoadModule proxy_module模块/ mod_proxy.so LoadModule proxy_http_module模块/ mod_proxy_http.so LoadModule proxy_wstunnel_module模块/ mod_proxy_wstunnel.so
  3. 最后,添加AllowEncodedSlashes指令,mod_proxy和mod_rewrite的设置。

    上下文路径 形象
    apache文件根 / usr /本地/ apache / htdocs
    静态文件的部署文件夹 / usr /本地/ apache / htdocs / imart
    Web应用程序服务器IP地址 192.168.1.1
    Web应用程序服务器端口号 8080

    上述示例的设置如下。

    SetEnv proxy-nokeepalive 1 AllowEncodedSlashes On RewriteEngine On RewriteCond%{REQUEST_URI}!^ / Imart / reverse_proxy / RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .gif |。* \ .GIF)$ [OR] RewriteCond%{ REQUEST_URI} ^ / imart /(.* \ .png |。* \ .PNG)$ [OR] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .jpg |。* \ .JPG)$ [OR] RewriteCond %{REQUEST_URI} ^ / imart /(.* \ .jpeg |。* \ .JPEG)$ [OR] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .css |。* \ .CSS)$ [OR ] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .js |。* \ .JS)$ [或] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .swf |。* \ .SWF)$ [OR] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .ico |。* \ .ICO)$ [OR] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .svg |。* \ .SVG )$ [OR] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .json |。* \ .JSON)$ [OR] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .jar |。* \ .JAR)$ [OR] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .xml |。* \ .XML)$ [OR] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .yaml |。 * \ .YAML)$ [OR] RewriteCond%{REQUEST_URI} ^ / imart /(.* \ .txt |。* \ .TXT)$ [ OR]的RewriteCond Pasento {REQUEST_URI} ^ / IMART /(.* \ .HTML |。* \ .HTML |。* \ 。HTM |。* \ 。HTM)$重写规则^ / IMART /(.*)?Doru /创意市集/ $ 1 RewriteCond%{HTTP:连接}升级[NC] RewriteCond%{HTTP:升级} websocket [NC] RewriteRule ^ / imart /(.*)?$ ws://192.168.1.1:8080 / imart / $ 1 [P ,L] ProxyPreserveHost on ProxyPass / imart / http://192.168.1.1:8080/imart/ nocanon ProxyPassReverse / imart / http://192.168.1.1:8080/imart/ nocanon ProxyTimeout 1200

    注解

    上面指定的扩展名是在intra-mart Accel Platform高级版+ intra-mart Accel Collaboration + IM-FormaDesigner for Accel Platform中需要当作静态文件的扩展名。
    如果要处理上面RewriteCond中没有的静态文件,请添加RewriteCond的描述。

    注解

    在“ ProxyTimeout”中,设置超时时间,直到代理服务器断开与Resin的连接。
    请设置一个足够大的值以完成安装Tenant环境。
    这里以1200秒为例。

    注意

    确保在请求中包括AP服务器的上下文根。
    如果在AP服务器端是http:// myapp / imart ,则请求的URL应该是http:// myweb / imart
  4. 重新启动Apache。

4.4.1.4。编辑访问日志

对于反向代理,Resin输出的access.log的源IP均为127.0.0.1。编辑access.log的输出内容以避免这种情况。

  1. 打开<%RESIN_HOME%/ conf / resin.xml>文件。

  2. <host id =”” root-directory =”。”>在指令中添加以下设置,然后重新启动Resin。

    <access-log路径='log / access.log'> <rollover-period> 1D </ rollover-period> <format>%{X-Forwarded-For} i%h%l%u%t“%r” %> s%b“%{Referer} i”“%{User-Agent} i” </格式> </访问日志>

    注解

    有关访问日志的详细内容设置,请参阅“ 树脂文档 ”。

4.4.1.5。限制

有关限制,请参见发行说明