Skip to content

Instantly share code, notes, and snippets.

@kenzo0107
Last active January 12, 2020 11:04
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kenzo0107/c1ee50b121dd0a8f6d4f to your computer and use it in GitHub Desktop.
Save kenzo0107/c1ee50b121dd0a8f6d4f to your computer and use it in GitHub Desktop.
# Rootユーザに変更
sudo su -
# virtualenvインストール
pip install -U virtualenv
virtualenv /www/sentry/
source /www/sentry/bin/activate
# posgre版sentryインストール
pip install -U sentry[mysql]
# sentry初期configファイル作成
sentry init /etc/sentry.conf.py
# 作成されていることを確認
ls -al /etc/sentry.conf.py
-rw-r--r--. 1 root root 5743 Apr 6 23:17 /etc/sentry.conf.py
# djangoプロジェクトの設定ファイルですが、デフォルトはSQLiteが設定されています。
vim /etc/sentry.conf.py
#--- /etc/sentry.conf.py 編集 start -----------------------------------------------
DATABASES = {
'default': {
# You can swap out the engine for MySQL easily by changing this value
# to ``django.db.backends.mysql`` or to PostgreSQL with
# ``django.db.backends.postgresql_psycopg2``
# If you change this, you'll also need to install the appropriate python
# package: psycopg2 (Postgres) or mysql-python
#'ENGINE': 'django.db.backends.sqlite3',
'ENGINE': 'django.db.backends.mysql',
#'NAME': os.path.join(CONF_ROOT, 'sentry.db'),
'NAME': 'sentry',
'USER': 'sentry',
'PASSWORD': 'sentry',
'HOST': 'localhost',
'PORT': '3306',
}
}
...
SENTRY_URL_PREFIX = 'http://192.168.33.10'
SENTRY_WEB_HOST = '192.168.33.10'
SENTRY_WEB_OPTIONS = {
'workers': 3, # the number of gunicorn workers
'secure_scheme_headers': {'X-FORWARDED-PROTO': 'https'}, # detect HTTPS mode from X-Forwarded-Proto header
}
#--- /etc/sentry.conf.py 編集 end -------------------------------------------------
# sentry起動
sentry --config=/etc/sentry.conf.py start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment