DirectoryIndex problem

Discussion in 'Server Operation' started by mitho7, Jul 16, 2011.

  1. mitho7

    mitho7 Member

    Hello Friends,

    I'm using Debian GNU/Linux 6.0.2 (squeeze) and Apache 2.2. I have set the virtual hosting as per the example http://www.debian-administration.org/articles/412.

    My site comes if i type full url (www.example.com/index.html) but if i do not use index.html (www.example.com/) comes up page cannot display. I have default site set up which works ok. if i type the ip address (http://192.168.1.3/) it can read the index.html.

    I have dir module loaded. also have set up the DirectoryIndex index.html

    dir.conf:

    Code:
    <IfModule mod_dir.c>
    
              DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
    
    </IfModule>
    
    under sites-available i have default:
    Code:
    <VirtualHost *>
            ServerName no_vhost_entry:80
            ServerAdmin webmaster@localhost
    
            DocumentRoot /var/www/html/default
    
            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
            </Directory>
            <Directory /var/www/html/default>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride Limit
                    Order allow,deny
                    allow from all
            </Directory>
    
            <IfModule mod_headers.c>
                    Header set Cache-Control no-cache
            </IfModule>
    
            # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel warn
    
            CustomLog /var/log/apache2/access.log combined
            ErrorLog /var/log/apache2/error.log
    </VirtualHost>
    
    under sites-available i have www.example.com:
    Code:
    <VirtualHost *>
            ServerAdmin [email protected]
            ServerName  www.example.com
            ServerAlias example.com
    
            # Indexes + Directory Root.
            DirectoryIndex index.html
            DocumentRoot /home/www/www.example.com/htdocs/
    
            # CGI Directory
            ScriptAlias /cgi-bin/ /home/www/www.example.com/cgi-bin/
            <Location /cgi-bin>
                    Options +ExecCGI
            </Location>
    
    
            # Logfiles
            ErrorLog  /home/www/www.example.com/logs/error.log
            CustomLog /home/www/www.example.com/logs/access.log combined
    </VirtualHost>
    
    Just want to get some light here :)

    Thanks,
    Bip
     
  2. mitho7

    mitho7 Member

    i feel so stupid now. it is working fine. It's my browser mozilla, i clear the cache and working ok.
     
  3. eyeoncomputers

    eyeoncomputers New Member

    For what it's worth, I have had times where there were i would get "permission denied", even though i thought everything was set up correctly. Only to find out i had the wrong selinux context set on my index file. This is a nook that can often be a hard one to check because may forget about it -- although it not directly related to your issue i am in hope that someone would read this thread one day and use this bit of info to solve their problem :)
     

Share This Page