Coding

Ampps - Error message “Forbidden You don't have permission to access / on this server”

 Forbidden You don't have permission to access / on this server

is actually the default configuration for an apache directory in httpd.conf.
 
#
# 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 FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all          # the cause of permission denied
</Directory>
Simply changing Deny from all to Allow from all should solve the permission problem.
 
Alternatively, a better approach would be to specify individual directory permissions on virtualhost configuration.
 
<VirtualHost *:80>
    ....
 
    # Set access permission
    <Directory "/path/to/docroot">
        Allow from all
    </Directory>
 
    ....
</VirtualHost>
As of Apache-2.4, however, access control is done using the new module mod_authz_host (Upgrading to 2.4 from 2.2). Consequently, the new Require directive should be used.
 
<VirtualHost *:80>
    ....
 
    # Set access permission
    <Directory "/path/to/docroot">
        Require all granted
    </Directory>
 
    ....
</VirtualHost>

0 Bình luận

Trở về
  • HTML5 Canvas
  • HTML5 Canvas

     The <canvas> element is used to draw graphics, on the fly, on a web page. Draw a red rectangle, a gradient rectangle,...