Noosfero/noosfero

View on GitHub
debian/apache2/virtualhost.conf

Summary

Maintainability
Test Coverage
DocumentRoot "/usr/share/noosfero/public"
<Directory "/usr/share/noosfero/public">
  Options +FollowSymLinks -Indexes
  AllowOverride None
  Order Allow,Deny
  Allow from all
  Header set Access-Control-Allow-Origin "*"
</Directory>

RewriteEngine On

# If your XMPP XMPP/BOSH isn't in localhost, change the config below to correct
# point to address
RewriteRule /http-bind http://localhost:5280/http-bind [P,QSA,L]
<Proxy http://localhost:5280/http-bind>
  Order Allow,Deny
  Allow from All
</Proxy>

# Pass access to private files to backend
RewriteMap private_files "dbm=sdbm:/usr/share/noosfero/cache/private_files"
RewriteCond ${private_files:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^(/articles/.*) ${private_files:$1} [P,QSA,L]

# Rewrite index to check for static index.html
RewriteRule ^/$ /index.html [QSA]

# Rewrite to check for Rails cached page
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ $1.html [QSA]

RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^.*$ http://127.0.0.1:50000%{REQUEST_URI} [P,QSA,L]
<Proxy http://127.0.0.1:50000>
  Order Allow,Deny
  Allow from All
</Proxy>

ErrorDocument 503 /503.html

ErrorLog /var/log/apache2/noosfero.log
LogLevel warn
CustomLog /var/log/apache2/noosfero.access.log vhost_combined

# Compress outgoing text content
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript

# Add Expires: header
ExpiresActive On
ExpiresByType text/css               "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType image/png              "access plus 1 month"
ExpiresByType image/gif              "access plus 1 month"
ExpiresByType image/jpeg             "access plus 1 month"
ExpiresByType image/x-icon           "access plus 1 month"

# vim: ft=apache