logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: LocationMatch - Syntax Error in Regex?
Author
n8tgc



Joined: 24 Nov 2015
Posts: 2
Location: Manchester, NH

PostPosted: Tue 24 Nov '15 21:35    Post subject: LocationMatch - Syntax Error in Regex? Reply with quote

Have a web frontend on a workstation running Apache 2.4.7 on Ubuntu 14.04. Authentication to the site is enabled and works as desired, as configured below.

Code:

<Directory "/var/www/html/mythweb" >
    AuthType           Digest
    AuthName           "MythTV"
    AuthUserFile       /etc/mythtv/mythweb-digest
    Require            valid-user
    BrowserMatch       "MSIE"      AuthDigestEnableQueryStringHack=On
    Order              allow,deny
    Satisfy            any
...
</Directory>


However, I am attempting to gain "unauthenticated" access to files in a subfolder using the following...

Code:

<LocationMatch .*\/tv_icons\/*.*/>
   Allow from all
</LocationMatch>


Testing the RegEx string shows that it is valid. However when using the URL
http://www.domain.com/folder/subfolder/tv_icons/qubo.png
I am prompted for username/password. Not open access as desired. access.log shows a 401 error.

If I first authenticate, the URL works. However, I would like access to files IN THAT FOLDER without the need to authenticate.

Any suggestions into how I configured LocationMatch incorrectly?

Thanks in advance!
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Tue 24 Nov '15 23:43    Post subject: Reply with quote

http://httpd.apache.org/docs/2.4/mod/core.html#locationmatch

Does not this work:

Code:
<LocationMatch "/tv_icons">
   Allow from all
</LocationMatch>

But maybe you can just use the Location directive.
Back to top
n8tgc



Joined: 24 Nov 2015
Posts: 2
Location: Manchester, NH

PostPosted: Wed 25 Nov '15 0:37    Post subject: Solved! Reply with quote

Ok, so I found out that in Apache 2.4 Authentication Configuration changed a little.

I cleaned up a line and added a line...
Code:

    <LocationMatch "/tv_icons">
        Allow from all
        Satisfy Any
    </LocationMatch>



Now works perfectly!
Back to top


Reply to topic   Topic: LocationMatch - Syntax Error in Regex? View previous topic :: View next topic
Post new topic   Forum Index -> Apache