add virtualenv
This commit is contained in:
parent
edb0e391f5
commit
f157b4bd49
5 changed files with 99 additions and 0 deletions
8
.bzrignore
Normal file
8
.bzrignore
Normal file
|
@ -0,0 +1,8 @@
|
|||
bin
|
||||
build
|
||||
include
|
||||
lib
|
||||
local
|
||||
src
|
||||
dev.sqlite
|
||||
media
|
26
README
Normal file
26
README
Normal file
|
@ -0,0 +1,26 @@
|
|||
pdfvideo - share pdfs with video overlays
|
||||
|
||||
Get:
|
||||
cd /srv
|
||||
bzr branch http://code.0x2620.org/pdfvideo
|
||||
cd pdfvideo
|
||||
virtualenv --system-site-packages .
|
||||
. bin/activate
|
||||
pip install -r requirements.txt
|
||||
|
||||
Develop:
|
||||
|
||||
cd /srv/pdfvideo
|
||||
create pdfvideo/local_settings.py
|
||||
./manage.py runserver
|
||||
|
||||
Deploy:
|
||||
|
||||
cd /srv/pdfvideo
|
||||
create pdfvideo/local_settings.py
|
||||
|
||||
create /etc/apache2/sites-availavle/sitename.conf
|
||||
create /etc/init/pdfvideo.conf
|
||||
|
||||
service pdfvideo start
|
||||
|
38
etc/apache2/pdfview.conf
Normal file
38
etc/apache2/pdfview.conf
Normal file
|
@ -0,0 +1,38 @@
|
|||
<VirtualHost *:80>
|
||||
ServerHostname pdf.0x2620.org
|
||||
|
||||
LogLevel warn
|
||||
ErrorLog /var/log/apache2/pdfvideo.org_error.log
|
||||
CustomLog /var/log/apache2/pdfvideo.org_access.log combined
|
||||
|
||||
<Location />
|
||||
Options -Indexes
|
||||
</Location>
|
||||
<Directory /srv/pdfvideo>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
<Location />
|
||||
XSendFile on
|
||||
XSendFileAllowAbove on
|
||||
</Location>
|
||||
|
||||
Alias /.bzr /srv/pdfvideo/.bzr
|
||||
Alias /static /srv/pdfvideo/static
|
||||
Alias /robots.txt /srv/pdfvideo/pdfvideo/static/robots.txt
|
||||
Alias /favicon.ico /srv/pdfvideo/pdfvideo/static/favicon.ico
|
||||
Alias /data /srv/pdfvideo/data
|
||||
Alias /admin/media /srv/pdfvideo/src/django/django/contrib/admin/media
|
||||
Alias /static/js/jquery.js /srv/pdfvideo/src/django/django/contrib/admin/media/js/jquery.min.js
|
||||
|
||||
RewriteEngine on
|
||||
RewriteCond %{REQUEST_URI} !^/favicon.ico
|
||||
RewriteCond %{REQUEST_URI} !^/robots.txt
|
||||
RewriteCond %{REQUEST_URI} !^/.bzr
|
||||
RewriteCond %{REQUEST_URI} !^/static
|
||||
RewriteCond %{REQUEST_URI} !^/data
|
||||
RewriteCond %{REQUEST_URI} !^/admin/media
|
||||
RewriteRule ^/(.*) http://127.0.0.1:2688/$1 [P]
|
||||
ServerSignature Off
|
||||
</VirtualHost>
|
24
etc/init/pdfview.conf
Normal file
24
etc/init/pdfview.conf
Normal file
|
@ -0,0 +1,24 @@
|
|||
# pdfview gunicorn daemon
|
||||
#
|
||||
|
||||
description "pdfview daemon"
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on runlevel [!2345]
|
||||
kill timeout 5
|
||||
respawn
|
||||
|
||||
env NAME=pdfview
|
||||
env VENV=/srv/pdfview
|
||||
env DAEMON_USER=pdfview
|
||||
env HOME=/home/pdfview
|
||||
|
||||
script
|
||||
test -e /var/log/$NAME || (mkdir -p /var/log/pdfview && chown $DAEMON_USER:$DAEMON_USER /var/log/$NAME)
|
||||
cd $VENV/pdfview
|
||||
exec /usr/bin/sudo -u $DAEMON_USER $VENV/bin/gunicorn_django \
|
||||
--bind 127.0.0.1:2688 \
|
||||
--timeout 90 \
|
||||
--log-level info --log-file /var/log/$NAME/$NAME.log \
|
||||
--workers 5
|
||||
end script
|
3
requirements.txt
Normal file
3
requirements.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
-e git+https://github.com/django/django.git@stable/1.4.x#egg=django
|
||||
-e bzr+http://code.0x2620.org/python-ox/#egg=python-ox
|
||||
gunicorn>=0.14.3
|
Loading…
Reference in a new issue