So i've got a website hosted at example.com and I want it to work with www.example.com.
I've got a CNAME entry in my DNS for www pointing to example.com.
My virtual host config looks like this:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /home/ubuntu/example/example/static
<Directory /home/ubuntu/example/example/static>
Require all granted
</Directory>
Alias /media /home/ubuntu/example/example/media
<Directory /home/ubuntu/example/example/media>
Require all granted
</Directory>
<Directory /home/ubuntu/example/example/example>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIScriptAlias / /home/ubuntu/example/example/example/wsgi.py
WSGIDaemonProcess django_app python-path=/home/ubuntu/example/example python-home=/home/ubuntu/example/example/venv
WSGIProcessGroup django_app
</VirtualHost>
I'm not sure what's wrong because to me it looks like everything is configured correctly.
Any tips?