From 3e1126e7e5ca874ca294c59736d36df93e8a638b Mon Sep 17 00:00:00 2001 From: David Baldwynn Date: Sun, 24 Apr 2016 14:24:56 -0700 Subject: [PATCH] Fixed numbering problems in setup_sentry_server.md --- docs/setup_sentry_server.md | 314 ++++++++++++++++++------------------ 1 file changed, 157 insertions(+), 157 deletions(-) diff --git a/docs/setup_sentry_server.md b/docs/setup_sentry_server.md index 54bdaf0c..0b85ffc5 100644 --- a/docs/setup_sentry_server.md +++ b/docs/setup_sentry_server.md @@ -41,17 +41,17 @@ Make sure you have these installed: ``` 5. Install Sentry and Setup -``` -# make server directory -mkdir ~/SentryServer; cd ~/SentryServer; -# make virtualenv -virtualenv ./ -#activate virtualenv -source ./bin/activate - -# install sentry and its postgresql dependencies -pip install -U sentry[postgres] -``` + ``` + # make server directory + mkdir ~/SentryServer; cd ~/SentryServer; + # make virtualenv + virtualenv ./ + #activate virtualenv + source ./bin/activate + + # install sentry and its postgresql dependencies + pip install -U sentry[postgres] + ``` 6. Install postgresql ``` @@ -87,162 +87,162 @@ pip install -U sentry[postgres] vim ~/.sentry/sentry.conf.py ``` -The following are the contents of my sentry.conf.py file (replace name, user and password with your that of your DB) - -``` -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'sentry', - 'USER': 'sentry_user', - 'PASSWORD': 'your_password', - 'HOST': 'localhost', - } -} -# No trailing slash! -SENTRY_URL_PREFIX = 'http://sentry.example.com' - -SENTRY_WEB_HOST = '0.0.0.0' -SENTRY_WEB_PORT = 9000 -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 -} - -#CONFIGURE REDIS -SENTRY_REDIS_OPTIONS = { - 'hosts': { - 0: { - 'host': '127.0.0.1', - 'port': 6379, - 'timeout': 3, - #'password': 'redis auth password' - } - } -} - -#CONFIGURE OUTGOING MAIL -EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' -EMAIL_USE_TLS = True -EMAIL_HOST = 'smtp.gmail.com' -EMAIL_PORT = 587 -EMAIL_HOST_USER = 'your_gmail_username@gmail.com' -EMAIL_HOST_PASSWORD = 'your_gmail_password' -DEFAULT_FROM_EMAIL = 'testing@testing.com -``` + The following are the contents of my sentry.conf.py file (replace name, user and password with your that of your DB) + + ``` + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'sentry', + 'USER': 'sentry_user', + 'PASSWORD': 'your_password', + 'HOST': 'localhost', + } + } + # No trailing slash! + SENTRY_URL_PREFIX = 'http://sentry.example.com' + + SENTRY_WEB_HOST = '0.0.0.0' + SENTRY_WEB_PORT = 9000 + 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 + } + + #CONFIGURE REDIS + SENTRY_REDIS_OPTIONS = { + 'hosts': { + 0: { + 'host': '127.0.0.1', + 'port': 6379, + 'timeout': 3, + #'password': 'redis auth password' + } + } + } + + #CONFIGURE OUTGOING MAIL + EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + EMAIL_USE_TLS = True + EMAIL_HOST = 'smtp.gmail.com' + EMAIL_PORT = 587 + EMAIL_HOST_USER = 'your_gmail_username@gmail.com' + EMAIL_HOST_PASSWORD = 'your_gmail_password' + DEFAULT_FROM_EMAIL = 'testing@testing.com + ``` 9. Setup Database and Start Sentry -``` -#install and run redis-server -wget http://download.redis.io/releases/redis-stable.tar.gz -tar xzf redis-stable.tar.gz -cd redis-stable -make -make test -sudo make install -cd utils -sudo ./install_server.sh - -#Go back to app directory -cd ~/SentryServer -sudo service redis_6379 start - -# set up databse -sentry upgrade - -# let's try it out! -sentry start -``` + ``` + #install and run redis-server + wget http://download.redis.io/releases/redis-stable.tar.gz + tar xzf redis-stable.tar.gz + cd redis-stable + make + make test + sudo make install + cd utils + sudo ./install_server.sh + + #Go back to app directory + cd ~/SentryServer + sudo service redis_6379 start + + # set up databse + sentry upgrade + + # let's try it out! + sentry start + ``` 10. Install nginx -``` -# install nginx -sudo apt-get install nginx - -# remove the default symbolic link -sudo rm /etc/nginx/sites-enabled/default - -# create a new blank config, and make a symlink to it -sudo touch /etc/nginx/sites-available/sentry -cd /etc/nginx/sites-enabled -sudo ln -s ../sites-available/sentry - -# edit the nginx configuration file -sudo vim /etc/nginx/sites-available/sentry -``` -*Here are the contents of my nginx file:* -``` -server { - # listen on port 80 - listen 80; - - # for requests to these domains - server_name yourdomain.com www.yourdomain.com; - - # keep logs in these files - access_log /var/log/nginx/sentry.access.log; - error_log /var/log/nginx/sentry.error.log; - - # You need this to allow users to upload large files - # See http://wiki.nginx.org/HttpCoreModule#client_max_body_size - # I'm not sure where it goes, so I put it in twice. It works. - client_max_body_size 0; - - location / { - proxy_pass http://localhost:9000; - proxy_redirect off; - - proxy_read_timeout 5m; - - # make sure these HTTP headers are set properly - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } -} -``` + ``` + # install nginx + sudo apt-get install nginx + + # remove the default symbolic link + sudo rm /etc/nginx/sites-enabled/default + + # create a new blank config, and make a symlink to it + sudo touch /etc/nginx/sites-available/sentry + cd /etc/nginx/sites-enabled + sudo ln -s ../sites-available/sentry + + # edit the nginx configuration file + sudo vim /etc/nginx/sites-available/sentry + ``` + *Here are the contents of my nginx file:* + ``` + server { + # listen on port 80 + listen 80; + + # for requests to these domains + server_name yourdomain.com www.yourdomain.com; + + # keep logs in these files + access_log /var/log/nginx/sentry.access.log; + error_log /var/log/nginx/sentry.error.log; + + # You need this to allow users to upload large files + # See http://wiki.nginx.org/HttpCoreModule#client_max_body_size + # I'm not sure where it goes, so I put it in twice. It works. + client_max_body_size 0; + + location / { + proxy_pass http://localhost:9000; + proxy_redirect off; + + proxy_read_timeout 5m; + + # make sure these HTTP headers are set properly + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + } + ``` 11. Start the worker processes -``` -# restart nginx -sudo service nginx restart - -#start sentry -sentry celery worker -B -``` + ``` + # restart nginx + sudo service nginx restart + + #start sentry + sentry celery worker -B + ``` 12. Install and Configure supervisord -``` -pip install supervisord -sudo echo_supervisord_conf > ~/SentryServer/etc/supervisord.conf - -#Edit yuour supervisord Config -vim /etc/supervisord.conf -``` + ``` + pip install supervisord + sudo echo_supervisord_conf > ~/SentryServer/etc/supervisord.conf + + #Edit yuour supervisord Config + vim /etc/supervisord.conf + ``` Configuration file should look like this -``` -[program:sentry-web] -directory=~/SentryServer/ -command=~/SentryServer/bin/sentry start -autostart=true -autorestart=true -redirect_stderr=true -stdout_logfile=syslog -stderr_logfile=syslog - -[program:sentry-worker] -directory=~/SentryServer/ -command=~/SentryServer/bin/sentry celery worker -B -autostart=true -autorestart=true -redirect_stderr=true -stdout_logfile=syslog -stderr_logfile=syslog -``` + ``` + [program:sentry-web] + directory=~/SentryServer/ + command=~/SentryServer/bin/sentry start + autostart=true + autorestart=true + redirect_stderr=true + stdout_logfile=syslog + stderr_logfile=syslog + + [program:sentry-worker] + directory=~/SentryServer/ + command=~/SentryServer/bin/sentry celery worker -B + autostart=true + autorestart=true + redirect_stderr=true + stdout_logfile=syslog + stderr_logfile=syslog + ``` 13. Run Server (with supervisord) -``` -supervisord -``` + ``` + supervisord + ```