Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I link log files to my web directory var/www ?

so I have var/www/logs 

And then remove reading permission to others in my unix link preferences ?

By the way can I change links preferences ?

share|improve this question
up vote 0 down vote accepted

Yes you can link to them. If you do that you'll be opening up the logs to others if you leave it 755 for /var/www/log. Since you seem not to want that you could put some form of authentication as a requirement before they can see/use the link. Means you'll have to distribute a shared password to those whom you DO wish to be able to see it.

share|improve this answer
yeah I actually want to change permissions only when I need to see the logs. For doing this I was considering to add the link in a parent folder and assign the permissions to the parent folder. Is that ok ? – Patrick Sep 26 '10 at 7:58
@Patrick: If you're ok with changing the permissions every time you want to view the data I don't see any problem with your approach. You will fill up the error logs a bit if your http program every tries to read the parent directory while it is still set to prohibit reading. It's not how I would do it but it should work. – hotei Sep 26 '10 at 14:12
If you're at all concerned about security you could also check your http access logs to see if anyone sneeked a peek at them while they were unprotected. A simple grep or two through the access logs will tell you if you're the only one looking at / interested in them. – hotei Sep 26 '10 at 16:29

Yes you could link /var/log too /var/www/log. But to be able to read that the user apache runs as need to have access to /var/log, links gets the same permissions as that what they point at.

But if you do that everyone who guesses the link to your logfiles can see them so some sort of protection is really needed.

share|improve this answer
so, if I cannot assign permission to the link, I can maybe assign different permissions to the parent folder of the link ? let's say /var/www/parentFolder/log so I can protect it ? – Patrick Sep 25 '10 at 16:37
@Patrick - Protect from whom? Users browsing to your server or users that are logged in to your server. – Nifle Sep 25 '10 at 16:47
browsing to my server. I'm the only logged user. But the point of the question is.. what about moving the link to a folder and assign permissions to that folder ? – Patrick Sep 26 '10 at 7:56
@Patrick - Yes. But you'd still need some sort of authentication. The webserver does not know it's you browsing in to view the logs. I think the simplest authentication is – Nifle Sep 26 '10 at 9:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .