Apache2 Debian localhost 403 error (when not superuser)

417 views Asked by At

I just installed apache2 on my Debian machine and I am unable to access the localhost. I get the "It works" mesage if I open lynx as a superuser:

 # lynx "http://localhost"

However if I open it as a normal user I get a 403 error.

I tried changing the permissions for /var/www/ with

# chmod a+x /var/www/
# chmod 755 /var/www/
# chmod a+x /var/www/index.html 
# chmod 755 /var/www/index.html

and the result is still the same. For my home folder the permissions are: drwxr-xr-x.

I ran a

# chgrp -Rv <username> /home/<username>/

and now I can't access localhost/~<username> as root nor as .

This is how my /etc/apache2/sites-enabled/000-default looks like:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        allow from all
    </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 ${APACHE_LOG_DIR}/error.log

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

    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Also my /etc/apache2/mods-enabled/userdir.conf:

<IfModule mod_userdir.c>
    UserDir public_html
    UserDir disabled root

    <Directory /home/*/public_html>
            AllowOverride All
            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>
</IfModule>

Sorry for the noob question, but I've been googling and trying to fix this for quite a while and I still haven't managed to get anything working as the normal user.

1

There are 1 answers

1
Moonray On

What do you see in log files? Provide us with ErrorLog and AccessLog files. Take a look at apache2.conf and find the paths.

Usualy it is

/usr/local/apache2/logs