I wanted to deploy my Django Application and tried to achieve that with Whitenoise , but this last one only serves my static files, now I need to serve my media files. I want to use Apache ( HTTPD in Manjaro/Arch) to do that but couldn't figure it out, after trying several tutos.
Here's my config :
httpd.conf:
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /home/chemsouh/dev/rci/rci/wsgi.py
WSGIPythonHome /home/chemsouh/dev/rci
WSGIPythonPath /home/chemsouh/dev/rci/rci
<Directory /home/chemsouh/dev/rci/rci>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
settings.py:
MEDIA_URL = '/media-directory/'
MEDIA_ROOT=os.path.join(os.path.dirname(BASE_DIR), "media-serve/")
I also tried this:
in my httpd-vhosts.conf:
<VirtualHost 127.0.0.1:80>
ServerAdmin RCI
DocumentRoot "/home/chemsouh/dev/rci/media-serve"
ServerName rci.co
ServerAlias www.rci.co
ErrorLog "/var/log/httpd/dummy-host.example.com-error_log"
CustomLog "/var/log/httpd/dummy-host.example.com-access_log" common
</VirtualHost>
in my httpd.conf:
DocumentRoot "/home/chemsouh/dev/rci/media-serve"
<Directory "/home/chemsouh/dev/rci/media-serve">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
And I got this My media directory that I want to serve
Here's my project Tree: $pwd gave /home/chemsouh/dev/rci
N.B I use:
Apache 2.4 Django 2.0.6 in settings there is settings.py

