tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: problem finding css
Date Thu, 24 Jul 2003 14:01:32 GMT
> I assume the main.css is looked up in
> /home/oraedt/app/oracle/product/9iAS_1.0.2.2/jakarta-tomcat-4.1.24/webapps/iprweb
> because of my:
> <VirtualHost *>
>   DocumentRoot
> /home/oraedt/app/oracle/product/9iAS_1.0.2.2/jakarta-tomcat-4.1.24/webapps/iprweb
>   ServerName
>   JkMount /iprweb/* ajp13
> </VirtualHost>

Apache first select the virtual host, then uses the settings given for
that VirtualHost.  If the HirtualHost declares a document root, then
that overrides the DocumentRoot in the main server config.

Apache does not traverse virtualhosts when attempting to fulfill a
request.  It selects (the most specific) one and uses it.

> My problem is therefore:
> How do I tell Apache to take main.css from the "global" DocumentRoot in
> http.conf and only the web
> application from the one in the <VirtualHost> directive. Static text as
> well as web should use the same machine/port number.
> I guess I have to read about the VirtualHost tag more.

I'd recommend not using <VirtualHost *>.  Name them explictily (you
can use ServerAlias to provide alternate names if needed).  If a
request does not match any of the virtualhosts listed, the server will
use the first one in the list.  You can think of that as a default.

For serving multiple sites with one server, I'd do one step further;
get rid of the document root in the main server config, and use a
virtual host for each site.  If nothing else, the layout will be
clearer, and it will be easier to understand what's going on.

If all else fails, there's the quick and dirty solution.  Find the
line in the error logs that mentions the missing file

  [Thu Jul 24 09:38:38 2003] [error] [client] File does not exist: /path/to/main.css

And make a symlink :)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message