add virtualenv
This commit is contained in:
parent
edb0e391f5
commit
f157b4bd49
5 changed files with 99 additions and 0 deletions
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue