[Resolved] Best Way to Protect a Directory in LS?

Status
Not open for further replies.

ShannonA

Well-Known Member
#1
What's the best way to protect a directory from file access in LS? I tried creating a .htaccess that reads "deny from all", then going to the server configuration and telling it to allow "limit" htacess configuration ... but the files are still accessible.

I don't care if it's done from a .htacess or from the LSWS control panel.

At the second we're on 4.x because the server reset there when I rebooted(!) and I can't switch to 5.x (this has been an ongoing issue for several releases). I'll switch back to 5.x after the holidays when I can monitor the server better (by using the command line tool, which seems to be all that works). Anywho, 5.x is the correct solution.
 

NiteWave

Administrator
#2
in .htaccess:

RewriteEngine On
Order allow, deny
Deny from all

put above lines at the very beginning, should work as expected.

at present, install latest lsws (now 5.0.10), there should be no problem at all to switch between 4.x and 5.x
 

ShannonA

Well-Known Member
#3
in .htaccess:

RewriteEngine On
Order allow, deny
Deny from all

put above lines at the very beginning, should work as expected.

at present, install latest lsws (now 5.0.10), there should be no problem at all to switch between 4.x and 5.x
Unfortunately, that doesn't work.

I turned on *all* the flags in the server configuration:

HT Access


Limit
Auth
FileInfo
Indexes
Options
None
Access File Name


.htaccess
I tried matching your .htaccess rather than the simpler one I had:
/var/www/rpgnet/members/files# cat .htaccess
RewriteEngine On
Order allow, deny
Deny from all
I verified the file is readable and accessible:
var/www/rpgnet/members/files# ls -lagh .htaccess
-rwxr-xr-x 1 root 50 Jan 1 11:36 .htaccess
My test file remains downloadable:
http://www.rpg.net/members/files/2015chcat.pdf

(This is now running 5.0.10)
 

NiteWave

Administrator
#4
if you provide access, I can login the server and trouble shoot this issue, see what happened.

if you read apache's httpd.conf, search
AllowOverride None
directive. if exist, change it to
AllowOverride All
 

ShannonA

Well-Known Member
#5
I fixed it. For anyone else's reference: you need to adjust the .htaccess/limit configuration on the Virtual Host (not just the Server).
 
Status
Not open for further replies.
Top