====== Cantaloupe stand-alone fresh install (4.x)======
\\
* download
wget https://github.com/medusa-project/cantaloupe/releases/download/v4.0.3/cantaloupe-4.0.3.zip
unzip cantaloupe-4.0.3.zip
sudo mv cantaloupe-4.0.3 /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.3
* Kakadu Native libraries (Optional)
Check Java Library Path with:
java -XshowSettings:properties
sudo cp /opt/cantaloupe-4.0.3/deps/Linux-x86-64/lib/libkdu_* /usr/lib/
* settings
cd /opt/cantaloupe-4.0.3
sudo cp cantaloupe.properties.sample cantaloupe.properties
sudo nano -w cantaloupe.properties
diff cantaloupe.properties.sample cantaloupe.properties
< temp_pathname =
---
> temp_pathname = /srv/tmp
< http.host = 0.0.0.0
---
> http.host = 123.123.123.123
< endpoint.iiif.min_tile_size = 512
---
> endpoint.iiif.min_tile_size = 1024
< endpoint.admin.enabled = false
< endpoint.admin.username = admin
< endpoint.admin.secret =
---
> endpoint.admin.enabled = true
> endpoint.admin.username = adminUsername
> endpoint.admin.secret = adminPassword
< endpoint.api.enabled = false
---
> endpoint.api.enabled = true
< endpoint.api.username =
< endpoint.api.secret =
---
> endpoint.api.username = apiUsername
> endpoint.api.secret = apiPassword
< source.static = FilesystemSource
---
> source.static = HttpSource
< FilesystemSource.BasicLookupStrategy.path_prefix = /home/myself/images/
---
> FilesystemSource.BasicLookupStrategy.path_prefix = /tmp/
< HttpSource.trust_all_certs = false
< HttpSource.request_timeout =
---
> HttpSource.trust_all_certs = true
> HttpSource.request_timeout = 20
< HttpSource.BasicLookupStrategy.url_prefix = http://localhost/images/
---
> HttpSource.BasicLookupStrategy.url_prefix =
< HttpSource.BasicLookupStrategy.auth.basic.username =
< HttpSource.BasicLookupStrategy.auth.basic.secret =
---
> HttpSource.BasicLookupStrategy.auth.basic.username = anonymous
> HttpSource.BasicLookupStrategy.auth.basic.secret = anonymous
< processor.stream_retrieval_strategy = StreamStrategy
---
> processor.stream_retrieval_strategy = CacheStrategy
< processor.background_color = white
---
> processor.background_color = black
< cache.server.source.ttl_seconds = 2592000
---
> cache.server.source.ttl_seconds = 172800
< cache.server.derivative.enabled = false
---
> cache.server.derivative.enabled = true
< cache.server.derivative =
---
> cache.server.derivative = FilesystemCache
< cache.server.derivative.ttl_seconds = 2592000
---
> cache.server.derivative.ttl_seconds = 172800
< cache.server.worker.enabled = false
---
> cache.server.worker.enabled = true
< FilesystemCache.pathname = /var/cache/cantaloupe
---
> FilesystemCache.pathname = /srv/cache
< log.application.level = debug
---
> log.application.level = info
< 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.pathname = /path/to/logs/application.log
---
> log.application.RollingFileAppender.enabled = true
> 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.pathname = /path/to/logs/error.log
---
> 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.enabled = true
> 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
* 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.3/cantaloupe.properties -Xmx12g -jar /opt/cantaloupe-4.0.3/cantaloupe-4.0.3.war
ExecStop=/usr/bin/killall -9 cantaloupe-4.0.3.war
Restart=on-failure
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable cantaloupe.service
service cantaloupe start
* Startup command (alternative to start as service)
cd /opt/cantaloupe-4.0.3/
sudo -u cantaloupe nohup java -Dcantaloupe.config=/opt/cantaloupe-4.0.3/cantaloupe.properties -Xmx12g -jar cantaloupe-4.0.3.war &
* Clear cache on daily basis by HTTP API (Optional)
crontab -l
00 23 * * * /root/purge.sh >> /root/purge.log 2>&1
cat /root/purge.sh
wget -q --server-response --user=MyEndpointApiUsername --password=MyEndpointApiSecret --post-data='{ "verb" : "PurgeCache" }' --header=Content-Type:application/json http://localhost:8182/tasks