tomcat plugin - where is server.xml and tomcat-users.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
sub
Reply | Threaded
Open this post in threaded view
|

tomcat plugin - where is server.xml and tomcat-users.xml

sub
Hi all,

I've searched high and low (including a search of my .grails directory) but I cannot find any of the tomcat configuration files... can any one help?

I want to enable symbolic links inside my webapp structure so that I don't have to store large libraries inside my code repository.

Note I'm talking about enabling sym links in the development tomcat server that runs when I execute grails run-app

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: tomcat plugin - where is server.xml and tomcat-users.xml

Lari Hotari -
On 11.01.2010 08:52, sub wrote:
Hi all,

I've searched high and low (including a search of my .grails directory) but
I cannot find any of the tomcat configuration files... can any one help?

I want to enable symbolic links inside my webapp structure so that I don't
have to store large libraries inside my code repository.

Note I'm talking about enabling sym links in the development tomcat server
that runs when I execute grails run-app

Thanks!
  

There is no server.xml , but you can configure the embedded Tomcat by hooking to the eventConfigureTomcat event.

Here's an example of adding an alias to the embedded Tomcat:

Create _Events.groovy in your /scripts directory of your project:

eventConfigureTomcat = {tomcat ->
    def ctx=tomcat.host.findChild(serverContextPath)
    ctx.aliases += ',/extjs=/opt/extjs'
}

tomcat is instance of org.apache.catalina.startup.Tomcat (source code: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java?revision=HEAD&view=markup )

In this example http://localhost:8080/myapp/extjs will load files under /opt/extjs directory

This blog article might help too:
http://krollrich.blogspot.com/2009/12/run-java-web-application-within-grails.html

Source code of Tomcat plugin:
http://fisheye.codehaus.org/browse/grails/trunk/grails-plugins/grails-tomcat/trunk/src/groovy/org/grails/tomcat/TomcatServer.groovy

Regards,

Lari
Reply | Threaded
Open this post in threaded view
|

Re: tomcat plugin - where is server.xml and tomcat-users.xml

Michael Baehr
In reply to this post by sub
That's what I put in _Events.groovy:

eventConfigureTomcat = {tomcat ->
        def ctx=tomcat.host.findChild(serverContextPath)
        ctx.allowLinking = true
}

This seems to work - had 404s before, but not anymore.

cu

Michael

sub wrote
Hi all,

I've searched high and low (including a search of my .grails directory) but I cannot find any of the tomcat configuration files... can any one help?

I want to enable symbolic links inside my webapp structure so that I don't have to store large libraries inside my code repository.

Note I'm talking about enabling sym links in the development tomcat server that runs when I execute grails run-app

Thanks!
sub
Reply | Threaded
Open this post in threaded view
|

Re: tomcat plugin - where is server.xml and tomcat-users.xml

sub
In reply to this post by Lari Hotari -
Thanks very much for both posts - no wonder I couldn't find server.xml :)

There is obviously much for me to learn - though I have to say I could not find any documentation describing how the plugin works.

Cheers

Lari Hotari wrote
On 11.01.2010 08:52, sub wrote:
> Hi all,
>
> I've searched high and low (including a search of my .grails directory) but
> I cannot find any of the tomcat configuration files... can any one help?
>
> I want to enable symbolic links inside my webapp structure so that I don't
> have to store large libraries inside my code repository.
>
> Note I'm talking about enabling sym links in the development tomcat server
> that runs when I execute grails run-app
>
> Thanks!
>    

There is no server.xml , but you can configure the embedded Tomcat by
hooking to the eventConfigureTomcat event.

Here's an example of adding an alias to the embedded Tomcat:

Create _Events.groovy in your /scripts directory of your project:

|eventConfigureTomcat = {tomcat ->
     def ctx=tomcat.host.findChild(serverContextPath)
     ctx.aliases += ',/extjs=/opt/extjs'
}

tomcat is instance of org.apache.catalina.startup.Tomcat (source code:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java?revision=HEAD&view=markup 
)

In this example http://localhost:8080/myapp/extjs will load files under
/opt/extjs directory

|This blog article might help too:
http://krollrich.blogspot.com/2009/12/run-java-web-application-within-grails.html

Source code of Tomcat plugin:
http://fisheye.codehaus.org/browse/grails/trunk/grails-plugins/grails-tomcat/trunk/src/groovy/org/grails/tomcat/TomcatServer.groovy

Regards,

Lari