resin服务之二----整合resin+Apache服务
阅读原文时间:2023年07月08日阅读:1

整合resin+Apache服务

1.为什么要整合Apacheresin

a. 早期的resintomcathttpd服务支持不好。

b.  tomcatresinrewriteexpiresgzip功能支持不是很好。

c. 动静分离。

开始安装Apache服务

yum -y install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel

cd /home/peng/tools/

**wget http://archive.apache.org/dist/httpd/httpd-2.2.23.tar.gz**

tar -zxf httpd-2.2.23.tar.gz

cd httpd-2.2.23

./configure --prefix=/application/apache2.2.23 --enable-deflate --enable-headers --enable-modules=so --enable-so --with-mpm=worker --enable-rewrite

make && make install

cd ../

ln -s /application/apache2.2.23/  /application/apache

Apache编译resin mod_caucho模块

cd /application/resin-3.1.13/

./configure --with-apxs=/application/apache2.2.23/bin/apxs

cd /application/resin/modules/c/src/

make

make install

查看多出了mod_caucho.so模块:

[root@data-1-1 src]# ll /application/apache/modules/

total 180

-rw-r--r-- 1 root root   9084 Nov 29 07:00 httpd.exp

-rwxr-xr-x 1 root root 170939 Nov 29 07:05 mod_caucho.so

提示:这个模块很类似Apache+php结合的PHP模块一样,Apache就是通过这个mod_caucho.so模块调用resin解析Java程序的。

Apache配置文件中查看resin的配置信息

root@data-1-1 src]# tail -9 /application/apache/conf/httpd.conf

#

# mod_caucho Resin Configuration

#

LoadModule caucho_module /application/apache2.2.23/modules/mod_caucho.so

ResinConfigServer localhost 6800

CauchoConfigCacheDirectory /tmp

CauchoStatus yes

提示:本段内容是编译后嵌入到httpd.conf中的resin相关配置。

启动Apache服务测试

[root@data-1-1 src]# /application/apache/bin/apachectl start

[root@data-1-1 src]# lsof -i :80

COMMAND     PID   USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME

clock-app  2712   root   21u  IPv4 2827507      0t0  TCP www.pp.org:48706->165.254.27.91:http (CLOSE_WAIT)

httpd     22824   root    4u  IPv6 2840404      0t0  TCP *:http (LISTEN)

httpd     22826 daemon    4u  IPv6 2840404      0t0  TCP *:http (LISTEN)

httpd     22828 daemon    4u  IPv6 2840404      0t0  TCP *:http (LISTEN)

httpd     22829 daemon    4u  IPv6 2840404      0t0  TCP *:http (LISTEN)

浏览器上输入地址:http://192.168.1.140/查看结果

出现上述的错误!!

提示:出现这个问题的原因是Apache把请求都转发给了ResinConfigServer local 6800,而默认的6800端口在resin中未生效,所以报了503错误。

解决办法:

修改Apache的配置内容

[root@data-1-1 src]# tail -9 /application/apache/conf/httpd.conf

#

# mod_caucho Resin Configuration

#

LoadModule caucho_module /application/apache2.2.23/modules/mod_caucho.so

ResinConfigServer 192.168.1.140 6911

CauchoConfigCacheDirectory /tmp

CauchoStatus yes

重启服务:

[root@data-1-1 src]# /application/apache/bin/apachectl graceful

再次刷新页面查看显示结果OK了:

Apache中配置通过resin解析Java程序

可以在httpd.conf配置Apache全部向后转发,也可以通过标签匹配配置部分转发,或者在http-vhost.conf中配置虚拟主机 实现部分向后转发。

httpd.conf配置Apache全部向后转发

[root@data-1-1 ~]# tail -9 /application/apache/conf/httpd.conf

# mod_caucho Resin Configuration

#

LoadModule caucho_module /application/apache2.2.23/modules/mod_caucho.so

ResinConfigServer 192.168.1.140 6911

SetHandler caucho-request

CauchoConfigCacheDirectory /tmp

CauchoStatus yes

SetHandler caucho-request是转发的作用,就是由Apache代理的,然后把业务转发给resin,全部都往后抛,如果不加此参数,用户访问会走Apache。如果增加了,当用户访问所有的请求都会有Apache转给resin来处理。因此,当未加参数时默认浏览器内容应为Apache服务的默认也It Works,增加了SetHandler,出来的结果就是resin的默认页面了。

重启Apache服务测试,查看的内容是resin的默认页面:

当把resin服务停掉后再次查看,所有的请求都丢给resin处理了:

[root@data-1-1 ~]# killall java

再次启动resin服务浏览器上查看又OK了!!!

Apache中配置虚拟主机转发resin解析

#也可以根据域名虚拟主机只让后端resin处理一部分请求转发

[root@data-1-1 ~]# cd /application/apache/conf/extra/

[root@data-1-1 extra]# cp httpd-vhosts.conf  httpd-vhosts.conf_$(date +%F)

[root@data-1-1 extra]# cat httpd-vhosts.conf

NameVirtualHost *:80

ServerAdmin  835221922@qq.com

DocumentRoot "/var/www"

DirectoryIndex index.html index.htm index.jsp

**ServerName www.peng.cc**

ErrorLog   "logs/peng-error_log"

CustomLog  "logs/peng-access_log" common

Options -Indexes  FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

#Resin Configuration

ResinConfigServer 192.168.1.140 6911

#SetHandler caucho-request

修改Apache主配置文件内容:

395  # Virtual hosts

396 Include conf/extra/httpd-vhosts.conf ---》此行注释要打开

[root@data-1-1 ~]# tail -9 /application/apache/conf/httpd.conf

# mod_caucho Resin Configuration

#

LoadModule caucho_module /application/apache2.2.23/modules/mod_caucho.so

#ResinConfigServer 192.168.1.140 6911    ---》虚拟主机已配置,这里注释掉!

#SetHandler caucho-request

CauchoConfigCacheDirectory /tmp

CauchoStatus yes

[root@data-1-1 www]# mkdir -p /var/www/

[root@data-1-1 www]# echo "www.peng.cc" >/var/www/index.html

[root@data-1-1 www]# echo '<%=99+1%>' > /var/www/index.jsp

[root@data-1-1 extra]# /application/apache/bin/apachectl graceful

默认实现了动静分离:

[root@data-1-1 extra]# curl 192.168.1.140/index.html

www.peng.cc

[root@data-1-1 ~]# cat /var/www/index.html

www.peng.cc

[root@data-1-1 extra]# curl 192.168.1.140/index.jsp

Resin Default Home Page

Resin Default Home Page

This is the default page for the Resin web server.

Documentation is available here.

Administration is available here.

[root@data-1-1 extra]# curl 192.168.1.140/test.jsp

99+1=100

[root@data-1-1 ~]# cat /application/resin/webapps/ROOT/test.jsp

99+1=<%=99+1%>

再次测试:

[root@data-1-1 ~]# cp  /var/www/index.jsp  /var/www/peng.jsp

[root@data-1-1 ~]# cat /var/www/peng.jsp

<%=99+1%>

[root@data-1-1 ~]# curl 192.168.1.140/peng.jsp

>404 Not Found

404 Not Found

/peng.jsp was not found on this server.


Resin/3.1.13

注意:如果是Apache解析的话,会解析出来结果;而如果是resin解析的话,会报404的错误,所以解析的结果是404,即是resin做了解析。

jsp文件拷贝到resin默认目录下,又可以解析了:

[root@data-1-1 ~]# cp /var/www/peng.jsp  /application/resin/webapps/ROOT/

[root@data-1-1 ~]# curl 192.168.1.140/peng.jsp

100

apache中配置虚拟主机转发resin解析

配置内容

[root@data-1-1 ~]# cat /application/apache/conf/extra/httpd-vhosts.conf

NameVirtualHost *:80

DocumentRoot "/var/www"

DirectoryIndex index.html index.htm index.jsp

**ServerName www.peng.cc**

ErrorLog   "logs/peng-error_log"

CustomLog  "logs/peng-access_log" common

Options -Indexes  FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

#Resin Configuration

ResinConfigServer 192.168.1.140 6911

SetHandler caucho-request

启动服务

[root@data-1-1 ~]# /application/apache/bin/apachectl graceful

测试

[root@data-1-1 ~]# curl 192.168.1.140/d.html

<strong><em><em>404 Not Found</em></strong></em>

404 Not Found

/d.html was not found on this server.


Resin/3.1.13

提示:访问请求先到Apache服务,之后抛给后端的resin,后端没有d.html文件,则报了404错误;若停掉resin服务,则会报503错误。

[root@data-1-1 ~]# killall java

[root@data-1-1 ~]# killall java

java: no process killed

[root@data-1-1 ~]# curl 192.168.1.140/d.html

