Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Apache2 problem: Forbidden You don't have permission...

  1. #1
    Join Date
    Jul 2006
    Beans
    209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Apache2 problem: Forbidden You don't have permission...

    Okay, I am in the last throws of transferring data from my antique server to my old server. The trouble is what I believe to be an simple apache2 issue that I can't figure out.

    I can't get my darn apache2 to stop forbidding access to my folder. here is my /etc/apache2/sites-available:
    Code:
    NameVirtualHost *
    <VirtualHost *>
            ServerAdmin webmaster@localhost
    
            DocumentRoot /var/www
            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
            </Directory>
            <Directory /var/www/>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
                    # Uncomment this directive is you want to see apache2's
                    # default start page (in /apache2-default) when you go to /
                    #RedirectMatch ^/$ /home/clinton/online/coldowl/
            </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
            ServerSignature On
    
        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>
    
    <VirtualHost *>
    ServerName www.coldowl.com
    ServerAlias coldowl.com
    DocumentRoot /home/clinton/online/coldowl/
    <Directory /home/clinton/online/coldowl>
    AllowOverride All
    Options ExecCGI Includes
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>
    I have no idea why its not working and i'm not sure this is where I should be looking to resolve the problem.

    I've looked on the apache website. It had this to say about the issue:
    Why do I get a "Forbidden" message whenever I try to access a particular directory? This message is generally caused because either

    • The underlying file system permissions do not allow the User/Group under which Apache is running to access the necessary files; or
    • The Apache configuration has some access restrictions in place which forbid access to the files.

    You can determine which case applies to your situation by checking the error log.
    In the case where file system permission are at fault, remember that not only must the directory and files in question be readable, but also all parent directories must be at least searchable (i.e., chmod +x /directory/path) by the web server in order for the content to be accessible.
    If one looks at the [url=http://httpd.apache.org/docs/1.3/misc/FAQ.html#forbidden] apache website[\url], question 15 says to look for a particular string in that one file. But there isn't anything in my httpd.conf file. There is something that looks like it in my apache2.conf

    Any help is appreciated.
    LIM 1/n = Knowledge of Man
    n → ∞

    My Blog: www.ColdOwl.com

  2. #2
    Join Date
    Jul 2008
    Location
    Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Apache2 problem: Forbidden You don't have permission...

    Quote Originally Posted by afbase View Post
    DocumentRoot /home/clinton/online/coldowl/
    <Directory /home/clinton/online/coldowl>
    I've just tried the same but with "localhost" and "/tmp" (just for testing locally), and I got this error in the apache log files :
    [Mon May 25 21:15:45 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /tmp/
    Then I created an empty index.html in /tmp and.. it worked
    Do you have an index.html file in that DocumentRoot ?

  3. #3
    Join Date
    Jul 2006
    Beans
    209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Apache2 problem: Forbidden You don't have permission...

    Quote Originally Posted by albinootje View Post
    I've just tried the same but with "localhost" and "/tmp" (just for testing locally), and I got this error in the apache log files :

    Then I created an empty index.html in /tmp and.. it worked
    Do you have an index.html file in that DocumentRoot ?
    I have an index.php

    Not an index.html

    Its a drupal installation (i've already pre-tested the drupal locally and it works perfectly. Now I'm trying to make it accessible to the web).

    This is my /etc/apache2/mods-available/dir.conf
    Code:
    <IfModule mod_dir.c>
    
             #DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
             DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
    
    
    
    </IfModule>
    I figure that this should imply that apache should read my index.php just fine.

    my /etc/mime.types snippet is as follows:
    Code:
    ......other stuff......
    application/x-hdf                               hdf
    application/x-httpd-php                         phtml pht php
    application/x-httpd-php-source                  phps
    application/x-httpd-php3                        php3
    application/x-httpd-php3-preprocessed           php3p
    application/x-httpd-php4                        php4
    ......other stuff......
    you can try accessing the website i'm try to make available at http://www.coldowl.com
    LIM 1/n = Knowledge of Man
    n → ∞

    My Blog: www.ColdOwl.com

  4. #4
    Join Date
    Jul 2008
    Location
    Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Apache2 problem: Forbidden You don't have permission...

    Quote Originally Posted by afbase View Post
    I have an index.php

    Not an index.html
    Please test with an index.html too, and check the permissions of related files and directories.

    And.. most important : check your apache log files!

  5. #5
    Join Date
    Jul 2008
    Location
    Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Apache2 problem: Forbidden You don't have permission...

    And did it work as "localhost" before ?

  6. #6
    Join Date
    Jul 2006
    Beans
    209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Apache2 problem: Forbidden You don't have permission...

    it worked as http://10.0.0.106/drupal/

    The folder was in /var/www/drupal/ when i tested it. It have since moved and renamed the folder to /home/clinton/online/coldowl

    I just tried restarting apache 2 I got an warning message:
    Code:
    [Mon May 25 12:55:04 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
    any reason for this?
    LIM 1/n = Knowledge of Man
    n → ∞

    My Blog: www.ColdOwl.com

  7. #7
    Join Date
    Jul 2006
    Beans
    209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Apache2 problem: Forbidden You don't have permission...

    Quote Originally Posted by albinootje View Post
    Please test with an index.html too, and check the permissions of related files and directories.

    And.. most important : check your apache log files!
    I'll try just that as soon as i can.
    LIM 1/n = Knowledge of Man
    n → ∞

    My Blog: www.ColdOwl.com

  8. #8
    Join Date
    Jul 2006
    Beans
    209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Apache2 problem: Forbidden You don't have permission...

    well here is a snippet of the most recent errors in my error log (/var/log/apache2/error.log) :

    Code:
    [Mon May 25 12:59:16 2009] [crit] [client 65.55.106.158] (13)Permission denied: /home/clinton/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
    [Mon May 25 12:59:59 2009] [crit] [client 66.249.68.169] (13)Permission denied: /home/clinton/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
    [Mon May 25 13:00:13 2009] [crit] [client 38.99.13.119] (13)Permission denied: /home/clinton/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
    [Mon May 25 13:00:21 2009] [crit] [client 10.0.0.1] (13)Permission denied: /home/clinton/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://ubuntuforums.org/showthread.php?p=7344759
    I think the problem is observable to me. But it is not something I know how to fix.
    Last edited by afbase; May 25th, 2009 at 09:05 PM. Reason: I wanted to make a point that i'm stuck with this problem
    LIM 1/n = Knowledge of Man
    n → ∞

    My Blog: www.ColdOwl.com

  9. #9
    Join Date
    Jul 2006
    Beans
    209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Apache2 problem: Forbidden You don't have permission...

    I just looked at my antique server. There isn't an /home/clinton/.htaccess file there. So why is it that apache2 is looking for an .htaccess on this server? should i try:
    Code:
    ~$ touch .htaccess
    ?
    LIM 1/n = Knowledge of Man
    n → ∞

    My Blog: www.ColdOwl.com

  10. #10
    Join Date
    Jul 2006
    Beans
    209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Apache2 problem: Forbidden You don't have permission...

    BUMP
    ---------------and Side Note---------------------
    Ok which one of you decided to send me a message by telling my to encrypt my home directory?
    Code:
    clinton@coldowl:/etc/apache2/sites-available$ sudo vim default
    clinton@coldowl:/etc/apache2/sites-available$ sudo /etc/init.d/apache2 restart
     * Restarting web server apache2                                                                                                                                                 Warning: DocumentRoot [/home/clinton/online/coldowl/] does not exist
    Warning: DocumentRoot [/var/www/phpmyadmin] does not exist
    Warning: DocumentRoot [/home/clinton/online/gallery2/] does not exist
    Warning: DocumentRoot [/home/clinton/online/torrentflux/html] does not exist
    Warning: DocumentRoot [/home/clinton/online/phpBB3] does not exist
    Warning: DocumentRoot [/home/clinton/online/cmb] does not exist
    Warning: DocumentRoot [/home/clinton/online/magnumjones] does not exist
    Warning: DocumentRoot [/home/clinton/online/torrentbart/html] does not exist
    [Mon May 25 19:26:09 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
     ... waiting Warning: DocumentRoot [/home/clinton/online/coldowl/] does not exist
    Warning: DocumentRoot [/var/www/phpmyadmin] does not exist
    Warning: DocumentRoot [/home/clinton/online/gallery2/] does not exist
    Warning: DocumentRoot [/home/clinton/online/torrentflux/html] does not exist
    Warning: DocumentRoot [/home/clinton/online/phpBB3] does not exist
    Warning: DocumentRoot [/home/clinton/online/cmb] does not exist
    Warning: DocumentRoot [/home/clinton/online/magnumjones] does not exist
    Warning: DocumentRoot [/home/clinton/online/torrentbart/html] does not exist
    [Mon May 25 19:26:10 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
                                                                                                                                                                              [ OK ]
    clinton@coldowl:/etc/apache2/sites-available$ cd ~
    clinton@coldowl:~$ cd online
    -bash: cd: online: No such file or directory
    clinton@coldowl:~$ ls
    Access-Your-Private-Data.desktop  README.txt
    clinton@coldowl:~$ vim README.txt 
    clinton@coldowl:~$ ecryptfs-mount-private
    clinton@coldowl:~$ ls
    Access-Your-Private-Data.desktop  README.txt
    I'm not mad, just a bit wierded out by it all. I've been hacked before and its no fun. I guess this is more of a thank you than anything else.
    ---------------------------
    all my files are back though. Same problem though.

    I found someone having a similar/same problem but on httpd (link). He found a solution however I don't believe that would work for apache2. maybe this link could help you guys revise a solution because chcon commands are above my head.
    LIM 1/n = Knowledge of Man
    n → ∞

    My Blog: www.ColdOwl.com

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •