简体   繁体   中英

Problems accessing files on Apache server

I set up apache2 on my Raspberry Pi (Raspbian).

I am trying to use Bootstrap along with some custom javascript. When looking at the errors thrown in the browser, all my Bootstrap files have a status of 403 Forbidden.

I believe I have all the permissions set correctly.

drwxr-xr-x  5 pi   root 4096 Sep 16 01:00 .
drwxr-xr-x 12 root root 4096 Sep 15 21:21 ..
drw-r--r--  6 pi   pi   4096 Sep 16 00:59 bootstrap
drw-r--r--  4 pi   pi   4096 Sep 16 01:00 extra
drw-r--r--  7 pi   pi   4096 Sep 16 01:00 img
-rw-r--r--  1 pi   pi   2560 Sep 16 01:00 index.html

When I try to cd into a directory I get...

-bash: cd: bootstrap/: Permission denied

While I can sudo my way in, I am thinking this is part of the problem.

I am not sure what else to do. Here is my Apache configuration in "sites-available".

<VirtualHost *:80>
        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
        </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>

I am not really sure what to try or if I am doing this the right way.

The files in folders? What's their access permission?

try this :

sudo chmod -R +r `path`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM