Skip to content

Instantly share code, notes, and snippets.

View fhbash's full-sized avatar

Fellipe Henrique fhbash

View GitHub Profile
@fhbash
fhbash / wsgi.py
Created April 10, 2014 01:58
Erro WSGI
import os
import sys
import site
# Add the site-packages of the chosen virtualenv to work with
site.addsitedir('/home/fellipeh/.virtualenvs/dig/local/lib/python2.7/site-packages')
# Add the app's directory to the PYTHONPATH
sys.path.append('/var/www/django/dig')
sys.path.append('/var/www/django/dig/dig')
@fhbash
fhbash / urls.py
Created April 11, 2014 13:02
urls.py
# -*- coding: utf-8 -*-
__author__ = 'fellipeh'
__copyright__ = ''
__version__ = ''
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
@fhbash
fhbash / apache2
Created April 11, 2014 13:24
apache2
<VirtualHost *:80>
ServerAdmin contato@dig.com.br
ServerName dig.com.br
ServerAlias www.dig.com.br
WSGIScriptAlias / var/www/django/dig/dig/wsgi.py
Alias /static/ /var/www/django/dig/dig/static_files/
<Location "/static/">
Options -Indexes
</Location>
@fhbash
fhbash / dig.conf
Created April 13, 2014 17:43
conf apache
<VirtualHost *:80>
ServerAdmin contato@dig.com.br
ServerName dig
Alias /site_media/ /var/django/dig/app/dig/static
Alias /static /var/django/dig/app/dig/static
Alias /static/admin /var/django/dig/app/dig/static/admin
Alias /robots.txt /var/django/dig/app/dig/static_files/robots.txt
Alias /favicon.ico /var/django/dig/app/dig/static_files/favicon.ico
@fhbash
fhbash / apache.conf
Created April 23, 2014 17:19
apache.conf
Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
@fhbash
fhbash / mysite.conf
Created April 23, 2014 17:21
mysite.conf
<VirtualHost *:80>
ServerAdmin contato@digs.com.br
ServerName teste.digs.com.br
ServerAlias teste.digs.com.br
Alias /site_media/ /var/django/digerp/teste/app/digerp/static
#Alias /static /var/django/digerp/teste/app/digerp/static
#Alias /static/admin /var/django/digerp/teste/app/digerp/static/admin
Alias /static /var/www/static
Alias /static/admin /var/www/static/admin
@fhbash
fhbash / gunicorn_exec.sh
Created April 26, 2014 15:36
gunicorn_exec.sh
#!/bin/bash
NAME="digitumsoft" # Name of the application
DJANGODIR=/var/django/dig/dig # Django project directory
SOCKFILE=/var/django/run/dig_gunicorn.sock # we will communicte using this unix socket
USER=webapps # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=dig.settings # which settings file should Django use
DJANGO_WSGI_MODULE=wsgi # WSGI module name
@fhbash
fhbash / dig.conf
Created April 27, 2014 11:10
nginx config file
upstream dig_app_server {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
server unix:/var/django/run/digsoft_gunicorn.sock fail_timeout=0;
}
server {
@fhbash
fhbash / nginx.conf
Created April 27, 2014 15:21
nginx.conf
upstream site {
server unix:/var/django/run/digsoft_gunicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name digsoft.com.br www.digsoft.com.br;
charset utf-8;
access_log /var/django/logs/digsoft-access.log;
error_log /var/django/logs/digsoft-error.log;
@fhbash
fhbash / main.cf
Last active August 29, 2015 14:02
main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/ mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no