tags:

views:

319

answers:

1

Hi,

I'm trying to get a basic site running under Apache 2. Eventually I'm aming to use mod_wsgi to serve a django applictation, but for now I've started with a really simple variation of the default virtual host, currently just showing a directory listing of /var/www. The problem I'm having is that the server can't seem to see the directory "/var/www/mysite". Viewing www.mysite.com/ gives me a listing as expected of /var/www directory, but only shows the files, not directories.

Please can anybody tell me if there's something obvious that I'm missing here.

Thanks in advance

Virtual Hosts file:

<VirtualHost *:80>
    ServerName www.mysite.com
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
            Options FollowSymLinks +Indexes
            AllowOverride None
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

Listing of /var/www (including security context 'ls -Zl /var/www')

-rw-r--r-- 1 www-data www-data ?   45 Jul 14 15:37 index.html__
-rw-r--r-- 1 www-data www-data ?   91 Aug  9 14:19 index2__.html
drw-r--r-- 2 www-data www-data ? 4096 Aug  9 14:36 mysite
+1  A: 

Try changing the permissions of the mysite directory so that the apache user has execute permission on it:

chmod a+x mysite
Matt Bridges
Thanks, that's great. Knew it must be something simple :) All working now. Just mod_wsgi to go now!

related questions