0

Its a well known problem: When migrating or deploying systems often log folders are not writable because of permission problems. But giving 0777 on them can be a security problem in a production system. Putting 0664 requires group permissions and certain scripts do not have for whatever reason. I do not think that anybody needs executables in a log folder though.

Is it a good choice to use 0666 for a log folder or is this not a good idea for some reason?

Need this for some PHP code which is used in different systems - currently it looks like this:

$logdir = __DIR__ . "/../log/";

try {
    @chmod($logdir,0666);
} catch(Exception $exception) {
    // try to go on in case of failure
}
0

A sane common practice is security based on least privileges operations.

A given application should have a dedicated log directory, that it does not own, with rights restricted both at directory and file levels so that only the logging application has write access to it, and eventually read access (may not be even needed).

Besides that your question is too broad, and a little offtopic for here, you should have a look at serverfault.com instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.