# Redis Repository
$ sudo add-apt-repository ppa:chris-lea/redis-server
# Postgresql Repository
$ sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo apt-get install python-setuptools python-pip python-dev libxslt1-dev libxml2-dev libz-dev libffi-dev libssl-dev libpq-dev libyaml-dev redis-server postgresql-9.4 nginx-full libjpeg-dev
# Create sentry user and add to the sudo group.
$ sudo adduser sentry
$ sudo adduser sentry sudo
$ sudo pip install -U virtualenv
/home/sentry
$ su - sentry
$ virtualenv /home/sentry/
$ source /home/sentry/bin/activate
(sentry) $ echo "source /home/sentry/bin/activate" >> ~/.bashrc
(sentry) $ pip install -U sentry
(sentry) $ sudo su - postgres
$ createdb sentry_db
$ createuser sentry_user --pwprompt
$ psql -d template1 -U postgres
psql (9.4.5)
Type "help" for help.
template1=# GRANT ALL PRIVILEGES ON DATABASE sentry_db to sentry_user;
GRANT
template1=# \q
postgres@sent01:~$ exit
init
command You can specify an alternative configuration path as the argument to init, otherwise it will use the default of ~/.sentry
.(sentry) $ sentry init
sentry.conf.server
, which contains a basic Django project configuration, as well as the default Sentry configuration values.(sentry) $ vim ~/.sentry/sentry.conf.py
DATABASES = {
'default': {
'ENGINE': 'sentry.db.postgres',
'NAME': 'sentry_db',
'USER': 'sentry_user',
'PASSWORD': '******',
'HOST': 'localhost',
'PORT': '',
}
}
Before running it for the first time you’ll need to make sure you’ve created the database.
upgrade
command(sentry) $ SENTRY_CONF=~/.sentry sentry upgrade
(sentry) $ SENTRY_CONF=~/.sentry sentry createuser
(sentry) $ SENTRY_CONF=~/.sentry sentry start &
(sentry) $ SENTRY_CONF=~/.sentry sentry celery worker &
celery beat
(sentry) $ SENTRY_CONF=~/.sentry sentry celery beat &
To get around this (and to avoid running Sentry as a privileged user, which you shouldn’t), we recommend you setup a simple web proxy.
$ sudo vim /etc/nginx/sites-available/sentry
server {
listen 80 default_server;
server_name sentry.example.com;
location / {
proxy_pass http://localhost:9000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
(sentry) $ sudo ln -s /etc/nginx/sites-available/sentry /etc/nginx/sites-enabled/
(sentry) $ sudo service nginx restart
To know more Information refer official documents.