sudo apt-get update
sudo apt-get install python python-setuptools python-pip python-dev libxslt1-dev libxml2-dev libmysqlclient-dev
sudo pip install -U virtualenv
virtualenv /clients/sentry/
source /clients/sentry/bin/activate
cd /clients/sentry
pip install -U sentry
pip install -U sentry[mysql]
sentry init
nano /clients/.sentry/sentry.conf.py
//Change ENGINE to 'django.db.backends.mysql'
//Change NAME to 'sentry'
//Change USER to 'sentry'
//Change PASSWORD to your desired password
//Change HOST to 'localhost'
//Change PORT to '3306'
//Change SENTRY_URL_PREFIX to 'http://sentry.{your_domain}'
//Change EMAIL_HOST to 'smtp.mailgun.org'
//Change EMAIL_HOST_PASSWORD to mailgun SMTP password
//Change EMAIL_HOST_USER to mailgun SMTP username
mysql -uroot -p
CREATE DATABASE sentry;
CREATE USER 'sentry'@'localhost' IDENTIFIED BY 'password'; //Change password
GRANT ALL PRIVILEGES ON sentry.* TO 'sentry'@'localhost';
FLUSH PRIVILEGES;
exit;
sentry upgrade
sentry createuser
Create a new virtual host and insert the following:
server {
listen 0.0.0.0:80;
server_name sentry.{your_domain};
location / {
proxy_pass http://localhost:9000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Be sure to restart nginx after:
sudo service nginx restart
sudo nano /etc/supervisor/supervisord.conf
Insert the following:
[program:sentry-web]
directory=/clients/sentry/
command=/clients/sentry/bin/sentry --config=/clients/.sentry/sentry.conf.py start
autostart=true
autorestart=true
redirect_stderr=true
user=siteadmin
[program:sentry-worker]
directory=/clients/sentry/
command=/clients/sentry/bin/sentry --config=/clients/.sentry/sentry.conf.py celery worker -B
autostart=true
autorestart=true
redirect_stderr=true
user=siteadmin
[program:redis-server]
command=/usr/local/bin/redis-server
autostart=true
autorestart=true
redirect_stderr=true
user=siteadmin
Reread configuration and boot processes:
sudo supervisorctl reread
sudo supervisorctl update