aspose file tools*
The moose likes Tomcat and the fly likes Set JAAS Config File in  Tomcat7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Set JAAS Config File in  Tomcat7" Watch "Set JAAS Config File in  Tomcat7" New topic
Author

Set JAAS Config File in Tomcat7

Thangavel Loganathan
Greenhorn

Joined: Jun 05, 2009
Posts: 9
Hi Techies,

I am implementing JAAS with Tomcat7, I want set JAVA_OPTS=$JAVA_OPTS -Djava.security.auth.login.config==$CATALINA_BASE/conf/jaas.config.

Normally we can set this entry in catalina.bat file in Tomcat6 and other older version. I am struggling to set in Tomcat7 because this doesn't contains any bat file inside the bin directory.

Please help me on this. Thanks in advance.

Thanks,
----
Thangavel
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20

In Tomcat6 you could create a TOMCAT_HOME/bin/setenv.sh (or, for Windows, setenv.bat) and assign your JAVA_OPTS values there. I recommend this because it keeps you from having to modify the Tomcat control scripts.

I haven't checked lately, but I am fairly sure that this can still be done in Tomcat 7.


Customer surveys are for companies who didn't pay proper attention to begin with.
Thangavel Loganathan
Greenhorn

Joined: Jun 05, 2009
Posts: 9
Hi Tim,

Thanks for your reply, I can create sh or bat file inside the bin folder, fine. How to configure that bat or sh file will be get called when the server starts up?

Please suggest me.

Thanks,

Thangavel L Nathan
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20

The Tomcat startup should be testing to see if it is present and if it is, it will execute it automatically. Not only at startup, but also at shutdown.
Bill L Miller
Greenhorn

Joined: Apr 29, 2013
Posts: 1
If Tomcat is setup using a Windows Service, the .BAT/.CMD files will not be called. To setup the parameters in a Windows service just run the .EXE Tomcat7w.exe found in the /bin directory. You will see a panel that allows you to add -D properties (and adjust memory and other common settings).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Set JAAS Config File in Tomcat7