move media root

This commit is contained in:
j 2013-02-12 13:37:16 +05:30
parent 960309a8ea
commit 223cfd2ab7
2 changed files with 19 additions and 12 deletions

View file

@ -1,5 +1,5 @@
<VirtualHost *:80>
ServerHostname pdf.0x2620.org
ServerName pdf.0x2620.org
LogLevel warn
ErrorLog /var/log/apache2/pdfvideo.org_error.log
@ -19,20 +19,27 @@
</Location>
Alias /.bzr /srv/pdfvideo/.bzr
Alias /static/admin /srv/pdfvideo/src/django/django/contrib/admin/static/admin
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
ProxyPass /static !
ProxyPass /favicon.ico !
ProxyPass /robots.txt !
ProxyPass /admin/media !
ProxyPass /data !
ProxyPass /.bzr !
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:2688/
ProxyPassReverse / http://127.0.0.1:2688/
ServerSignature Off
</VirtualHost>

View file

@ -52,7 +52,7 @@ USE_TZ = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = join(PROJECT_ROOT, 'media')
MEDIA_ROOT = join(PROJECT_ROOT, 'data')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.