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

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

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

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

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