add gunicorn and deployment files
This commit is contained in:
parent
f2cd78e316
commit
2f1914c3db
42
etc/apache2/sites-available/studio.camp.conf
Normal file
42
etc/apache2/sites-available/studio.camp.conf
Normal file
|
@ -0,0 +1,42 @@
|
|||
<VirtualHost *:80>
|
||||
ServerName studio.camp
|
||||
Redirect / https://studio.camp/
|
||||
</VirtualHost>
|
||||
|
||||
<VirtualHost *:443>
|
||||
SSLCertificateFile /etc/letsencrypt/studio.camp/cert.pem
|
||||
SSLCertificateKeyFile /etc/letsencrypt/studio.camp/key.pem
|
||||
Include /etc/letsencrypt/options-ssl-apache.conf
|
||||
SSLCertificateChainFile /etc/letsencrypt/studio.camp/chain.pem
|
||||
|
||||
ServerName studio.camp
|
||||
|
||||
<Location />
|
||||
Options -Indexes
|
||||
</Location>
|
||||
<Directory /srv/camp>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
Alias /static /srv/camp/static
|
||||
Alias /images /srv/camp/data/images
|
||||
|
||||
LogLevel warn
|
||||
ErrorLog /var/log/apache2/studio.camp.error.log
|
||||
CustomLog /var/log/apache2/studio.camp.log combined
|
||||
ServerSignature Off
|
||||
|
||||
ProxyRequests Off
|
||||
<Proxy *>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</Proxy>
|
||||
ProxyPass /static !
|
||||
ProxyPass /images !
|
||||
|
||||
RequestHeader unset Proxy
|
||||
|
||||
ProxyPass / http://127.0.0.1:8087/
|
||||
ProxyPassReverse / http://127.0.0.1:8087/
|
||||
</VirtualHost>
|
12
etc/init/camp.conf
Normal file
12
etc/init/camp.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
start on (filesystem and net-device-up IFACE=lo)
|
||||
stop on runlevel [!2345]
|
||||
|
||||
# give time to send info to trackers
|
||||
kill timeout 30
|
||||
|
||||
setuid campdjango
|
||||
setgid campdjango
|
||||
|
||||
respawn
|
||||
chdir /srv/camp
|
||||
exec /srv/camp/venv/bin/gunicorn -b 127.0.0.1:8087 camp.wsgi:application
|
14
etc/systemd/system/camp.service
Normal file
14
etc/systemd/system/camp.service
Normal file
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description=studio.camp
|
||||
After=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
User=campdjango
|
||||
Group=campdjango
|
||||
WorkingDirectory=/srv/camp
|
||||
ExeccStart=/srv/camp/venv/bin/gunicorn -b 127.0.0.1:8087 camp.wsgi:application
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -4,3 +4,4 @@ django-photologue
|
|||
django-braces
|
||||
django-app-namespace-template-loader
|
||||
ox
|
||||
gunicorn
|
||||
|
|
Loading…
Reference in New Issue
Block a user