Le seguenti 99 parole non sono state trovate nel dizionario di 1275 termini (includendo 1275 LocalSpellingWords) e sono evidenziate qui sotto:
alarm   Allow   allow   Apache   apache   apachepwd   Auth   basic   be   both   can   cat   combination   command   complicated   Config   config   configuration   controls   Controls   deny   directive   directives   docs   etc   example   Exec   explicitly   file   File   files   Follow   for   from   get   give   hidden   htaccess   htpasswd   httpd   if   important   Includes   Indexes   information   keywords   Limit   Links   Linksif   make   Match   mod   more   Multi   my   myusername   Name   named   None   Note   Now   Options   options   or   Order   Override   Owner   password   path   placed   Please   Possible   protect   replaced   Require   Restart   root   see   srv   stuff   sure   Sym   that   this   to   To   Type   use   User   user   username   users   valid   values   Views   want   what   who   with  

Nascondi questo messaggio
Italiano English
Modifica History Actions

htaccess

Apache: protect with username and password a web path

First of all in the apache config make sure you can Override the configuration with the hidden .htaccess files. In this example config I replaced AllowOverride None to AllowOverride All

<Directory "/srv/http">
    #
    # 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 Indexes FollowSymLinks

    #
    # 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
    AllowOverride All 

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

Restart apache if you change the apache configuration.

Now in the directory you want to protect create the hidden .htaccess file, here my example:

[root@alarm ~]# cat /srv/http/.htaccess 
AuthType basic
AuthName REALM
AuthUserFile /etc/apachepwd
Require valid-user

[root@alarm ~]# 

To create users in the apachepwd file use the command htpasswd

htpasswd /etc/apachepwd myusername