Virtual Hosts with Apache or IIS |
A common configuration uses virtual hosts with Apache or IIS. As usual, Apache or IIS will pass matching requests to Resin.
Apache
The Resin JVM configuration with Apache is identical to the standalone configuration. That similarity makes it easy to debug the Apache configuration by retreating to Resin standalone if needed.
The
directive in Apache is vital to make Resin's virtual hosting work. When Apache passes the request to Resin, it tells Resin the . Without the , Resin can get very confused which host to serve.
LoadModule caucho_module /usr/local/apache/libexec/mod_caucho.so ResinConfigServer localhost 6802 <VirtualHost 127.0.0.1> ServerName gryffindor.caucho.com </VirtualHost> <VirtualHost 192.168.0.1> ServerName slytherin.caucho.com </VirtualHost> |
Note: You'll the LoadModule must appear before the ResinConfigServer for Apache to properly understand the ResinConfigServer command. If they're missing, Apache will send an error.
记得要在apache里配置ServiceName哦。不然Resin不知道选择哪个应用响应request的。未完,待续
如果一个Resin有多个工程。如果前面的工程不能启动,那么后面的工程也就不能启动。跟Tomcat一样的。
今天在调试的时候,发现项目一直启动不起来,在启动完memcached的时候,就一直停在哪里不动了。重新启动几次也检查了配置文件。都发现没有问题。然后想了想
原来有一个前面的项目是需要启动MQ的,但是我没有启动。所以启动了memcached后就停止不动了(不像tomcat,直接报错)。于是,我把resin.conf中的那个工程
也就是virtual host 给注释了。重新启动Resin。访问项目。成功了。顺带一下,Resin的文档写得很详细。一般英文的人都能看懂。