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> <VirtualHost *:80>
ServerHostname pdf.0x2620.org ServerName pdf.0x2620.org
LogLevel warn LogLevel warn
ErrorLog /var/log/apache2/pdfvideo.org_error.log ErrorLog /var/log/apache2/pdfvideo.org_error.log
@ -19,20 +19,27 @@
</Location> </Location>
Alias /.bzr /srv/pdfvideo/.bzr Alias /.bzr /srv/pdfvideo/.bzr
Alias /static/admin /srv/pdfvideo/src/django/django/contrib/admin/static/admin
Alias /static /srv/pdfvideo/static Alias /static /srv/pdfvideo/static
Alias /robots.txt /srv/pdfvideo/pdfvideo/static/robots.txt Alias /robots.txt /srv/pdfvideo/pdfvideo/static/robots.txt
Alias /favicon.ico /srv/pdfvideo/pdfvideo/static/favicon.ico Alias /favicon.ico /srv/pdfvideo/pdfvideo/static/favicon.ico
Alias /data /srv/pdfvideo/data Alias /data /srv/pdfvideo/data
Alias /admin/media /srv/pdfvideo/src/django/django/contrib/admin/media 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 ProxyPass /static !
RewriteCond %{REQUEST_URI} !^/favicon.ico ProxyPass /favicon.ico !
RewriteCond %{REQUEST_URI} !^/robots.txt ProxyPass /robots.txt !
RewriteCond %{REQUEST_URI} !^/.bzr ProxyPass /admin/media !
RewriteCond %{REQUEST_URI} !^/static ProxyPass /data !
RewriteCond %{REQUEST_URI} !^/data ProxyPass /.bzr !
RewriteCond %{REQUEST_URI} !^/admin/media
RewriteRule ^/(.*) http://127.0.0.1:2688/$1 [P] 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 ServerSignature Off
</VirtualHost> </VirtualHost>

View file

@ -52,7 +52,7 @@ USE_TZ = True
# Absolute filesystem path to the directory that will hold user-uploaded files. # Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/" # 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 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash. # trailing slash.