Gregg
Gregg

Reputation: 35904

Standard location for external web (Grails) application config files on linux

Is there a standard location on Linux (Ubuntu) to place external config files that a web application (Grails) uses?

UPDATE: Apparently, there is some confusion to my question. The way Grails handles config files is fine. I just want to know if there is a standard location on linux to place configuration files. Similar to how there is a standard for log files (/var/log). If it matters, I'm talking about a production system.

Upvotes: 1

Views: 1246

Answers (3)

Shilad Sen
Shilad Sen

Reputation: 114

Linux configuration files typically reside in /etc. For example, apache configuration files live in /etc/httpd. Configuration file not associated with standard system packages often live in /usr/local/etc.

So I'd suggest /usr/local/etc/my-grails-app-name/. Beware that this means you can't run two different configurations of the same app on the same server.

Upvotes: 2

Dónal
Dónal

Reputation: 187399

There's a plugin Standardized external configuration for your app which you might find useful if the grails.config.locations parameter is insufficient.

Upvotes: 0

gotomanners
gotomanners

Reputation: 7926

I don't believe there is a standard location. You usually define the location for your external config files via the grails.config.locations property in config.groovy.

EDIT

After reading your comment, I suppose the standard locations would be:

  • Somewhere on the classpath

OR

  • In the .grails folder in your home directory.

As these are the defaults in config.groovy file.

grails.config.locations = [ "classpath:${appName}-config.properties",
                            "classpath:${appName}-config.groovy",
                            "file:${userHome}/.grails/${appName}-config.properties",
                            "file:${userHome}/.grails/${appName}-config.groovy"]

Upvotes: 0

Related Questions