404 not found error for virtual host
- by qubit
Hello,
In my /etc/apache2/sites-enabled, i have a file site2.com.conf, which defines a virtual host as follows :
<VirtualHost *:80>
ServerAdmin hostmaster@wharfage
ServerName site2.com
ServerAlias www.site2.com site2.com
DirectoryIndex index.html index.htm index.php
DocumentRoot /var/www
LogLevel debug
ErrorLog /var/log/apache2/site2_error.log
CustomLog /var/log/apache2/site2_access.log combined
ServerSignature Off
<Location />
Options -Indexes
</Location>
Alias /favicon.ico /srv/site2/static/favicon.ico
Alias /static /srv/site2/static
# Alias /media /usr/local/lib/python2.5/site-packages/django/contrib/admin/media
Alias /admin/media /var/lib/python-support/python2.5/django/contrib/admin/media
WSGIScriptAlias / /srv/site2/wsgi/django.wsgi
WSGIDaemonProcess site2 user=samj group=samj processes=1 threads=10
WSGIProcessGroup site2
</VirtualHost>
I do the following to enable the site :
1) In /etc/apache2/sites-enabled, i run the command a2ensite site2.com.conf
2) I then get a message site successfully enabled, and then i run the command /etc/init.d/apache2 reload.
But, if i navigate to www.site2.com, i get 404 not found. I do have an index.html in /var/www (permissions:777 and ownership www-data:www-data), and i have also verified that a symlink was created for site2.com.conf in /etc/apache2/sites-enabled.
Any way to fix this ?
Thank you.