- sudo apt-get install -y python-software-properties
- sudo add-apt-repository -y ppa:rwky/redis
- sudo apt-get update
- sudo apt-get install -y redis-server
For development
Use http://rubular.com/ or https://jex.im/regulex/#!flags=&re=%5E(a%7Cb)*%3F%24 to test your regex.
#####Regex Basics
To avoid the logs growing too large logrotation can be configured with Linux's logrotate tool. The logrotation configuration file is located at: /etc/logrotate.d/your_app_name Example of logrotate configuration file for a Rails app (remember to remove the comments!):
# monitor the /home/deploy/path/to/my/app/shared/log/*.log file
/home/deploy/path/to/my/app/shared/log/*.log {
weekly # rotate weekly
missingok # avoids halting on any error and carries on with the next log file
rotate 52 # 52 days worth of logs would be kept
compress # compress using gzip
###du Summarize disk usage of each FILE, recursively for directories sorted by size
sudo du -x -h / | sort -n | tail -40
###truncate Truncate files to size 0MB
truncate -s 0 production.log