<strong><em><em>503 Service Temporarily Unavailable<</em></strong></em>/title></strong></p> <p><strong></head><body></strong></p> <p><strong><h1>Service Temporarily Unavailable</h1></strong></p> <p><strong><p>The server is temporarily unable to service your</strong></p> <p><strong>request due to maintenance downtime or capacity</strong></p> <p><strong>problems. Please try again later.</p></strong></p> <p><strong></body></html></strong></p> <p><strong>调整<strong><em><em>resin</em></strong></em>配置支持多<strong><em><em>vhost</em></strong></em>主机</strong></p> <p><strong>resin</strong><strong>主配置文件添加如下内容</strong></p> <p><strong>102     <!-- resin Configure at 2016-1-11 --></strong></p> <p><strong>103 <server</strong> <strong>id='peng01'</strong> <strong>address='192.168.1.140'</strong> <strong>port='6912'</strong> <strong>watchdog-port="6922"</strong><strong>></strong></p> <p><strong>104      <http address="\*"** **port="8081"/></strong></p> <p><strong>105      <jvm-arg>-Xmx256m</jvm-arg></strong></p> <p><strong>106      <jvm-arg>-Xss1m</jvm-arg></strong></p> <p><strong>107      <jvm-arg>-Xdebug</jvm-arg></strong></p> <p><strong>108      <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg></strong></p> <p><strong>109      <memory-free-min>1M</memory-free-min></strong></p> <p><strong>110      <thread-max>256</thread-max></strong></p> <p><strong>111      <socket-timeout>65s</socket-timeout></strong></p> <p><strong>112      <keepalive-max>128</keepalive-max></strong></p> <p><strong>113      <keepalive-timeout>15s</keepalive-timeout></strong></p> <p><strong>114      </server></strong></p> <p><strong>启动脚本修改如下</strong></p> <p><strong>[root@data-1-1 conf]# cat /etc/init.d/resin-peng</strong></p> <p><strong>#!/bin/bash</strong></p> <p><strong>#author at 20160111</strong></p> <p><strong>#linux startup script for Resin</strong></p> <p><strong># chkconfig: 345 85 15</strong></p> <p><strong># description: Resin is a Java Web server.</strong></p> <p><strong>#</strong> </p> <p><strong>#To install,configure this file as needed and copy init.resin</strong></p> <p><strong>#to /etc/rc.d/init.d as resin. Then use "# /sbin/chkconfig resin reset"</strong></p> <p><strong>#</strong></p> <p><strong>. /etc/init.d/functions</strong></p> <p><strong>StartPath='/application/resin/bin/httpd.sh'</strong></p> <p><strong>ResinLog=/app/logs/resinlog</strong></p> <p><strong>[ ! -d $ResinLog ] && mkdir -p $ResinLog</strong></p> <p><strong>resind () {</strong></p> <p><strong>#</strong><strong>如果是多进程增加上面的配置段即可。</strong></p> <p><strong>for id in peng peng01</strong></p> <p><strong>do</strong></p> <p><strong>$StartPath -server $id $1 >>$ResinLog/resin_startup.log</strong></p> <p><strong>if [ $? -eq 0 ];then</strong></p> <p><strong>action "$1 $id resin…" /bin/true</strong></p> <p><strong>else</strong></p> <p><strong>action "$1 $id resin…" /bin/false</strong></p> <p><strong>fi</strong></p> <p><strong>done</strong></p> <p><strong>}</strong></p> <p><strong>case "$1" in</strong></p> <p><strong>start)</strong></p> <p><strong>resind $1</strong></p> <p><strong>echo "--------checking------"</strong></p> <p><strong>sleep 10</strong></p> <p><strong>netstat -lnt |egrep "80|69"</strong></p> <p><strong>echo "--------checkover-----"</strong></p> <p><strong>;;</strong></p> <p><strong>stop)</strong></p> <p><strong>resind $1</strong></p> <p><strong>;;</strong></p> <p><strong>restart)</strong></p> <p><strong>resind stop</strong></p> <p><strong>resind start</strong></p> <p><strong>;;</strong></p> <p><strong>*)</strong></p> <p><strong>echo "Usage: $0 {start|stop|restart}"</strong></p> <p><strong>exit 1</strong></p> <p><strong>esac</strong></p> <p><strong>exit 0</strong></p> <p><strong>启动服务</strong></p> <p><strong>[root@data-1-1 conf]# /etc/init.d/resin-peng restart</strong></p> <p><strong>stop peng resin…                                         [FAILED]</strong></p> <p><strong>stop peng01 resin…                                       [FAILED]</strong></p> <p><strong>start peng resin…                                        [  OK  ]</strong></p> <p><strong>start peng01 resin…                                      [  OK  ]</strong></p> <p><strong>查看端口</strong></p> <p><strong>[root@data-1-1 ~]# netstat -lnt |egrep "80|69"</strong></p> <p><strong>tcp        0      0 ::ffff:192.168.1.140:6911   :::*                        LISTEN</strong> </p> <p><strong>tcp        0      0 ::ffff:192.168.1.140:6912   :::*                        LISTEN</strong> </p> <p><strong>tcp          0       0 ::ffff:127.0.0.1:6921       :::*                        LISTEN</strong> </p> <p><strong>tcp          0       0 ::ffff:127.0.0.1:6922       :::*                        LISTEN</strong> </p> <p><strong>tcp                0           0 :::8080                     :::*                        LISTEN</strong> </p> <p><strong>tcp              0        0 :::80                       :::*                        LISTEN</strong> </p> <p><strong>tcp              0      0 :::8081                     :::*                        LISTEN</strong> </p> <p><strong>在<strong><em><em>apache</em></strong></em>中配置多个虚拟主机实现不同<strong><em><em>resin</em></strong></em>解析</strong></p> <p><strong>[root@data-1-1 ~]# cat /application/apache/conf/extra/httpd-vhosts.conf</strong></p> <p><strong>NameVirtualHost *:80</strong></p> <p><strong><VirtualHost \*:80></strong></p> <p><strong>DocumentRoot "/var/www"</strong></p> <p><strong>DirectoryIndex index.html index.htm index.jsp</strong></p> <p>**ServerName <a rel="nofollow noopener noreferrer" href="http://www.peng.cc**">www.peng.cc**</a></p> <p><strong>ErrorLog   "logs/peng-error_log"</strong></p> <p><strong>CustomLog  "logs/peng-access_log" common</strong></p> <p><strong><Directory "/var/www"></strong></p> <p><strong>Options -Indexes  FollowSymLinks</strong></p> <p><strong>AllowOverride None</strong></p> <p><strong>Order allow,deny</strong></p> <p><strong>Allow from all</strong></p> <p><strong></Directory></strong></p> <p><strong>#Resin Configuration</strong></p> <p><strong>ResinConfigServer 192.168.1.140 6911</strong></p> <p><strong>SetHandler caucho-request</strong></p> <p><strong></VirtualHost></strong></p> <p><strong><VirtualHost \*:80></strong></p> <p><strong>DocumentRoot</strong> <strong>"/var/blog"</strong></p> <p><strong>DirectoryIndex index.html index.htm index.jsp</strong></p> <p><strong>ServerName</strong> <strong><a rel="nofollow noopener noreferrer" href="http://www.peng.org">www.peng.org</a></strong></p> <p><strong>ErrorLog   "logs/peng01-error_log"</strong></p> <p><strong>CustomLog  "logs/peng01-access_log" common</strong></p> <p><strong><Directory "/var/blog"></strong></p> <p><strong>Options -Indexes  FollowSymLinks</strong></p> <p><strong>AllowOverride None</strong></p> <p><strong>Order allow,deny</strong></p> <p><strong>Allow from all</strong></p> <p><strong></Directory></strong></p> <p><strong>#Resin Configuration</strong></p> <p><strong>ResinConfigServer 192.168.1.140</strong> <strong>6912</strong></p> <p><strong>#SetHandler caucho-request</strong></p> <p><strong></VirtualHost></strong></p> <p><strong>测试语法并启动服务:</strong></p> <p><strong>[root@data-1-1 ~]# /application/apache/bin/apachectl -t</strong></p> <p><strong>Warning: DocumentRoot [/var/blog] does not exist</strong></p> <p><strong>httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.10.140 for ServerName</strong></p> <p><strong>Syntax OK</strong></p> <p><strong>[root@data-1-1 ~]# mkdir -p /var/blog</strong></p> <p><strong>[root@data-1-1 ~]# /application/apache/bin/apachectl graceful</strong></p> <p><strong>查看<strong><em><em>hosts</em></strong></em>文件:</strong></p> <p><strong>[root@data-1-1 ~]# cat /etc/hosts</strong></p> <p><strong>127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4</strong></p> <p><strong>::1         localhost localhost.localdomain localhost6 localhost6.localdomain6</strong></p> <p><strong>192.168.10.140 data-1-1</strong></p> <p>**192.168.1.140 <a rel="nofollow noopener noreferrer" href="http://www.pp.org**">www.pp.org**</a></p> <p><strong>测试:</strong></p> <p><strong>[root@data-1-1 ~]# echo <a rel="nofollow noopener noreferrer" href="http://www.pp.org">www.pp.org</a> >/var/blog/index.html</strong></p> <p>**[root@data-1-1 ~]# curl <a rel="nofollow noopener noreferrer" href="http://www.pp.org**">www.pp.org**</a></p> <p><a rel="nofollow noopener noreferrer" href="http://www.pp.org/">www.pp.org</a></p> <p>**[root@data-1-1 ~]# curl <a rel="nofollow noopener noreferrer" href="http://www.pp.org/peng.jsp**">www.pp.org/peng.jsp**</a></p> <p><strong>100</strong></p> <p><strong>提示:此时查看的结果都是后端<strong><em><em>resin</em></strong></em>的<strong><em><em>6912</em></strong></em>给的结果,那么我们想后端<strong><em><em>resin</em></strong></em>有不同的站点目录。该怎么解决呢?</strong></p> <p><strong>修改<strong><em><em>resin</em></strong></em>主配置文件</strong></p> <p><strong>删除如下内容:</strong></p> <p><strong>227     <!--</strong></p> <p><strong>228        - Default host configuration applied to all virtual hosts.</strong></p> <p><strong>229       --></strong></p> <p><strong>230     <host-default></strong></p> <p><strong>231       <!--</strong></p> <p><strong>232          - With another web server, like Apache, this can be commented out</strong></p> <p><strong>233          - because the web server will log this information.</strong></p> <p><strong>234         --></strong></p> <p><strong>235       <access-log path="logs/access.log"</strong></p> <p><strong>236             format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'</strong></p> <p><strong>237             rollover-period="1W"/></strong></p> <p><strong>238</strong></p> <p><strong>239       <!-- creates the webapps directory for .war expansion --></strong></p> <p><strong>240       <web-app-deploy path="webapps"/></strong></p> <p><strong>241</strong></p> <p><strong>242       <!-- creates the deploy directory for .ear expansion --></strong></p> <p><strong>243       <ear-deploy path="deploy"></strong></p> <p><strong>244         <ear-default></strong></p> <p><strong>245           <ejb-server></strong></p> <p><strong>246             <config-directory>WEB-INF</config-directory></strong></p> <p><strong>247           </ejb-server></strong></p> <p><strong>248         </ear-default></strong></p> <p><strong>249       </ear-deploy></strong></p> <p><strong>250</strong></p> <p><strong>251       <!-- creates the deploy directory for .rar expansion --></strong></p> <p><strong>252       <resource-deploy path="deploy"/></strong></p> <p><strong>253     </host-default></strong></p> <p><strong>254</strong></p> <p><strong>255     <!-- configures a deployment directory for virtual hosts --></strong></p> <p><strong>256     <host-deploy path="hosts"></strong></p> <p><strong>257       <host-default></strong></p> <p><strong>258         <resin:import path="host.xml" optional="true"/></strong></p> <p><strong>259       </host-default></strong></p> <p><strong>260     </host-deploy></strong></p> <p><strong>261</strong></p> <p><strong>262     <!-- configures the default host, matching any host name --></strong></p> <p><strong>263     <host id="" root-directory="."></strong></p> <p><strong>264       <!--</strong></p> <p><strong>265          - configures an explicit root web-app matching the</strong></p> <p><strong>266          - webapp's ROOT</strong></p> <p><strong>267         --></strong></p> <p><strong>268       <web-app id="/" root-directory="webapps/ROOT"/></strong></p> <p><strong>269</strong></p> <p><strong>270       <web-app id="/resin-admin" root-directory="${resin.home}/php/admin"></strong></p> <p><strong>271         <!--</strong></p> <p><strong>272            - Administration application /resin-admin</strong></p> <p><strong>273           --></strong></p> <p><strong>274         <prologue></strong></p> <p><strong>275           <resin:set var="resin\_admin\_external" value="false"/></strong></p> <p><strong>276           <resin:set var="resin\_admin\_insecure" value="true"/></strong></p> <p><strong>277         </prologue></strong></p> <p><strong>278       </web-app></strong></p> <p><strong>279     </host></strong></p> <p><strong>代替的添加如下内容:</strong></p> <p><strong><!--Create first virtual hosts at 20160112.--></strong></p> <p><strong><host id="****www.peng.cc****" root-directory="****/application/resin/webapps****"></strong></p> <p><strong><host-alias><strong><em><em>blog.peng.cc</em></strong></em></host-alias></strong></p> <p><strong><!--</strong></p> <p><strong>- configures an explicit root web-app matching the</strong></p> <p><strong>- webapp's ROOT</strong></p> <p><strong>--></strong></p> <p><strong><web-app id="/" root-directory="/application/resin/webapps/ROOT"></strong></p> <p><strong><session-config cookie-domain="pp.org" reuse-session-id="true"></strong></p> <p><strong><session-timeout>5</session-timeout></strong></p> <p><strong><session-max>12000</session-max></strong></p> <p><strong></session-config></strong></p> <p><strong><servlet-mapping servlet-class='com.caucho.servlets.ResinStatusServlet'></strong></p> <p><strong><url-pattern>/resin-status-peng.org</url-pattern></strong></p> <p><strong><init enable="read"/></strong></p> <p><strong></servlet-mapping></strong></p> <p><strong><error-page error-code='404' location='/tips/404.html'/></strong></p> <p><strong></web-app></strong></p> <p><strong><web-app id="/resin-admin-peng.org" root-directory="${resin.home}/php/admin"></strong></p> <p><strong><character-encoding>utf8</character-encoding></strong></p> <p><strong><prologue></strong></p> <p><strong><resin:set var="resin\_admin\_external" value="true"/></strong></p> <p><strong><resin:set var="resin\_admin\_insecure" value="true"/></strong></p> <p><strong></prologue></strong> </p> <p><strong><security-constraint></strong></p> <p><strong><web-resource-collection></strong></p> <p><strong><url-pattern>/*</url-pattern></strong></p> <p><strong></web-resource-collection></strong> </p> <p><strong></security-constraint></strong></p> <p><strong></web-app></strong></p> <p><strong><stderr-log path='/app/log/resinlog/www_stderr.log'</strong></p> <p><strong>rollover-period='1W'/></strong></p> <p><strong><stdout-log path='/app/log/resinlog/www_stdout.log'</strong></p> <p><strong>rollover-period='1W'/></strong></p> <p><strong></host></strong></p> <p><strong><!--Create first virtual hosts at 20160112.--></strong></p> <p><strong><host id="****www.peng.org****" root-directory="/application/resin/webapps"></strong></p> <p><strong><host-alias><strong><em><em>blog.peng.org</em></strong></em></host-alias></strong></p> <p><strong><!--</strong></p> <p><strong>- configures an explicit root web-app matching the</strong></p> <p><strong>- webapp's ROOT</strong></p> <p><strong>--></strong></p> <p><strong><web-app id="/" root-directory="****/application/resin/webapps/peng****"></strong></p> <p><strong><session-config cookie-domain="pp.org" reuse-session-id="true"></strong></p> <p><strong><session-timeout>5</session-timeout></strong></p> <p><strong><session-max>12000</session-max></strong></p> <p><strong></session-config></strong></p> <p><strong><servlet-mapping servlet-class='com.caucho.servlets.ResinStatusServlet'></strong></p> <p><strong><url-pattern>/resin-status-peng.org</url-pattern></strong></p> <p><strong><init enable="read"/></strong></p> <p><strong></servlet-mapping></strong></p> <p><strong><error-page error-code='404' location='/tips/404.html'/></strong></p> <p><strong></web-app></strong></p> <p><strong><web-app id="/resin-admin-peng.org" root-directory="${resin.home}/php/admin"></strong></p> <p><strong><character-encoding>utf8</character-encoding></strong></p> <p><strong><prologue></strong></p> <p><strong><resin:set var="resin\_admin\_external" value="true"/></strong></p> <p><strong><resin:set var="resin\_admin\_insecure" value="true"/></strong></p> <p><strong></prologue></strong> </p> <p><strong><security-constraint></strong></p> <p><strong><web-resource-collection></strong></p> <p><strong><url-pattern>/*</url-pattern></strong></p> <p><strong></web-resource-collection></strong> </p> <p><strong></security-constraint></strong></p> <p><strong></web-app></strong></p> <p><strong><stderr-log path='/app/log/resinlog/blog_stderr.log'</strong></p> <p><strong>rollover-period='1W'/></strong></p> <p><strong><stdout-log path='/app/log/resinlog/blog_stdout.log'</strong></p> <p><strong>rollover-period='1W'/></strong></p> <p><strong></host></strong></p> <p><strong>注释掉<strong><em><em>resin</em></strong></em>主配置中虚拟主机中的<strong><em><em>http</em></strong></em>端口内容:</strong></p> <p><strong>90      <!-- <http address="\*" port="8080"/> --></strong></p> <p><strong>104      <!--  <http address="\*" port="8081"/> --></strong></p> <p><strong>启动服务</strong></p> <p><strong>[root@data-1-1 ~]# killall java</strong></p> <p><strong>[root@data-1-1 ~]# /application/resin/bin/httpd.sh -server peng start</strong></p> <p><strong>[root@data-1-1 ~]# /application/resin/bin/httpd.sh -server peng01 start</strong></p> <p><strong>站点目录下会生成<strong><em><em>peng</em></strong></em>的目录:</strong></p> <p><strong>[root@data-1-1 ~]# ll</strong> <strong>/application/resin/webapps/</strong></p> <p><strong>drwxr-xr-x  3 root root    4096 Nov 29 16:29</strong> <strong>peng</strong></p> <p><strong>测试</strong></p> <p><strong>[root@data-1-1 ~]# cat</strong> <strong>/application/resin/webapps/peng/test.jsp</strong></p> <p><strong>1+1=<%=1+1%></strong></p> <p><strong>[root@data-1-1 ~]# cat</strong> <strong>/application/resin/webapps/ROOT/test.jsp</strong></p> <p><strong>99+1=<%=99+1%></strong></p> <p><strong>修改<strong><em><em>hosts</em></strong></em>文件:</strong></p> <p><strong>[root@data-1-1 ~]# cat /etc/hosts</strong></p> <p><strong>192.168.1.140 <a rel="nofollow noopener noreferrer" href="http://www.peng.cc ">www.peng.cc </a> <a rel="nofollow noopener noreferrer" href="http://www.peng.org">www.peng.org</a> blog.peng.cc   blog.peng.org</strong></p> <p><strong>开始测试:</strong></p> <p>**[root@data-1-1 ~]# curl <a rel="nofollow noopener noreferrer" href="http://www.peng.cc/test.jsp**">http://www.peng.cc/test.jsp**</a></p> <p><strong>99+1=100</strong></p> <p>**[root@data-1-1 ~]# curl <a rel="nofollow noopener noreferrer" href="http://blog.peng.cc/test.jsp**">http://blog.peng.cc/test.jsp**</a></p> <p><strong>99+1=100</strong></p> <p>**[root@data-1-1 ~]# curl <a rel="nofollow noopener noreferrer" href="http://blog.peng.org/test.jsp**">http://blog.peng.org/test.jsp**</a> </p> <p><strong>1+1=2</strong></p> <p>**[root@data-1-1 ~]# curl <a rel="nofollow noopener noreferrer" href="http://www.peng.org/test.jsp**">http://www.peng.org/test.jsp**</a></p> <p><strong>1+1=2</strong></p> <p><strong>因为<strong><em><em>resin</em></strong></em>主配置文件关掉了<strong><em><em>8080</em></strong></em>和<strong><em><em>8081</em></strong></em>端口,所以带端口查看会报错:</strong></p> <p>**[root@data-1-1 ~]# curl <a rel="nofollow noopener noreferrer" href="http://blog.peng.org:8080/test.jsp**">http://blog.peng.org:8080/test.jsp**</a> </p> <p><strong>curl: (7) couldn't connect to host</strong></p> <p>**[root@data-1-1 ~]# curl <a rel="nofollow noopener noreferrer" href="http://blog.peng.org:8081/test.jsp**">http://blog.peng.org:8081/test.jsp**</a></p> <p><strong>curl: (7) couldn't connect to host</strong></p> <p>**[root@data-1-1 ~]# curl <a rel="nofollow noopener noreferrer" href="http://www.peng.org:8081/test.jsp**">http://www.peng.org:8081/test.jsp**</a></p> <p><strong>curl: (7) couldn't connect to host</strong></p> <p>**[root@data-1-1 ~]# curl <a rel="nofollow noopener noreferrer" href="http://www.peng.org:8080/test.jsp**">http://www.peng.org:8080/test.jsp**</a></p> <p><strong>curl: (7) couldn't connect to host</strong></p> <p><strong>理解结构图:</strong></p> <p><strong><img class='lazyload' data-src="https://article.cdnof.com/2307/7bc68083-bf5a-4fae-bcca-dece3664dddd.png" alt="" /></strong></p></div></div><div class="MuiGrid-root jss8 MuiGrid-item MuiGrid-grid-xs-true MuiGrid-grid-md-3"><div class="MuiTypography-root jss26 MuiTypography-body1"><div class="MuiTypography-root jss27 MuiTypography-body1"><canvas style="height:108px;width:108px" height="108" width="108"></canvas><div class="MuiTypography-root jss28 MuiTypography-body1"><p class="MuiTypography-root jss29 MuiTypography-body1">手机扫一扫</p><p class="MuiTypography-root jss29 MuiTypography-body1">移动阅读更方便</p></div></div></div><div class="MuiTypography-root jss9 MuiTypography-body1"><div class="MuiTypography-root jss30 MuiTypography-body1" style="height:150px"><div class="swiper-container jss32"><div class="swiper-pagination"></div><div class="swiper-wrapper"><div class="swiper-slide jss32"><a class="MuiTypography-root MuiLink-root MuiLink-underlineHover jss32 MuiTypography-colorInherit" target="_blank" rel="nofollow noopener noreferrer" href="https://qd.rs/aliyun"><img alt="阿里云服务器" class="jss31" src="https://article.cdnof.com/promotion/aliyun.jpg"/></a></div><div class="swiper-slide jss32"><a class="MuiTypography-root MuiLink-root MuiLink-underlineHover jss32 MuiTypography-colorInherit" target="_blank" rel="nofollow noopener noreferrer" href="https://qd.rs/tencent"><img alt="腾讯云服务器" class="jss31" src="https://article.cdnof.com/promotion/tencent.jpg"/></a></div><div class="swiper-slide jss32"><a class="MuiTypography-root MuiLink-root MuiLink-underlineHover jss32 MuiTypography-colorInherit" target="_blank" rel="nofollow noopener noreferrer" href="https://qd.rs/qiniu"><img alt="七牛云服务器" class="jss31" src="https://article.cdnof.com/promotion/qiniu.png"/></a></div></div></div></div></div><div class="MuiTypography-root MuiTypography-body1"><div class="MuiTypography-root jss33 MuiTypography-body1"><p class="MuiTypography-root jss34 MuiTypography-body1">你可能感兴趣的文章</p><div class="MuiList-root MuiList-padding" aria-label="main mailbox folders"></div></div></div></div></div></div><footer style="margin-top:30px"><p class="MuiTypography-root MuiTypography-body2 MuiTypography-colorTextSecondary MuiTypography-alignCenter">Copyright © <a class="MuiTypography-root MuiLink-root MuiLink-underlineHover MuiTypography-colorInherit" href="https://v2as.com" title="哇哦,有大量工具等你探索">V2AS | 问路</a> <!-- -->2023<!-- --> <!-- -->.</p><p class="MuiTypography-root MuiTypography-body2 MuiTypography-colorTextSecondary MuiTypography-alignCenter"><a class="MuiTypography-root MuiLink-root MuiLink-underlineHover MuiTypography-colorInherit" rel="nofollow noopener noreferrer" href="https://beian.miit.gov.cn/">浙ICP备15029886号</a></p></footer></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"article":{"article_id":"47891b0f-71a7-4dcc-8c75-316071cfcf97","title":"resin服务之二----整合resin+Apache服务","link":"","description":"整合resin+Apache服务\n1.为什么要整合Apache和resin?\na. 早期的resin,tomcat对httpd服务支持不好。\nb.  tomcat,resin对rewrite,expires,gzip功能支持不是很好。\nc.  动静分离。\n开始安装Apache服务\n\n\n\n\nyum -y install zlib libxml libjpeg freetype libpng gd c","image":"https://article.cdnof.com/2307/5623d059-4d9a-4dbb-8ed5-2bbdb89fa0cd.png","keywords":["resin","root","data","peng","Apache","www","application","var","httpd","jsp"],"created_at":"2023-07-08T11:26:47.162Z","html":"\u003cp\u003e\u003cstrong\u003e整合resin+Apache服务\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e1.\u003cstrong\u003e\u003cem\u003e\u003cem\u003e为什么要整合\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eApache\u003cstrong\u003e\u003cem\u003e\u003cem\u003e和\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eresin\u003c/strong\u003e\u003cstrong\u003e?\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ea.\u003c/strong\u003e \u003cstrong\u003e早期的\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e,\u003cstrong\u003e\u003cem\u003e\u003cem\u003etomcat\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e对\u003cstrong\u003e\u003cem\u003e\u003cem\u003ehttpd\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e服务支持不好。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eb.\u0026nbsp; tomcat\u003cstrong\u003e\u003cem\u003e\u003cem\u003e,\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eresin\u003cstrong\u003e\u003cem\u003e\u003cem\u003e对\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003erewrite\u003cstrong\u003e\u003cem\u003e\u003cem\u003e,\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eexpires\u003cstrong\u003e\u003cem\u003e\u003cem\u003e,\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003egzip\u003c/strong\u003e\u003cstrong\u003e功能支持不是很好。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ec.\u003c/strong\u003e \u003cstrong\u003e动静分离。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e开始安装\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e服务\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eyum -y install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ecd /home/peng/tools/\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**wget \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://archive.apache.org/dist/httpd/httpd-2.2.23.tar.gz**\"\u003ehttp://archive.apache.org/dist/httpd/httpd-2.2.23.tar.gz**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003etar -zxf httpd-2.2.23.tar.gz\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ecd httpd-2.2.23\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e./configure --prefix=/application/apache2.2.23 --enable-deflate --enable-headers --enable-modules=so --enable-so --with-mpm=worker --enable-rewrite\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003emake \u0026\u0026 make install\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ecd ../\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eln -s /application/apache2.2.23/\u0026nbsp; /application/apache\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e为\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e编译\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin mod_caucho\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e模块\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ecd /application/resin-3.1.13/\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e./configure --with-apxs=/application/apache2.2.23/bin/apxs\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ecd /application/resin/modules/c/src/\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003emake\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003emake install\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e查看多出了\u003cstrong\u003e\u003cem\u003e\u003cem\u003emod_caucho.so\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e模块:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 src]# ll /application/apache/modules/\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003etotal 180\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e-rw-r--r-- 1 root root\u0026nbsp;\u0026nbsp; 9084 Nov 29 07:00 httpd.exp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e-rwxr-xr-x 1 root root 170939 Nov 29 07:05\u003c/strong\u003e \u003cstrong\u003emod_caucho.so\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e提示:这个模块很类似\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache+php\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e结合的\u003cstrong\u003e\u003cem\u003e\u003cem\u003ePHP\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e模块一样,\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e就是通过这个\u003cstrong\u003e\u003cem\u003e\u003cem\u003emod_caucho.so\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e模块调用\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e解析\u003cstrong\u003e\u003cem\u003e\u003cem\u003eJava\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e程序的。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e在\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e配置文件中查看\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e的配置信息\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eroot@data-1-1 src]# tail -9 /application/apache/conf/httpd.conf\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e# mod_caucho Resin Configuration\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eLoadModule caucho_module /application/apache2.2.23/modules/mod_caucho.so\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResinConfigServer localhost 6800\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCauchoConfigCacheDirectory /tmp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCauchoStatus yes\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e提示\u003cstrong\u003e\u003cem\u003e\u003cem\u003e:\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e本段内容是编译后嵌入到\u003cstrong\u003e\u003cem\u003e\u003cem\u003ehttpd.conf\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e中的\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e相关配置。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e启动\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e服务测试\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 src]# /application/apache/bin/apachectl start\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 src]# lsof -i :80\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCOMMAND\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; PID\u0026nbsp;\u0026nbsp; USER\u0026nbsp;\u0026nbsp; FD\u0026nbsp;\u0026nbsp; TYPE\u0026nbsp; DEVICE SIZE/OFF NODE NAME\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eclock-app\u0026nbsp; 2712\u0026nbsp;\u0026nbsp; root\u0026nbsp;\u0026nbsp; 21u\u0026nbsp; IPv4 2827507\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 0t0\u0026nbsp; TCP www.pp.org:48706-\u003e165.254.27.91:http (CLOSE_WAIT)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ehttpd\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 22824\u0026nbsp;\u0026nbsp; root\u0026nbsp;\u0026nbsp;\u0026nbsp; 4u\u0026nbsp; IPv6 2840404\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 0t0\u0026nbsp; TCP *:http (LISTEN)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ehttpd\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 22826 daemon\u0026nbsp;\u0026nbsp;\u0026nbsp; 4u\u0026nbsp; IPv6 2840404\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 0t0\u0026nbsp; TCP *:http (LISTEN)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ehttpd\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 22828 daemon\u0026nbsp;\u0026nbsp;\u0026nbsp; 4u\u0026nbsp; IPv6 2840404\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 0t0\u0026nbsp; TCP *:http (LISTEN)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ehttpd\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 22829 daemon\u0026nbsp;\u0026nbsp;\u0026nbsp; 4u\u0026nbsp; IPv6 2840404\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 0t0\u0026nbsp; TCP *:http (LISTEN)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e浏览器上输入地址:\u003c/strong\u003e\u003ca rel=\"nofollow noopener noreferrer\" href=\"http://192.168.1.140/\"\u003e\u003cstrong\u003ehttp://192.168.1.140/\u003c/strong\u003e\u003c/a\u003e\u003cstrong\u003e查看结果\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cimg class='lazyload' data-src=\"https://article.cdnof.com/2307/5623d059-4d9a-4dbb-8ed5-2bbdb89fa0cd.png\" alt=\"\" /\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e出现上述的错误!!\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e提示:出现这个问题的原因是\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e把请求都转发给了\u003cstrong\u003e\u003cem\u003e\u003cem\u003eResinConfigServer local 6800\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e,而默认的\u003cstrong\u003e\u003cem\u003e\u003cem\u003e6800\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e端口在\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e中未生效,所以报了\u003cstrong\u003e\u003cem\u003e\u003cem\u003e503\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e错误。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e解决办法:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e修改\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e的配置内容\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 src]# tail -9 /application/apache/conf/httpd.conf\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e# mod_caucho Resin Configuration\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eLoadModule caucho_module /application/apache2.2.23/modules/mod_caucho.so\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResinConfigServer\u003c/strong\u003e \u003cstrong\u003e192.168.1.140 6911\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCauchoConfigCacheDirectory /tmp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCauchoStatus yes\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e重启服务:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 src]# /application/apache/bin/apachectl graceful\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e再次刷新页面查看显示结果\u003cstrong\u003e\u003cem\u003e\u003cem\u003eOK\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e了:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cimg class='lazyload' data-src=\"https://article.cdnof.com/2307/737753da-12d9-4692-812d-1f24860c45d5.png\" alt=\"\" /\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e在\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e中配置通过\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e解析\u003cstrong\u003e\u003cem\u003e\u003cem\u003eJava\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e程序\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e可以在\u003cstrong\u003e\u003cem\u003e\u003cem\u003ehttpd.conf\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e配置\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e全部向后转发,也可以通过标签匹配配置部分转发,或者在\u003cstrong\u003e\u003cem\u003e\u003cem\u003ehttp-vhost.conf\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e中配置虚拟主机\u003c/strong\u003e \u003cstrong\u003e实现部分向后转发。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e在\u003cstrong\u003e\u003cem\u003e\u003cem\u003ehttpd.conf\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e配置\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e全部向后转发\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# tail -9 /application/apache/conf/httpd.conf\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e# mod_caucho Resin Configuration\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eLoadModule caucho_module /application/apache2.2.23/modules/mod_caucho.so\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResinConfigServer 192.168.1.140 6911\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eSetHandler caucho-request\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCauchoConfigCacheDirectory /tmp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCauchoStatus yes\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eSetHandler caucho-request\u003cstrong\u003e\u003cem\u003e\u003cem\u003e是转发的作用,就是由\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eApache\u003cstrong\u003e\u003cem\u003e\u003cem\u003e代理的,然后把业务转发给\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eresin\u003cstrong\u003e\u003cem\u003e\u003cem\u003e,全部都往后抛,如果不加此参数,用户访问会走\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eApache\u003cstrong\u003e\u003cem\u003e\u003cem\u003e。如果增加了,当用户访问所有的请求都会有\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eApache\u003cstrong\u003e\u003cem\u003e\u003cem\u003e转给\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eresin\u003cstrong\u003e\u003cem\u003e\u003cem\u003e来处理。因此,当未加参数时默认浏览器内容应为\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eApache\u003cstrong\u003e\u003cem\u003e\u003cem\u003e服务的默认也\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eIt Works\u003cstrong\u003e\u003cem\u003e\u003cem\u003e!\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e,增加了\u003cstrong\u003e\u003cem\u003e\u003cem\u003eSetHandler\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e,出来的结果就是\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e的默认页面了。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e重启\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e服务测试,查看的内容是\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e的默认页面:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cimg class='lazyload' data-src=\"https://article.cdnof.com/2307/7c23d618-d8a4-421d-b6fa-d6713efddab1.png\" alt=\"\" /\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e当把\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e服务停掉后再次查看,所有的请求都丢给\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e处理了:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# killall java\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cimg class='lazyload' data-src=\"https://article.cdnof.com/2307/949e1cb1-a86e-41f3-8ade-2058be1be292.png\" alt=\"\" /\u003e\u003c/p\u003e\n\u003cp\u003e\u003cimg class='lazyload' data-src=\"https://article.cdnof.com/2307/8a04bdd2-cf8c-4418-9366-1b91a3b87bbe.png\" alt=\"\" /\u003e\u003c/p\u003e\n\u003cp\u003e\u003cimg class='lazyload' data-src=\"https://article.cdnof.com/2307/27dfb9f5-81df-4e4a-ba45-f46a96e81c3d.png\" alt=\"\" /\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e再次启动\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e服务浏览器上查看又\u003cstrong\u003e\u003cem\u003e\u003cem\u003eOK\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e了!!!\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e在\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e中配置虚拟主机转发\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e解析\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#\u003cstrong\u003e\u003cem\u003e\u003cem\u003e也可以根据域名虚拟主机只让后端\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003eresin\u003c/strong\u003e\u003cstrong\u003e处理一部分请求转发\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cd /application/apache/conf/extra/\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 extra]# cp httpd-vhosts.conf\u0026nbsp; httpd-vhosts.conf_$(date +%F)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 extra]#\u003c/strong\u003e \u003cstrong\u003ecat httpd-vhosts.conf\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eNameVirtualHost *:80\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cVirtualHost \\*:80\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eServerAdmin\u0026nbsp; 835221922@qq.com\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDocumentRoot \"/var/www\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDirectoryIndex index.html index.htm index.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**ServerName \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.cc**\"\u003ewww.peng.cc**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eErrorLog\u0026nbsp;\u0026nbsp; \"logs/peng-error_log\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCustomLog\u0026nbsp; \"logs/peng-access_log\" common\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cDirectory \"/var/www\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eOptions -Indexes\u0026nbsp; FollowSymLinks\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAllowOverride None\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eOrder allow,deny\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAllow from all\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/Directory\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#Resin Configuration\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResinConfigServer 192.168.1.140 6911\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#SetHandler caucho-request\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/VirtualHost\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e修改\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e主配置文件内容:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e395\u0026nbsp; # Virtual hosts\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e396\u003c/strong\u003e \u003cstrong\u003eInclude conf/extra/httpd-vhosts.conf\u003c/strong\u003e \u003cstrong\u003e---》\u003c/strong\u003e\u003cstrong\u003e此行注释要打开\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# tail -9 /application/apache/conf/httpd.conf\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e# mod_caucho Resin Configuration\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eLoadModule caucho_module /application/apache2.2.23/modules/mod_caucho.so\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#ResinConfigServer 192.168.1.140 6911\u0026nbsp;\u0026nbsp;\u0026nbsp; ---》\u003c/strong\u003e\u003cstrong\u003e虚拟主机已配置,这里注释掉!\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#SetHandler caucho-request\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCauchoConfigCacheDirectory /tmp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCauchoStatus yes\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 www]# mkdir -p /var/www/\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 www]# echo \"www.peng.cc\" \u003e/var/www/index.html\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 www]# echo '\u003c%=99+1%\u003e' \u003e /var/www/index.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 extra]# /application/apache/bin/apachectl graceful\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e默认实现了动静分离:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 extra]#\u003c/strong\u003e \u003cstrong\u003ecurl 192.168.1.140/index.html\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.cc/\"\u003ewww.peng.cc\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cat /var/www/index.html\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.cc\"\u003ewww.peng.cc\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 extra]#\u003c/strong\u003e \u003cstrong\u003ecurl 192.168.1.140/index.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chtml\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chead\u003e\u003ctitle\u003eResin Default Home Page\u003c/title\u003e\u003c/head\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cbody\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003ch1 style=\"background: #ccddff\"\u003eResin Default Home Page\u003c/h1\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eThis is the default page for the Resin web server.\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cp\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDocumentation is available \u003ca rel=\"nofollow noopener noreferrer\" href=\"/resin-doc\"\u003ehere\u003c/a\u003e.\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cp\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAdministration is available \u003ca rel=\"nofollow noopener noreferrer\" href=\"/resin-admin\"\u003ehere\u003c/a\u003e.\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/body\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/html\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 extra]# curl 192.168.1.140/test.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e99+1=100\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]#\u003c/strong\u003e \u003cstrong\u003ecat /application/resin/webapps/ROOT/test.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e99+1=\u003c%=99+1%\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e再次测试:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cp\u0026nbsp; /var/www/index.jsp\u0026nbsp; /var/www/peng.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cat /var/www/peng.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c%=99+1%\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# curl 192.168.1.140/peng.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chtml\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chead\u003e\u003ctitle\u003cstrong\u003e\u003cem\u003e\u003cem\u003e\u003e404 Not Found\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e\u003c/title\u003e\u003c/head\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cbody\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003ch1\u003e404 Not Found\u003c/h1\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e/peng.jsp was not found on this server.\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cp /\u003e\u003chr /\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003csmall\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResin/3.1.13\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/small\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/body\u003e\u003c/html\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e注意:如果是\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e解析的话,会解析出来结果;而如果是\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e解析的话,会报\u003cstrong\u003e\u003cem\u003e\u003cem\u003e404\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e的错误,所以解析的结果是\u003cstrong\u003e\u003cem\u003e\u003cem\u003e404\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e,即是\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e做了解析。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e把\u003cstrong\u003e\u003cem\u003e\u003cem\u003ejsp\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e文件拷贝到\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e默认目录下,又可以解析了\u003c/strong\u003e\u003cstrong\u003e:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cp /var/www/peng.jsp\u0026nbsp; /application/resin/webapps/ROOT/\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# curl 192.168.1.140/peng.jsp\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e100\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e在\u003cstrong\u003e\u003cem\u003e\u003cem\u003eapache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e中配置虚拟主机转发\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e解析\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e配置内容\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cat /application/apache/conf/extra/httpd-vhosts.conf\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eNameVirtualHost *:80\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cVirtualHost \\*:80\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDocumentRoot \"/var/www\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDirectoryIndex index.html index.htm index.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**ServerName \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.cc**\"\u003ewww.peng.cc**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eErrorLog\u0026nbsp;\u0026nbsp; \"logs/peng-error_log\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCustomLog\u0026nbsp; \"logs/peng-access_log\" common\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cDirectory \"/var/www\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eOptions -Indexes\u0026nbsp; FollowSymLinks\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAllowOverride None\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eOrder allow,deny\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAllow from all\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/Directory\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#Resin Configuration\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResinConfigServer 192.168.1.140 6911\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eSetHandler caucho-request\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/VirtualHost\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e启动服务\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# /application/apache/bin/apachectl graceful\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e测试\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# curl 192.168.1.140/d.html\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chtml\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chead\u003e\u003ctitle\u003e\u003cstrong\u003e\u003cem\u003e\u003cem\u003e404 Not Found\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e\u003c/title\u003e\u003c/head\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cbody\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003ch1\u003e404 Not Found\u003c/h1\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e/d.html was not found on this server.\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cp /\u003e\u003chr /\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003csmall\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResin/3.1.13\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/small\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/body\u003e\u003c/html\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e提示:访问请求先到\u003cstrong\u003e\u003cem\u003e\u003cem\u003eApache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e服务,之后抛给后端的\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e,后端没有\u003cstrong\u003e\u003cem\u003e\u003cem\u003ed.html\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e文件,则报了\u003cstrong\u003e\u003cem\u003e\u003cem\u003e404\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e错误;若停掉\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e服务,则会报\u003cstrong\u003e\u003cem\u003e\u003cem\u003e503\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e错误。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# killall java\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# killall java\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ejava: no process killed\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# curl 192.168.1.140/d.html\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chtml\u003e\u003chead\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003ctitle\u003e\u003cstrong\u003e\u003cem\u003e\u003cem\u003e503 Service Temporarily Unavailable\u003c\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e/title\u0026gt;\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/head\u003e\u003cbody\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003ch1\u003eService Temporarily Unavailable\u003c/h1\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cp\u003eThe server is temporarily unable to service your\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003erequest due to maintenance downtime or capacity\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eproblems. Please try again later.\u003c/p\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/body\u003e\u003c/html\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e调整\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e配置支持多\u003cstrong\u003e\u003cem\u003e\u003cem\u003evhost\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e主机\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eresin\u003c/strong\u003e\u003cstrong\u003e主配置文件添加如下内容\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e102\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!-- resin Configure at 2016-1-11 --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e103 \u003cserver\u003c/strong\u003e \u003cstrong\u003eid='peng01'\u003c/strong\u003e \u003cstrong\u003eaddress='192.168.1.140'\u003c/strong\u003e \u003cstrong\u003eport='6912'\u003c/strong\u003e \u003cstrong\u003ewatchdog-port=\"6922\"\u003c/strong\u003e\u003cstrong\u003e\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e104\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003chttp address=\"\\*\"** **port=\"8081\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e105\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cjvm-arg\u003e-Xmx256m\u003c/jvm-arg\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e106\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;\u003cjvm-arg\u003e-Xss1m\u003c/jvm-arg\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e107\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cjvm-arg\u003e-Xdebug\u003c/jvm-arg\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e108\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cjvm-arg\u003e-Dcom.sun.management.jmxremote\u003c/jvm-arg\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e109\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cmemory-free-min\u003e1M\u003c/memory-free-min\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e110\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cthread-max\u003e256\u003c/thread-max\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e111\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003csocket-timeout\u003e65s\u003c/socket-timeout\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e112\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003ckeepalive-max\u003e128\u003c/keepalive-max\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e113\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003ckeepalive-timeout\u003e15s\u003c/keepalive-timeout\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e114\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c/server\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e启动脚本修改如下\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 conf]# cat /etc/init.d/resin-peng\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#!/bin/bash\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#author at 20160111\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#linux startup script for Resin\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e# chkconfig: 345 85 15\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e# description: Resin is a Java Web server.\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#To install,configure this file as needed and copy init.resin\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#to /etc/rc.d/init.d as resin. Then use \"# /sbin/chkconfig resin reset\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e. /etc/init.d/functions\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eStartPath='/application/resin/bin/httpd.sh'\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResinLog=/app/logs/resinlog\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[ ! -d $ResinLog ] \u0026\u0026 mkdir -p $ResinLog\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eresind () {\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#\u003c/strong\u003e\u003cstrong\u003e如果是多进程增加上面的配置段即可。\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003efor id in peng peng01\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003edo\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e$StartPath -server $id $1 \u003e\u003e$ResinLog/resin_startup.log\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eif [ $? -eq 0 ];then\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eaction \"$1 $id resin…\" /bin/true\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eelse\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eaction \"$1 $id resin…\" /bin/false\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003efi\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003edone\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e}\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ecase \"$1\" in\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003estart)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eresind $1\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eecho \"--------checking------\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003esleep 10\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003enetstat -lnt |egrep \"80|69\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eecho \"--------checkover-----\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e;;\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003estop)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eresind $1\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e;;\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003erestart)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eresind stop\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eresind start\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e;;\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e*)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eecho \"Usage: $0 {start|stop|restart}\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eexit 1\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eesac\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eexit 0\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e启动服务\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 conf]# /etc/init.d/resin-peng restart\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003estop peng resin…\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; [FAILED]\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003estop peng01 resin…\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;[FAILED]\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003estart peng resin…\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; [\u0026nbsp; OK\u0026nbsp; ]\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003estart peng01 resin…\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; [\u0026nbsp; OK\u0026nbsp; ]\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e查看端口\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# netstat -lnt |egrep \"80|69\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003etcp\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 0\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 0 ::ffff:192.168.1.140:6911\u0026nbsp; \u0026nbsp;:::*\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; LISTEN\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003etcp\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 0\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 0 ::ffff:192.168.1.140:6912\u0026nbsp;\u0026nbsp; :::*\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; LISTEN\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003etcp\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;\u0026nbsp;0\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;0 ::ffff:127.0.0.1:6921\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; :::*\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; LISTEN\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003etcp\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;0\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;0 ::ffff:127.0.0.1:6922\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; :::*\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; LISTEN\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003etcp\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;0\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;0 :::8080\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; :::*\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; LISTEN\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003etcp\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;0\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;\u0026nbsp;0 :::80\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; :::*\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; LISTEN\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003etcp\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;0\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 0 :::8081\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; :::*\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; LISTEN\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e在\u003cstrong\u003e\u003cem\u003e\u003cem\u003eapache\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e中配置多个虚拟主机实现不同\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e解析\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cat /application/apache/conf/extra/httpd-vhosts.conf\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eNameVirtualHost *:80\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cVirtualHost \\*:80\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDocumentRoot \"/var/www\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDirectoryIndex index.html index.htm index.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**ServerName \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.cc**\"\u003ewww.peng.cc**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eErrorLog\u0026nbsp;\u0026nbsp; \"logs/peng-error_log\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCustomLog\u0026nbsp; \"logs/peng-access_log\" common\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cDirectory \"/var/www\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eOptions -Indexes\u0026nbsp; FollowSymLinks\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAllowOverride None\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eOrder allow,deny\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAllow from all\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/Directory\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#Resin Configuration\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResinConfigServer 192.168.1.140 6911\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eSetHandler caucho-request\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/VirtualHost\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cVirtualHost \\*:80\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDocumentRoot\u003c/strong\u003e \u003cstrong\u003e\"/var/blog\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDirectoryIndex index.html index.htm index.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eServerName\u003c/strong\u003e \u003cstrong\u003e\u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.org\"\u003ewww.peng.org\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eErrorLog\u0026nbsp;\u0026nbsp; \"logs/peng01-error_log\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCustomLog\u0026nbsp; \"logs/peng01-access_log\" common\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cDirectory \"/var/blog\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eOptions -Indexes\u0026nbsp; FollowSymLinks\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAllowOverride None\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eOrder allow,deny\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAllow from all\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/Directory\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#Resin Configuration\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResinConfigServer 192.168.1.140\u003c/strong\u003e \u003cstrong\u003e6912\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e#SetHandler caucho-request\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/VirtualHost\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e测试语法并启动服务:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# /application/apache/bin/apachectl -t\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eWarning: DocumentRoot [/var/blog] does not exist\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ehttpd: Could not reliably determine the server's fully qualified domain name, using 192.168.10.140 for ServerName\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eSyntax OK\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# mkdir -p /var/blog\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# /application/apache/bin/apachectl graceful\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e查看\u003cstrong\u003e\u003cem\u003e\u003cem\u003ehosts\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e文件:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cat /etc/hosts\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e127.0.0.1\u0026nbsp;\u0026nbsp; localhost localhost.localdomain localhost4 localhost4.localdomain4\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e::1\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; localhost localhost.localdomain localhost6 localhost6.localdomain6\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e192.168.10.140 data-1-1\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**192.168.1.140 \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.pp.org**\"\u003ewww.pp.org**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e测试:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# echo \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.pp.org\"\u003ewww.pp.org\u003c/a\u003e \u003e/var/blog/index.html\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**[root@data-1-1 ~]# curl \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.pp.org**\"\u003ewww.pp.org**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.pp.org/\"\u003ewww.pp.org\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e**[root@data-1-1 ~]# curl \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.pp.org/peng.jsp**\"\u003ewww.pp.org/peng.jsp**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e100\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e提示:此时查看的结果都是后端\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e的\u003cstrong\u003e\u003cem\u003e\u003cem\u003e6912\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e给的结果,那么我们想后端\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e有不同的站点目录。该怎么解决呢?\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e修改\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e主配置文件\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e删除如下内容:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e227\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!--\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e228\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; - Default host configuration applied to all virtual hosts.\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e229\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e230\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003chost-default\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e231\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!--\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e232\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; - With another web server, like Apache, this can be commented out\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e233\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; - because the web server will log this information.\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e234\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e235\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003caccess-log path=\"logs/access.log\"\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e236\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; format='%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"'\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e237\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; rollover-period=\"1W\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e238\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e239\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!-- creates the webapps directory for .war expansion --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e240\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cweb-app-deploy path=\"webapps\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e241\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e242\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!-- creates the deploy directory for .ear expansion --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e243\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cear-deploy path=\"deploy\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e244\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cear-default\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e245\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cejb-server\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e246\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cconfig-directory\u003eWEB-INF\u003c/config-directory\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e247\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c/ejb-server\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e248\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u0026nbsp;\u0026nbsp;\u003c/ear-default\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e249\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c/ear-deploy\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e250\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e251\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!-- creates the deploy directory for .rar expansion --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e252\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cresource-deploy path=\"deploy\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e253\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c/host-default\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e254\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e255\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!-- configures a deployment directory for virtual hosts --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e256\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003chost-deploy path=\"hosts\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e257\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003chost-default\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e258\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cresin:import path=\"host.xml\" optional=\"true\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e259\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c/host-default\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e260\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c/host-deploy\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e261\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e262\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!-- configures the default host, matching any host name --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e263\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003chost id=\"\" root-directory=\".\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e264\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!--\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e265\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; - configures an explicit root web-app matching the\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e266\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; - webapp's ROOT\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e267\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e268\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cweb-app id=\"/\" root-directory=\"webapps/ROOT\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e269\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e270\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cweb-app id=\"/resin-admin\" root-directory=\"${resin.home}/php/admin\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e271\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!--\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e272\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; - Administration application /resin-admin\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e273\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e274\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cprologue\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e275\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cresin:set var=\"resin\\_admin\\_external\" value=\"false\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e276\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cresin:set var=\"resin\\_admin\\_insecure\" value=\"true\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e277\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c/prologue\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e278\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c/web-app\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e279\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c/host\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e代替的添加如下内容:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c!--Create first virtual hosts at 20160112.--\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chost id=\"****www.peng.cc****\" root-directory=\"****/application/resin/webapps****\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chost-alias\u003e\u003cstrong\u003e\u003cem\u003e\u003cem\u003eblog.peng.cc\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e\u003c/host-alias\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c!--\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e- configures an explicit root web-app matching the\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e- webapp's ROOT\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e--\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cweb-app id=\"/\" root-directory=\"/application/resin/webapps/ROOT\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003csession-config cookie-domain=\"pp.org\" reuse-session-id=\"true\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003csession-timeout\u003e5\u003c/session-timeout\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003csession-max\u003e12000\u003c/session-max\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/session-config\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cservlet-mapping servlet-class='com.caucho.servlets.ResinStatusServlet'\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003curl-pattern\u003e/resin-status-peng.org\u003c/url-pattern\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cinit enable=\"read\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/servlet-mapping\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cerror-page error-code='404' location='/tips/404.html'/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/web-app\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cweb-app id=\"/resin-admin-peng.org\" root-directory=\"${resin.home}/php/admin\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003ccharacter-encoding\u003eutf8\u003c/character-encoding\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cprologue\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cresin:set var=\"resin\\_admin\\_external\" value=\"true\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cresin:set var=\"resin\\_admin\\_insecure\" value=\"true\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/prologue\u003e\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003csecurity-constraint\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cweb-resource-collection\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003curl-pattern\u003e/*\u003c/url-pattern\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/web-resource-collection\u003e\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/security-constraint\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/web-app\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cstderr-log path='/app/log/resinlog/www_stderr.log'\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003erollover-period='1W'/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cstdout-log path='/app/log/resinlog/www_stdout.log'\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003erollover-period='1W'/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/host\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c!--Create first virtual hosts at 20160112.--\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chost id=\"****www.peng.org****\" root-directory=\"/application/resin/webapps\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003chost-alias\u003e\u003cstrong\u003e\u003cem\u003e\u003cem\u003eblog.peng.org\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e\u003c/host-alias\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c!--\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e- configures an explicit root web-app matching the\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e- webapp's ROOT\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e--\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cweb-app id=\"/\" root-directory=\"****/application/resin/webapps/peng****\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003csession-config cookie-domain=\"pp.org\" reuse-session-id=\"true\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003csession-timeout\u003e5\u003c/session-timeout\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003csession-max\u003e12000\u003c/session-max\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/session-config\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cservlet-mapping servlet-class='com.caucho.servlets.ResinStatusServlet'\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003curl-pattern\u003e/resin-status-peng.org\u003c/url-pattern\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cinit enable=\"read\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/servlet-mapping\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cerror-page error-code='404' location='/tips/404.html'/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/web-app\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cweb-app id=\"/resin-admin-peng.org\" root-directory=\"${resin.home}/php/admin\"\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003ccharacter-encoding\u003eutf8\u003c/character-encoding\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cprologue\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cresin:set var=\"resin\\_admin\\_external\" value=\"true\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cresin:set var=\"resin\\_admin\\_insecure\" value=\"true\"/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/prologue\u003e\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003csecurity-constraint\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cweb-resource-collection\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003curl-pattern\u003e/*\u003c/url-pattern\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/web-resource-collection\u003e\u003c/strong\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/security-constraint\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/web-app\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cstderr-log path='/app/log/resinlog/blog_stderr.log'\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003erollover-period='1W'/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cstdout-log path='/app/log/resinlog/blog_stdout.log'\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003erollover-period='1W'/\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003c/host\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e注释掉\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e主配置中虚拟主机中的\u003cstrong\u003e\u003cem\u003e\u003cem\u003ehttp\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e端口内容:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e90\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!-- \u003chttp address=\"\\*\" port=\"8080\"/\u003e --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e104\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003c!--\u0026nbsp; \u003chttp address=\"\\*\" port=\"8081\"/\u003e --\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e启动服务\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# killall java\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# /application/resin/bin/httpd.sh -server peng start\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# /application/resin/bin/httpd.sh -server peng01 start\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e站点目录下会生成\u003cstrong\u003e\u003cem\u003e\u003cem\u003epeng\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e的目录:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# ll\u003c/strong\u003e \u003cstrong\u003e/application/resin/webapps/\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003edrwxr-xr-x\u0026nbsp; 3 root root\u0026nbsp;\u0026nbsp;\u0026nbsp; 4096 Nov 29 16:29\u003c/strong\u003e \u003cstrong\u003epeng\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e测试\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cat\u003c/strong\u003e \u003cstrong\u003e/application/resin/webapps/peng/test.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e1+1=\u003c%=1+1%\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cat\u003c/strong\u003e \u003cstrong\u003e/application/resin/webapps/ROOT/test.jsp\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e99+1=\u003c%=99+1%\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e修改\u003cstrong\u003e\u003cem\u003e\u003cem\u003ehosts\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e文件:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e[root@data-1-1 ~]# cat /etc/hosts\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e192.168.1.140 \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.cc\u0026nbsp;\"\u003ewww.peng.cc\u0026nbsp;\u003c/a\u003e \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.org\"\u003ewww.peng.org\u003c/a\u003e blog.peng.cc\u0026nbsp;\u0026nbsp; blog.peng.org\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e开始测试:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**[root@data-1-1 ~]# curl \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.cc/test.jsp**\"\u003ehttp://www.peng.cc/test.jsp**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e99+1=100\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**[root@data-1-1 ~]# curl \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://blog.peng.cc/test.jsp**\"\u003ehttp://blog.peng.cc/test.jsp**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e99+1=100\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**[root@data-1-1 ~]# curl \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://blog.peng.org/test.jsp**\"\u003ehttp://blog.peng.org/test.jsp**\u003c/a\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e1+1=2\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**[root@data-1-1 ~]# curl \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.org/test.jsp**\"\u003ehttp://www.peng.org/test.jsp**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e1+1=2\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e因为\u003cstrong\u003e\u003cem\u003e\u003cem\u003eresin\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e主配置文件关掉了\u003cstrong\u003e\u003cem\u003e\u003cem\u003e8080\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e和\u003cstrong\u003e\u003cem\u003e\u003cem\u003e8081\u003c/em\u003e\u003c/strong\u003e\u003c/em\u003e端口,所以带端口查看会报错:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**[root@data-1-1 ~]# curl \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://blog.peng.org:8080/test.jsp**\"\u003ehttp://blog.peng.org:8080/test.jsp**\u003c/a\u003e \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ecurl: (7) couldn't connect to host\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**[root@data-1-1 ~]# curl \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://blog.peng.org:8081/test.jsp**\"\u003ehttp://blog.peng.org:8081/test.jsp**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ecurl: (7) couldn't connect to host\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**[root@data-1-1 ~]# curl \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.org:8081/test.jsp**\"\u003ehttp://www.peng.org:8081/test.jsp**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ecurl: (7) couldn't connect to host\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e**[root@data-1-1 ~]# curl \u003ca rel=\"nofollow noopener noreferrer\" href=\"http://www.peng.org:8080/test.jsp**\"\u003ehttp://www.peng.org:8080/test.jsp**\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ecurl: (7) couldn't connect to host\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e理解结构图:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cimg class='lazyload' data-src=\"https://article.cdnof.com/2307/7bc68083-bf5a-4fae-bcca-dece3664dddd.png\" alt=\"\" /\u003e\u003c/strong\u003e\u003c/p\u003e"},"seo":{"title":"resin服务之二----整合resin+Apache服务","description":"整合resin+Apache服务\n1.为什么要整合Apache和resin?\na. 早期的resin,tomcat对httpd服务支持不好。\nb.  tomcat,resin对rewrite,expires,gzip功能支持不是很好。\nc.  动静分离。\n开始安装Apache服务\n\n\n\n\nyum -y install zlib libxml libjpeg freetype libpng gd c","image":"https://article.cdnof.com/2307/5623d059-4d9a-4dbb-8ed5-2bbdb89fa0cd.png","url":"https://v2as.com/article/47891b0f-71a7-4dcc-8c75-316071cfcf97","keywords":["resin","root","data","peng","Apache","www","application","var","httpd","jsp"]},"viewsCount":1,"promotionList":[{"title":"阿里云服务器","image":"https://article.cdnof.com/promotion/aliyun.jpg","link":"https://qd.rs/aliyun"},{"title":"腾讯云服务器","image":"https://article.cdnof.com/promotion/tencent.jpg","link":"https://qd.rs/tencent"},{"title":"七牛云服务器","image":"https://article.cdnof.com/promotion/qiniu.png","link":"https://qd.rs/qiniu"}],"similarKeywordsList":null},"__N_SSG":true},"page":"/article/[article_id]","query":{"article_id":"47891b0f-71a7-4dcc-8c75-316071cfcf97"},"buildId":"7EtL49Y65E8zx1NwcIC_o","isFallback":false,"gsp":true,"scriptLoader":[]}</script></body></html>