I am using Webfaction for hosting one of my Django web applications. I have been using a symbolic link app to serve my media from. Recently I have been trying to set up an .htaccess file to set expiry headers on all of my images, but the .htaccess file hasn't worked. I contacted Webfaction support, and they responded with this:
"You are not seeing the expires tags in your files because you are not serving files like feature_homemobile_fieldagent.jpg from your apache stack. Everything under the /home/doc4design/webapps/django_2016/doc4_2016/media/ directory is being served by our frontend nginx server after your symlink app at https://my.webfaction.com/applications/971721/edit-application. Since our nginx server is not aware of your settings, such tags are not set. If you want to do that, you will need to remove the symlink apps and update your httpd.conf with the proper alias and location stanzas. Or build and configure your own nginx server where you will have full control over its configuration."
I tried to add a new Alias to my Apache2 configuration file, but I am getting this error
Invalid command 'Allow', perhaps misspelled or defined by a module not included in the server configuration
UPDATE
I found out being on Apache2.4 means that it is no longer 'Allow from all', and is now 'Require all granted'. I reset my server, and everything went smoothly, and I removed my Symlink app from my website temporarily through Webfaction. All the images stopped getting served, and stopped showing up on my site. I waited 10 minutes but nothing changed. Is there some extra step I'm missing ?
Apache2 httpd.conf
ServerRoot "/home/doc4design/webapps/django_2016/apache2"
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule headers_module modules/mod_headers.so
LoadModule expires_module modules/mod_expires.so
LoadModule filter_module modules/mod_filter.so
LoadModule deflate_module modules/mod_deflate.so
#LoadModule pagespeed_module modules/mod_pagespeed_ap24.so
<Directory /home/doc4design/webapps/django_2016/doc4_2016>
AllowOverride All
</Directory>
Alias /media/ /home/doc4design/webapps/django_2016/doc4_2016/media
<Directory /home/doc4design/webapps/django_2016/doc4_2016/media>
Allow from all
</Directory>
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/doc4design/logs/user/access_django_2016.log combined
ErrorLog /home/doc4design/logs/user/error_django_2016.log
Listen 30651
KeepAlive Off
SetEnvIf X-Forwarded-SSL on HTTPS=1
ServerLimit 1
StartServers 1
MaxRequestWorkers 5
MinSpareThreads 1
MaxSpareThreads 3
ThreadsPerChild 5
WSGIDaemonProcess django_2016 processes=2 threads=12 maximum-requests=100 python-path=/home/doc4design/webapps/django_2016:/home/doc4design/webapps/django_2016/doc4_2016:/home/doc4design/webapps/django_2$
WSGIProcessGroup django_2016
WSGIRestrictEmbedded On
WSGILazyInitialization On
WSGIScriptAlias / /home/doc4design/webapps/django_2016/doc4_2016/webapp/wsgi.py