.htaccess - apache virtualhost conf file and authorizations -


here conf file:

<virtualhost *:80>     serveradmin r0dy@r0dy.net     servername mtc.r0dy.net     serveralias www.mtc.r0dy.net      documentroot /var/www/mtc     <directory />             options followsymlinks             allowoverride none     </directory>     <directory /var/www/mtc>             options indexes followsymlinks multiviews             allowoverride none             order allow,deny             allow     </directory>      <directory /var/www/mtc/bo>             authname "restricted area: backoffice"             authtype basic             authuserfile /var/www/mtc/bo/.htpasswd #           authgroupfile /dev/null             require valid-user     </directory>      scriptalias /cgi-bin/ /usr/lib/cgi-bin/     <directory "/usr/lib/cgi-bin">             allowoverride none             options +execcgi -multiviews +symlinksifownermatch             order allow,deny             allow     </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  alias /doc/ "/usr/share/doc/" <directory "/usr/share/doc/">     options indexes multiviews followsymlinks     allowoverride none     order deny,allow     deny     allow 127.0.0.0/255.0.0.0 ::1/128 </directory>  </virtualhost> 

when comment out <directory /var/www/mtc/bo> part, doesnt ask credentials.
when uncomment it, if browse directory, asks credentials , works fine.
problem is asks credentials if don't go /bo/ directory, browse http://mtc.r0dy.net/ , i'm blocked.
idea on did wrong ?

in case has same problem, solved adding allow directives in directories :

        <directory />                  options followsymlinks                  #allowoverride none                  order allow,deny                  allow          </directory>          <directory /var/www/mtc>                  options indexes followsymlinks multiviews                  #allowoverride none                  order allow,deny                  allow          </directory>           <directory /var/www/mtc/bo>                  order allow,deny                  allow                  authname "restricted area: backoffice"                  authtype basic                  authuserfile /var/www/mtc/bo/.htpasswd  #               authgroupfile /dev/null                  require valid-user          </directory>

i don't understand why works allow directives , behaves strangely without, works fine now. if has explaination you're welcome.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -