Strange "client" [ ::1] causing "Directory Index Forbidden by Options Directive" Err

Discussion in 'Server Operation' started by bpmee, May 16, 2007.

  1. bpmee

    bpmee Member

    Hi All,

    My httpd error_log is showing this strange error:

    [Wed May 16 00:15:26 2007] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/


    Strange because I don't know what machine or person [client ::1] is!

    All my websites seem to run, but it is concerning because I have a lot of them and my error logs are getting very large.

    I realize this is an Options Directive issue in httpd.conf, so I added "Indexes" to the options area under <directory>... Here is my httpd.conf:

    **Note, this error occured after I fixed another error, one that was causing the "unknow filter was not added: PHP" message. I followed Till's instructions at http://www.howtoforge.com/forums/showthread.php?t=2165 and it worked, but now I have this new error!


    ...starting a section 2, "Main Server Configuration"
    Code:
    ### Section 2: 'Main' server configuration
    #
    # The directives in this section set up the values used by the 'main'
    # server, which responds to any requests that aren't handled by a
    # <VirtualHost> definition.  These values also provide defaults for
    # any <VirtualHost> containers you may define later in the file.
    #
    # All of these directives may appear inside <VirtualHost> containers,
    # in which case these default settings will be overridden for the
    # virtual host being defined.
    #
    
    #
    # ServerAdmin: Your address, where problems with the server should be
    # e-mailed.  This address appears on some server-generated pages, such
    # as error documents.  e.g. [email protected]
    #
    ServerAdmin root@localhost
    
    #
    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    #
    # If this is not set to valid DNS name for your host, server-generated
    # redirections will not work.  See also the UseCanonicalName directive.
    #
    # If your host doesn't have a registered DNS name, enter its IP address here.
    # You will have to access it by its address anyway, and this will make 
    # redirections work in a sensible way.
    #
    #ServerName www.example.com:80
    
    #
    # UseCanonicalName: Determines how Apache constructs self-referencing 
    # URLs and the SERVER_NAME and SERVER_PORT variables.
    # When set "Off", Apache will use the Hostname and Port supplied
    # by the client.  When set "On", Apache will use the value of the
    # ServerName directive.
    #
    UseCanonicalName Off
    
    #
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #
    DocumentRoot "/var/www/html"
    
    #
    # Each directory to which Apache has access can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories). 
    #
    # First, we configure the "default" to be a very restrictive set of 
    # features.  
    #
    <Directory />
        Options +Includes +FollowSymlinks -Indexes
        AllowOverride None
    </Directory>
    
    #
    # Note that from this point forward you must specifically allow
    # particular features to be enabled - so if something's not working as
    # you might expect, make sure that you have specifically enabled it
    # below.
    #
    
    #
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "/var/www/html">
    
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
        Options +Includes +FollowSymlinks -Indexes
    
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
        AllowOverride None
    
    #
    # Controls who can get stuff from this server.
    #
        Order allow,deny
        Allow from all
    
    </Directory>
    
    #
    # UserDir: The name of the directory that is appended onto a user's home
    # directory if a ~user request is received.
    #
    # The path to the end user account 'public_html' directory must be
    # accessible to the webserver userid.  This usually means that ~userid
    # must have permissions of 711, ~userid/public_html must have permissions
    # of 755, and documents contained therein must be world-readable.
    # Otherwise, the client will only receive a "403 Forbidden" message.
    #
    # See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden
    #
    <IfModule mod_userdir.c>
        #
        # UserDir is disabled by default since it can confirm the presence
        # of a username on the system (depending on home directory
        # permissions).
        #
        UserDir disable
    
        #
        # To enable requests to /~user/ to serve the user's public_html
        # directory, remove the "UserDir disable" line above, and uncomment
        # the following line instead:
        # 
        #UserDir public_html
    
    </IfModule>
    
    #
    # Control access to UserDir directories.  The following is an example
    # for a site where these directories are restricted to read-only.
    #
    #<Directory /home/*/public_html>
    #    AllowOverride FileInfo AuthConfig Limit
    #    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    #    <Limit GET POST OPTIONS>
    #        Order allow,deny
    #        Allow from all
    #    </Limit>
    #    <LimitExcept GET POST OPTIONS>
    #        Order deny,allow
    #        Deny from all
    #    </LimitExcept>
    #</Directory>
    
    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    # The index.html.var file (a type-map) is used to deliver content-
    # negotiated documents.  The MultiViews Option can be used for the 
    # same purpose, but it is much slower.
    #
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl
    
    #
    # AccessFileName: The name of the file to look for in each directory
    # for additional configuration directives.  See also the AllowOverride
    # directive.
    #
    AccessFileName .htaccess
    
    #
    # The following lines prevent .htaccess and .htpasswd files from being 
    # viewed by Web clients. 
    #
    <Files ~ "^\.ht">
        Order allow,deny
        Deny from all
    </Files>
    
    #
    # TypesConfig describes where the mime.types file (or equivalent) is
    # to be found.
    #
    TypesConfig /etc/mime.types
    
    #
    # DefaultType is the default MIME type the server will use for a document
    # if it cannot otherwise determine one, such as from filename extensions.
    # If your server contains mostly text or HTML documents, "text/plain" is
    # a good value.  If most of your content is binary, such as applications
    # or images, you may want to use "application/octet-stream" instead to
    # keep browsers from trying to display binary files as though they are
    # text.
    #
    DefaultType text/plain
    
    #
    # The mod_mime_magic module allows the server to use various hints from the
    # contents of the file itself to determine its type.  The MIMEMagicFile
    # directive tells the module where the hint definitions are located.
    #
    <IfModule mod_mime_magic.c>
    #   MIMEMagicFile /usr/share/magic.mime
        MIMEMagicFile conf/magic
    </IfModule>
    
    #
    # HostnameLookups: Log the names of clients or just their IP addresses
    # e.g., www.apache.org (on) or 204.62.129.132 (off).
    # The default is off because it'd be overall better for the net if people
    # had to knowingly turn this feature on, since enabling it means that
    # each client request will result in AT LEAST one lookup request to the
    # nameserver.
    #
    HostnameLookups Off
    
    #
    # EnableMMAP: Control whether memory-mapping is used to deliver
    # files (assuming that the underlying OS supports it).
    # The default is on; turn this off if you serve from NFS-mounted 
    # filesystems.  On some systems, turning it off (regardless of
    # filesystem) can improve performance; for details, please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap
    #
    #EnableMMAP off
    
    #
    # EnableSendfile: Control whether the sendfile kernel support is 
    # used to deliver files (assuming that the OS supports it). 
    # The default is on; turn this off if you serve from NFS-mounted 
    # filesystems.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile
    #
    #EnableSendfile off
    
    #
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # container, error messages relating to that virtual host will be
    # logged here.  If you *do* define an error logfile for a <VirtualHost>
    # container, that host's errors will be logged there and not here.
    #
    ErrorLog logs/error_log
    
    #
    # LogLevel: Control the number of messages logged to the error_log.
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    #
    LogLevel warn
    
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    
    # "combinedio" includes actual counts of actual bytes received (%I) and sent (%O); this
    # requires the mod_logio module to be loaded.
    #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    
    #CustomLog logs/access_log common
    
    ##############
    
    ... skipping remainder of code......
    
    ##############
    
    
    
    Thanks for any help!:)
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Change
    Code:
    <Directory "/var/www/html">
    
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
        Options +Includes +FollowSymlinks [B][COLOR="Red"]-Indexes[/COLOR][/B]
    
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
        AllowOverride None
    
    #
    # Controls who can get stuff from this server.
    #
        Order allow,deny
        Allow from all
    
    </Directory>
    to
    Code:
    <Directory "/var/www/html">
    
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
        Options +Includes +FollowSymlinks [B][COLOR="Red"]+Indexes[/COLOR][/B]
    
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
        AllowOverride None
    
    #
    # Controls who can get stuff from this server.
    #
        Order allow,deny
        Allow from all
    
    </Directory>
    Restart Apache afterwards.
     
  3. bpmee

    bpmee Member

    Thanks for the change, but I still get the error!

    Hi Falko,

    Thanks for the advice, but unfortunately the error continues to show in my httpd error_log:

    Code:
    
    [Thu May 17 13:42:40 2007] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
    
    
    What next?:confused:
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Is there maybe an .htaccess file in /var/www/html? If so, what's in it?
     
  5. bpmee

    bpmee Member

    There's no .htaccess, should there be - or an index.html file

    Hi Falko,

    There is actually nothing in /var/www/html.:confused:

    Should there be an .htacess file or an index.html file?

    Thanks again...:)
     
  6. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -la /var/www/html
    ?
     
  7. bpmee

    bpmee Member

    Here is the output of that command

    Hi,

    The output of that command is:

    Code:
    [root@m]# ls -la /var/www/html
    total 24
    drwxr-xr-x  2 root root  4096 Jul 26  2006 .
    drwxr-xr-x 10 root root 12288 Mar 25 11:08 ..
    
    
    Permissions or ownership problem??:confused:
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Ok, no .htaccess file.
    You could change <Directory "/var/www/html"> to <Directory /var/www/html>. Not sure if that helps, though. Otherwise, you can search your httpd.conf for other <Directory ...> stanzas that might interfere with the /var/www/html stanza.
     
  9. Ghostwalk

    Ghostwalk New Member

    i've noticed that u don't have the .htaccess file but ur http.conf there's:
    #
    # AccessFileName: The name of the file to look for in each directory
    # for additional configuration directives. See also the AllowOverride
    # directive.
    #
    AccessFileName .htaccess

    try to comment it
     
  10. bpmee

    bpmee Member

    Would commenting .htaccess turn off this function for the rest of the server?

    Hi Ghostwalk,

    Thanks for your idea.

    Would commenting #.htaccess out turn off .htaccess that operates in different folders on the server?
     
  11. falko

    falko Super Moderator Howtoforge Staff

    No, just for this folder and its subdirectories.
     
  12. Ghostwalk

    Ghostwalk New Member

    comment .htaccess

    I quite sure that if you comment .htaccess in http.conf will disable the use of it in any folder for that apache instalation.
    That's the idea of it.
     
  13. falko

    falko Super Moderator Howtoforge Staff

    Yes, if he comments it out in the Apache configuration, but I understood that he wanted to remove an .htaccess file from a directory. Maybe I should read more carefully, but on the other hand I don't have that much time... :(
     
  14. hxbro

    hxbro New Member

    This is an old thread but whilst searching google for the message [client ::1] Directory index forbidden by Options directive: this thread comes up at the top.

    The cause of these messages probably come from the mpm_common module, it's an internal dummy connection:

    http://mail-archives.apache.org/mod_mbox/httpd-users/200604.mbox/<[email protected]>

    the simple solution is to create an empty index.html file in the directory. I don't advise turning on Indexes, although that is another solution.
     
  15. CarcaBot

    CarcaBot New Member

    Hello guys,

    to solve the problem just make a file named index.html into /var/www/html and nothing else.

    /CarcaBot - www.RENSLT.org
     
  16. Fingers

    Fingers New Member

    Hi

    I have this problem also on my Centos linux box with Matrix Control pannel, with only one domain on the system.

    [client ::1] Directory index forbidden by Options directive: /var/www/html/

    I just want to confirm that the fix is;

    create a blank index.html file and place it in the root of the website, in my case;

    /mydomain.co.uk/user/htdocs

    Is that right?

    If so does this not conflict indexing wise with my index.php file?

    Or do I create a folder /mydomain.co.uk/user/htdocs/html/ to place the file in?

    PS

    My domain is working perfectly so just how this error is trigered I dont know and I cant replicate it. My worry is it might put off search engine spiders!
     
    Last edited: Jun 15, 2008
  17. CarcaBot

    CarcaBot New Member

    Try both see what work, it cannot fail.

    /CarcaBot
     
  18. falko

    falko Super Moderator Howtoforge Staff

    You can either change the Options line for /var/www/html/ like this:
    Code:
    <Directory /var/www/html/>
    Options +Indexes
    </Directory>
    or you put an index file (index.html, index.php, etc.) in the /var/www/html/ directory. If you have multiple index files (.html, php, etc.) in /var/www/html/, the order of the index files in your DirectoryIndex line decides which one is executed.
     
  19. Fingers

    Fingers New Member

    HI

    I dont have a directory with this tree /var/www/html in my web root

    Mine is /mydomain.co.uk/user/htdocs

    So do I create /mydomain.co.uk/user/htdocs/var/www/html

    ?

    I wonder if this is because of the Matrix control panel?

    my httpd.conf file looks like this

    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #
    DocumentRoot "/var/www/html"

    Should I change this to "/mydomain.co.uk/user/htdocs" as this is whay my doc root looks like.???
     
  20. falko

    falko Super Moderator Howtoforge Staff

    Please Options +Indexes in the vhost for /mydomain.co.uk/user/htdocs and restart Apache.
     

Share This Page