今天我遇到一个问题:
我的配置是:win2k server+iis(虚拟主机)+resin+php+mysql+apache(偶尔用到)
一切服务运行正常
首先在IIS里默认的主机,我添加了主机头,比如:http://abc.com,并访问http://abc.com/jspbbs,是正常访问的,该论坛是用jsp+mysql做的.
resin.conf设置默认路径是:f:/abc
jspbbs是虚拟目录
然后我在IIS里新增一个网站,并添加相应的主机头,比如:http://edf.com,并在f:/edf设置为主目录,在主目录下写了一个test.jsp,访问出现500错误.
我看不行,就把edf.com下的文件全部copy到abc.com下,再用http://edf.com/test.jsp访问还是不行,但用http://abc.com/test.jsp却是好的,不知道是什么原因,请指教!!
终于搞定了,哈哈,原来需要在新建的主机上,新建一个虚拟主目录Scripts,然后还要在resin.conf里添加
<host id='javdl.com www.javadl.com'app-dir='F:/www/home/javadl'>
<!--
- The standalone server should uncomment for access logging.
- With another web server, like Apache, the web server will
- log this information.
-->
<access-log id='logs/access.log'
format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
rollover-period='1W'/>
<error-log id='logs/error.log'/>
<!--
- Specifies an automatically-expanding .war dir. Any foo.war
- file will be expanded to a /foo application.
-->
<war-dir id='webapps'/>
<web-app id='/'>
<!--
- The classpath directive may be repeated. Source is optional
- Servlets and beans generally belong in WEB-INF/classes
-->
<classpath id='WEB-INF/classes'
source='WEB-INF/classes'
compile='true'/>
<session-config>
<session-max>4096</session-max>
<session-timeout>30</session-timeout>
<enable-cookies>true</enable-cookies>
<enable-url-rewriting>true</enable-url-rewriting>
<!--
- Store sessions in the filesystem, so they can persist across
- servlet and class changes.
-
- Uncomment this during development.
-->
<!--
- <file-store>WEB-INF/sessions</file-store>
-->
</session-config>
<!-- enable multipart-mime/form processing -->
<!--
- <multipart-form upload-max='-1'/>
-->
<!-- /~user maps to user directories -->
<path-mapping url-regexp='^/~([^/]*)'
real-path='/home/$1/public_html/'/>
</web-app>
<!--
- The following entries configuration the examples. You may safely
- delete anything from heredo
wn.
-->
<!--
- Define applications (ServletContexts) for the examples.
- Since applications are entirely separate from one another,
- including session variables and servlet-mappings, the
- servlet-mapping declarations need to be repeated.
-->
<web-app id='java_tut'/>
<web-app id='examples/basic'>
<!-- Application init parameters, see Env.java to get the values -->
<context-param info='An application information string'/>
<!-- snoop-servlet handles all urls starting with /snoop -->
<servlet-mapping url-pattern='/snoop/*' servlet-name='snoop-servlet'/>
<!-- configure snoop-servlet with init parameters -->
<servlet servlet-name='snoop-servlet' servlet-class='Env'>
<init-param info='A servlet information string'/>
</servlet>
</web-app>
<web-app id='javadl'/>
<web-app id='news'/>
<web-app id='examples/tags'/>
<web-app id='examples/tictactoe'/>
<web-app id='examples/navigation'/>
<web-app id='examples/xsl'/>
<web-app id='examples/templates'>
<servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>
<servlet-mapping url-pattern='/GuestJsp' servlet-name='GuestJsp'/>
<servlet-mapping url-pattern='/GuestXtp' servlet-name='GuestXtp'/>
<servlet-mapping url-pattern='/RSS' servlet-name='jsp.RSS'/>
<servlet servlet-name='GuestJsp' servlet-class='jsp.GuestJsp'/>
<servlet servlet-name='GuestXtp' servlet-class='jsp.GuestXtp'/>
</web-app>
<web-app id='/examples/login'/>
</host>
搞定,厉害吧,哈哈
自己一个人摸索出来的,问一些人,人家理都不理,还是靠自己才是真的.