allow file locking

5 posts / 0 new
Last post
#1 Fri, 01/18/2013 - 16:21
amel

allow file locking

hello,

can someone explain me how can we enable "file locking" in Virtualmin on CentOS 6. I have a web script that needs to lock some .htaccess files for some security reasons, but the script is not able to lock the files since "file locking is not enabled on the server" this is the message i have seen in the log..

Any idea ?

Amel

Fri, 01/18/2013 - 16:57
tpnsolutions
tpnsolutions's picture

Hi,

Are you simply trying to make it impossible/difficult to update the file?

Best Regards,
Peter Knowles
TPN Solutions

E: pknowles@tpnsolutions.com
P: 604-782-9342
W: http://www.tpnsolutions.com
Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
Fri, 01/18/2013 - 17:17
amel

Hi Peter,

thank You for quick response !

Yes I have a script that has to be able to lock the .htaccess file so no other scripts can make the changes.

Amel

Fri, 01/18/2013 - 17:56
tpnsolutions
tpnsolutions's picture

Amel,

Just a thought, what about simply changing the permissions on the file? That would only allow the owner of the file to change them back. So basically, a file by default is generally given 644 permissions, and by changing these permissions to say 444 or lower would make the file writeable, but still readable.

Best Regards,
Peter Knowles
TPN Solutions

E: pknowles@tpnsolutions.com
P: 604-782-9342
W: http://www.tpnsolutions.com
Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
Fri, 01/18/2013 - 19:26
amel

well the scenario is as follows:

My Server is configured to automatically generate a 403 Error if my root .htaccess file permissions are NOT what the Server allows (probably the Server is currently only allowing 644 permission). I need to configure the Server to allow 404 permissions for .htaccess files. but I am not sure where to change these settings...

Amel

Topic locked