====== Cantaloupe stand-alone (3.3.2 -> 3.4 -> 4.0)====== **For a fresh install >= 4.0 goto "FRESH INSTALL or UPGRADE to 4.0"** **3.3.2** wget https://github.com/medusa-project/cantaloupe/releases/download/v3.3.2/Cantaloupe-3.3.2.zip unzip Cantaloupe-3.3.2.zip sudo mv Cantaloupe-3.3.2 /opt/cantaloupe sudo mkdir /srv/cache /srv/log /srv/home sudo useradd -d /srv/home -s /bin/false cantaloupe sudo chown -R cantaloupe:cantaloupe /srv/home /srv/cache /srv/log /opt/cantaloupe cd /opt/cantaloupe/ sudo cp cantaloupe.properties.sample cantaloupe.properties sudo nano -w cantaloupe.properties * General settings < http.host = 0.0.0.0 > http.host = 123.123.123.123 < FilesystemResolver.BasicLookupStrategy.path_prefix = /home/myself/images/ > FilesystemResolver.BasicLookupStrategy.path_prefix = /tmp/ < log.application.level = debug > log.application.level = warn < log.application.ConsoleAppender.enabled = true > log.application.ConsoleAppender.enabled = false < log.application.FileAppender.pathname = /path/to/logs/application.log > log.application.FileAppender.pathname = /srv/log/application.log < log.application.RollingFileAppender.enabled = false > log.application.RollingFileAppender.enabled = true < log.application.RollingFileAppender.pathname = /path/to/logs/application.log > log.application.RollingFileAppender.pathname = /srv/log//application.log < log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/application-%d{yyyy-MM-dd}.log > log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log//application-%d{yyyy-MM-dd}.log * Jpeg2000 settings processor.jp2 = KakaduProcessor OR processor.jp2 = OpenJpegProcessor * Configure Cantaloupe for Resolver HTTP. < StreamProcessor.retrieval_strategy = StreamStrategy > StreamProcessor.retrieval_strategy = CacheStrategy < cache.source = > cache.source = FilesystemCache < cache.derivative = > cache.derivative = FilesystemCache < cache.server.ttl_seconds = 2592000 > cache.server.ttl_seconds = 259200 < cache.server.worker.enabled = false > cache.server.worker.enabled = true < FilesystemCache.pathname = /var/cache/cantaloupe > FilesystemCache.pathname = /srv/cache < resolver.static = FilesystemResolver > resolver.static = HttpResolver < HttpResolver.BasicLookupStrategy.url_prefix = http://localhost/images/ > HttpResolver.BasicLookupStrategy.url_prefix = < HttpResolver.BasicLookupStrategy.url_suffix = > HttpResolver.BasicLookupStrategy.url_suffix = * Run cd /opt/cantaloupe sudo -s sudo -u cantaloupe nohup java -Dcantaloupe.config=/opt/cantaloupe/cantaloupe.properties -Xmx7g -jar Cantaloupe-3.3.2.war & **NOTE:** add Image Server IP to /usr/local/fedora/data/fedora-xacml-policies/repository-policies/default/deny-apim-if-not-localhost.xml * Clear cache on daily basis crontab -l 00 23 * * * /root/purge.sh >> /root/purge.log 2>&1 cat /root/purge.sh #! /bin/bash cd /opt/cantaloupe sudo -u cantaloupe java -Dcantaloupe.config=/opt/cantaloupe/cantaloupe.properties -Dcantaloupe.cache.purge -jar Cantaloupe-3.3.3.war \\ \\ **UPGRADE to 3.4** \\ * add cantaloupe user to tty group to enable write to /dev/stdout * sudo mkdir /srv/tmp ; sudo chown -R cantaloupe:cantaloupe /srv/tmp * new settings and changed variable names sudo nano -w cantaloupe.properties * General settings < temp_pathname = > temp_pathname = /srv/tmp < http.host = 0.0.0.0 > http.host = 123.123.123.123 < FilesystemResolver.BasicLookupStrategy.path_prefix = /home/myself/images/ > FilesystemResolver.BasicLookupStrategy.path_prefix = /tmp/ < log.application.level = debug > log.application.level = warn < log.application.ConsoleAppender.enabled = true > log.application.ConsoleAppender.enabled = false < log.application.FileAppender.pathname = /path/to/logs/application.log > log.application.FileAppender.pathname = /srv/log/application.log < log.application.RollingFileAppender.enabled = false > log.application.RollingFileAppender.enabled = true < log.application.RollingFileAppender.pathname = /path/to/logs/application.log > log.application.RollingFileAppender.pathname = /srv/log/application.log < log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/application-%d{yyyy-MM-dd}.log > log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log//application-%d{yyyy-MM-dd}.log < log.error.FileAppender.enabled = false < log.error.FileAppender.pathname = /path/to/logs/error.log > log.error.FileAppender.enabled = true > log.error.FileAppender.pathname = /srv/log/error.log < log.error.RollingFileAppender.pathname = /path/to/logs/error.log > log.error.RollingFileAppender.pathname = /srv/log/error.log < log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/error-%d{yyyy-MM-dd}.log > log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/error-%d{yyyy-MM-dd}.log < log.access.FileAppender.pathname = /path/to/logs/access.log > log.access.FileAppender.pathname = /srv/log/access.log < log.access.RollingFileAppender.pathname = /path/to/logs/access.log > log.access.RollingFileAppender.pathname = /srv/log/access.log < log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/access-%d{yyyy-MM-dd}.log > log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/access-%d{yyyy-MM-dd}.log * Endpoints < endpoint.iiif.content_disposition = none > endpoint.iiif.content_disposition = inline * Processor/Jpeg2000 settings processor.jp2 = KakaduProcessor OR processor.jp2 = OpenJpegProcessor < processor.limit_to_8_bits = true > processor.limit_to_8_bits = false * Configure Cantaloupe for Resolver HTTP. < StreamProcessor.retrieval_strategy = StreamStrategy > StreamProcessor.retrieval_strategy = CacheStrategy < cache.server.source.enabled = false > cache.server.source.enabled = true < cache.server.derivative.enabled = false > cache.server.derivative.enabled = true < cache.server.derivative = > cache.server.derivative = FilesystemCache < cache.server.ttl_seconds = 2592000 > cache.server.ttl_seconds = 259200 < cache.server.worker.enabled = false > cache.server.worker.enabled = true < FilesystemCache.pathname = /var/cache/cantaloupe > FilesystemCache.pathname = /srv/cache < resolver.static = FilesystemResolver > resolver.static = HttpResolver < HttpResolver.trust_all_certs = false > HttpResolver.trust_all_certs = true < HttpResolver.BasicLookupStrategy.url_prefix = http://localhost/images/ > HttpResolver.BasicLookupStrategy.url_prefix = < HttpResolver.BasicLookupStrategy.url_suffix = > HttpResolver.BasicLookupStrategy.url_suffix = < HttpResolver.auth.basic.username = < HttpResolver.auth.basic.secret = > HttpResolver.auth.basic.username = anonymous > HttpResolver.auth.basic.secret = anonymous \\ **FRESH INSTALL or UPGRADE to 4.0** \\ * download wget https://github.com/medusa-project/cantaloupe/releases/download/v4.0/cantaloupe-4.0.zip unzip cantaloupe-4.0.zip sudo mv cantaloupe-4.0 /opt/ sudo mkdir /srv/cache /srv/log /srv/home sudo useradd -d /srv/home -s /bin/false cantaloupe sudo chown -R cantaloupe:cantaloupe /opt/cantaloupe-4.0 * Kakadu Native libraries Check Java Library Path with: java -XshowSettings:properties sudo cp /opt/cantaloupe-4.0/deps/Linux-x86-64/lib/libkdu_* /usr/lib/ * new settings and changed variable names cd /opt/cantaloupe-4.0 sudo cp cantaloupe.properties.sample cantaloupe.properties sudo nano -w cantaloupe.properties --- cantaloupe_4.0.properties.sample +++ cantaloupe_4.0.properties @@ -11,11 +11,11 @@ ########################################################################### # !! Leave blank to use the JVM default temporary directory. -temp_pathname = +temp_pathname = /srv/tmp # !! Configures the HTTP server. (Standalone mode only.) http.enabled = true -http.host = 0.0.0.0 +http.host = 123.123.123.123 http.port = 8182 http.http2.enabled = false @@ -98,23 +98,23 @@ # Minimum size that will be used in info.json `tiles` keys. The user manual # explains how these are calculated. -endpoint.iiif.min_tile_size = 512 +endpoint.iiif.min_tile_size = 1024 # Enables the administrative HTTP API. (See the user manual.) -endpoint.api.enabled = false +endpoint.api.enabled = true # HTTP Basic credentials to access the HTTP API. -endpoint.api.username = -endpoint.api.secret = +endpoint.api.username = yourusername +endpoint.api.secret = yourpassword ########################################################################### # SOURCES @@ -122,7 +122,7 @@ # Uses one source for all requests. Available values are `FilesystemSource`, # `HttpSource`, `JdbcSource`, `S3Source`, and `AzureStorageSource`. -source.static = FilesystemSource +source.static = HttpSource # If true, `source.static` will be overridden, and the `source()` delegate # method will be used to select a source per-request. @@ -139,7 +139,7 @@ # Server-side path that will be prefixed to the identifier in the URL. # Trailing slash is important! -FilesystemSource.BasicLookupStrategy.path_prefix = /home/myself/images/ +FilesystemSource.BasicLookupStrategy.path_prefix = /tmp/ # Server-side path or extension that will be suffixed to the identifier in # the URL. @@ -149,8 +149,8 @@ # HttpSource #---------------------------------------- -HttpSource.trust_all_certs = false -HttpSource.request_timeout = +HttpSource.trust_all_certs = true +HttpSource.request_timeout = 10 # Tells HttpSource how to look up resources. Allowed values are # `BasicLookupStrategy` and `ScriptLookupStrategy`. ScriptLookupStrategy @@ -159,15 +159,15 @@ # URL that will be prefixed to the identifier in the request URL. # Trailing slash is important! -HttpSource.BasicLookupStrategy.url_prefix = http://localhost/images/ +HttpSource.BasicLookupStrategy.url_prefix = # Path, extension, query string, etc. that will be suffixed to the # identifier in the request URL. HttpSource.BasicLookupStrategy.url_suffix = # Enables access to resources that require HTTP Basic authentication. -HttpSource.BasicLookupStrategy.auth.basic.username = -HttpSource.BasicLookupStrategy.auth.basic.secret = +HttpSource.BasicLookupStrategy.auth.basic.username = anonymous +HttpSource.BasicLookupStrategy.auth.basic.secret = anonymous #---------------------------------------- # JdbcSource @@ -288,7 +288,7 @@ # * `CacheStrategy` will download it into the source cache using # FilesystemCache, which must also be configured. (This will perform a # lot better than DownloadStrategy if you can spare the disk space.) -processor.stream_retrieval_strategy = StreamStrategy +processor.stream_retrieval_strategy = CacheStrategy # Controls how an incompatible StreamSource + FileProcessor combination is # dealt with. @@ -306,7 +306,7 @@ # Color of the background when an image is rotated or alpha-flattened, for # output formats that don't support transparency. # This may not be respected for indexed color derivative images. -processor.background_color = white +processor.background_color = black # Available values are `bell`, `bspline`, `bicubic`, `box`, `hermite`, # `lanczos3`, `mitchell`, `triangle`. (JaiProcessor & KakaduNativeProcessor @@ -373,7 +373,7 @@ # !! Optional absolute path of the directory containing the ImageMagick # binary. Overrides the PATH. -ImageMagickProcessor.path_to_binaries = +ImageMagickProcessor.path_to_binaries = /usr/local/bin #---------------------------------------- # KakaduDemoProcessor @@ -421,18 +421,18 @@ # Amount of time source cache content remains valid. Set to blank or 0 # for forever. -cache.server.source.ttl_seconds = 2592000 +cache.server.source.ttl_seconds = 86400 # Enables the derivative (processed image) cache. -cache.server.derivative.enabled = false +cache.server.derivative.enabled = true # Available values are `FilesystemCache`, `JdbcCache`, `RedisCache`, # `HeapCache`, `S3Cache`, and `AzureStorageCache`. -cache.server.derivative = +cache.server.derivative = FilesystemCache # Amount of time derivative cache content remains valid. Set to blank or 0 # for forever. -cache.server.derivative.ttl_seconds = 2592000 +cache.server.derivative.ttl_seconds = 86400 # Whether to use the Java heap as a "level 1" cache for image infos, either # independently or in front of a "level 2" derivative cache (if enabled). @@ -451,18 +451,18 @@ # !! Enables the cache worker, which periodically purges invalid cache # items in the background. -cache.server.worker.enabled = false +cache.server.worker.enabled = true # !! The cache worker will wait this many seconds before starting its # next shift. -cache.server.worker.interval = 86400 +cache.server.worker.interval = 43200 #---------------------------------------- # FilesystemCache #---------------------------------------- # If this directory does not exist, it will be created automatically. -FilesystemCache.pathname = /var/cache/cantaloupe +FilesystemCache.pathname = /srv/cache # Levels of folder hierarchy in which to store cached images. Deeper depth # results in fewer files per directory. Set to 0 to disable subdirectories. @@ -643,18 +643,18 @@ #---------------------------------------- # `trace`, `debug`, `info`, `warn`, `error`, `all`, or `off` -log.application.level = debug - -log.application.ConsoleAppender.enabled = true +log.application.level = warn + +log.application.ConsoleAppender.enabled = false # N.B.: Don't enable FileAppender and RollingFileAppender simultaneously! log.application.FileAppender.enabled = false -log.application.FileAppender.pathname = /path/to/logs/application.log - -log.application.RollingFileAppender.enabled = false -log.application.RollingFileAppender.pathname = /path/to/logs/application.log +log.application.FileAppender.pathname = /srv/log/application.log + +log.application.RollingFileAppender.enabled = true +log.application.RollingFileAppender.pathname = /srv/log/application.log log.application.RollingFileAppender.policy = TimeBasedRollingPolicy -log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/application-%d{yyyy-MM-dd}.log +log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/application-%d{yyyy-MM-dd}.log log.application.RollingFileAppender.TimeBasedRollingPolicy.max_history = 30 # See the "SyslogAppender" section for a list of facilities: @@ -672,13 +672,13 @@ # into a dedicated error log, which may make them easier to spot. # N.B.: Don't enable FileAppender and RollingFileAppender simultaneously! -log.error.FileAppender.enabled = false -log.error.FileAppender.pathname = /path/to/logs/error.log +log.error.FileAppender.enabled = true +log.error.FileAppender.pathname = /srv/log/error.log log.error.RollingFileAppender.enabled = false -log.error.RollingFileAppender.pathname = /path/to/logs/error.log +log.error.RollingFileAppender.pathname = /srv/log/error.log log.error.RollingFileAppender.policy = TimeBasedRollingPolicy -log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/error-%d{yyyy-MM-dd}.log +log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/error-%d{yyyy-MM-dd}.log log.error.RollingFileAppender.TimeBasedRollingPolicy.max_history = 30 #---------------------------------------- @@ -689,14 +689,14 @@ # N.B.: Don't enable FileAppender and RollingFileAppender simultaneously! log.access.FileAppender.enabled = false -log.access.FileAppender.pathname = /path/to/logs/access.log +log.access.FileAppender.pathname = /srv/log/access.log # RollingFileAppender is an alternative to using something like # FileAppender + logrotate. log.access.RollingFileAppender.enabled = false -log.access.RollingFileAppender.pathname = /path/to/logs/access.log +log.access.RollingFileAppender.pathname = /srv/log/access.log log.access.RollingFileAppender.policy = TimeBasedRollingPolicy -log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/access-%d{yyyy-MM-dd}.log +log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/access-%d{yyyy-MM-dd}.log log.access.RollingFileAppender.TimeBasedRollingPolicy.max_history = 30 # See the "SyslogAppender" section for a list of facilities: * Clear cache on daily basis by HTTP API crontab -l 00 23 * * * /root/purge.sh >> /root/purge.log 2>&1 cat /root/purge.sh # <= 3.4 #cd /opt/cantaloupe #sudo -u cantaloupe java -Dcantaloupe.config=/opt/cantaloupe/cantaloupe.properties -Dcantaloupe.cache.purge -jar Cantaloupe-3.4.1.war # # >= 3.4 wget -q --server-response --user=MyEndpointApiUsername --password=MyEndpointApiSecret --post-data='{ "verb" : "PurgeCache" }' --header=Content-Type:application/json http://localhost:8182/tasks * Startup command (replaced by start as service) cd /opt/cantaloupe-4.0/ sudo -u cantaloupe nohup java -Dcantaloupe.config=/opt/cantaloupe-4.0/cantaloupe.properties -Xmx12g -jar cantaloupe-4.0.war & * Start as service nano -w /etc/systemd/system/cantaloupe.service [Unit] Description=Cantaloupe Image Server [Service] Type=simple User=cantaloupe ExecStart=/usr/bin/java -Dcantaloupe.config=/opt/cantaloupe-4.0/cantaloupe.properties -Xmx12g -jar /opt/cantaloupe-4.0/cantaloupe-4.0.war ExecStop=/usr/bin/killall -9 cantaloupe-4.0.war Restart=on-failure [Install] WantedBy=multi-user.target systemctl daemon-reload systemctl enable cantaloupe.service service cantaloupe start