EMEN2 Configuration

EMEN2 uses JSON for the config file format, although YAML is also supported if a suitable parser is found. The default configuration file (emen2/db/config.base.json) is presented below, with comments detailing each setting.

Any config.json files found in the database directory, $EMEN2DBHOME, will be loaded on top of the base config, overriding any values. I present a typical installation's config.json file later on in this page.

Only the "paths" section is treated specially -- items without leading slashes are interpreted relative to $EMEN2DBHOME, items with leading slashes are left as absolute path references.

Base Configuration

{
        // These paths either absolute, or relative to EMEN2DBHOME, depending on the presence of leading slash
        "paths":{

                // Log directory: access.log, error.log, debug.log (see logging section) 
                "LOGPATH": "applog",
                "EMEN2JOBFILE": "applog/emen2job",
                "EMEN2ERRLOG":"applog/emen2errlog",
                "DEBUGLOG":"applog/debug.log",

                // Berkeley DB Hot Backup directory, for incremental backups and failover. Backup offsite.
                "HOTBACKUP": "db_hotbackup",

                // Berkeley DB Log Archive directory. You will want to carefully back these up.
                "LOG_ARCHIVE": "log_archive",

                // Thumbnails and other files derived from primary data
                "TILEPATH": "tiles",
                
                // Temporary directory to use for graphs and other temporary files
                "TMPPATH": "tmp",
                
                /* Raw data storage area. You may want to place this on a large raid array.
                You can also set this up to split file storage by date, e.g.:
                        '0': '/raid1/', 
                        '20080501': '/raid2/',
                        '20100101': '/raid3/'
                Files from beginning -> May 2008 will be on /raid1, May 2008 to Jan 2010 on /raid2, and files after Jan 2010 on /raid3 */               
                "BINARYPATH":{
                        "0": "emen2data"
                },

                // Path to SSL certificates
                "SSLPATH": "ssl",

                // Alternate views and templates to be loaded 
                "TEMPLATEDIRS": ["templates"],
                "VIEWPATHS": ["views"],

                // Load additional files. Typically this will only be used by the system installed base config file.
                "CONFIGFILES" :[
                        "/etc/emen2config.json",
                        "config.json"
                ]
        },

        // Mail settings. If both of these are set, EMEN2 will send emails during certain events.
        "mailsettings":{
                "MAILADMIN": false,
                "MAILHOST": false
        },

        // Web-server related settings
        "network":{
                
                // Number of web server threads to run
                "EMEN2EXTURI": "",

                "NUMTHREADS": 5,
                "EMEN2PORT": 8080,

                // HTTPS port. You will need to place the SSL certificate and key files in the SSL directory
                "EMEN2HTTPS": 0,

                // The EMEN2 URI root -- e.g., "/testserver" or "http://ncmidb.bcm.edu/challenge". Useful for running behind a reverse proxy.
                "EMEN2WEBROOT": ""
        },

        // You probably don't want to change any of these.
        "params":{
                "BLOCKLENGTH": 100000,
                "VERSION": 20100911,
                "TIMESTR": "%Y/%m/%d %H:%M:%S",
                "MAXRECURSE": 50,
                "MAXIDLE": 604800
        },

        // Some basic settings and interface strings
        "customization":{

                // Short string for database identification. This shows up several places in the UI
                "EMEN2DBNAME": "EMEN2",

                // New users will be added to these groups
                "GROUP_DEFAULTS": ["create"],
                
                // Logo in emen2/web/static/images to use
                "EMEN2LOGO": "emen2logo-small.png",
                
                // These words will not be indexed
                "UNINDEXED_WORDS": ["in", "of", "for", "this", "the", "at", "to", "from", "at", "for", "and", "it", "or"]
        },

        // Bookmarks to some key records.
        "bookmarks":{
                "BOOKMARKS":{
                        "EQUIPMENT":0,
                        "GROUPS":0,
                        "PROJECTS":0
                }
        },

        // Load the default templates.
        "viewsettings":{
                "TEMPLATEDIRS_DEFAULT":true
        },

        // Verbose logging
        "logging":{
                "DEBUG":false,
                "LOG_LEVEL":"LOG_INFO"
        },

        // Path to EMAN2 python; if you are using an EMAN2 binary you will want to set this.
        "EMAN2":{
                "EMAN2PYTHON":"python"
        },

        // Path to ImageMagick programs. Used for generating thumbnails.
        "IMAGEMAGICK":{
                "CONVERTPATH":"convert"
        }
}

Example Custom Configuration

This is a $EMEN2DBHOME/config.json file based on our EMEN2 installation. Again, note that the "paths" section is treated specially -- paths without a leading slash are interpreted relative to $EMEN2DBHOME, paths with a leading slash are left as absolute.

{
    "EMAN2": {
        "EMAN2PYTHON": "/usr/local/bin/python"
    }, 
    "bookmarks": {
        "BOOKMARKS": {
            "BANNER": 448491, 
            "BANNER_NOAUTH": 449989, 
            "EQUIPMENT": 270940, 
            "GROUPS": 0, 
            "PROJECTS": 136
        }
    }, 
    "mailsettings": {
        "MAILADMIN": "webadmin@blake.grid.bcm.edu", 
        "MAILHOST": "blake.grid.bcm.edu"
    }, 
    "network": {
        "EMEN2DBNAME": "NCMI Database", 
        "EMEN2EXTURI": "http://ncmidb.bcm.edu", 
        "EMEN2LOGO": "ncmi2006-logo2-white.png", 
        "EMEN2PORT": 80, 
        "EMEN2WEBROOT": "", 
        "NUMTHREADS": 5
    }, 
    "paths": {
        "BINARYPATH": {
            "0": "/raid1/emen2", 
            "20050101": "/raid2/emen2", 
            "20070321": "/raid3/emen2"
        }, 
        "LOG_ARCHIVE": "/home/emen2/log_archive", 
        "TEMPLATEDIRS": [
            "/home/emen2/db/overlay/templates"
        ], 
        "VIEWPATHS": [
            "/home/emen2/db/overlay/views"
        ]
    }
}

EMEN2/config (last edited 2010-09-22 07:15:32 by root)