简体   繁体   中英

Let user XXX read error.log in Apache2 Debian

I have a VPS with last Debian installed.

I've apache2 and I use this vps to practicing with some friends.

By the way, I'm the only one with root ssh access, they have their own folders and accounts(ftp only), in /var/www/html/xxxxx/

The problem is: while they try new things and learn programming something, they need to see error.log of apache2, but they can't, and I need to check it for them and copy paste the errors.

Is there a way to let them see the error.log?

I tried these

  • Link the error.log to their folder (and obviously didn't worked)
  • Make a script that would copy the error.log to folders on file change. (But i'm not that skilled, and totally don't understand how to use something like: inotifywait).
  • PHP script that copy error.log and paste in a file in the folder (access denied.. and it is the expected behavior!!)

I'm pretty sure there is an easy solution I didn't thought of (like a php code to echo the error 500 content, this solution doesn't involve me directly, but I didn't find how to do)

Sorry for my english and if this question is stupid or already answered, I searched a lot.

Thanks

Apache is storing error logs in ${APACHE_LOG_DIR}/error.log (usually /var/log/apache2/error.log ) which is accessible only by root user.

You can specify custom error log location per website in your vhost config or .htaccess .

You should think about displaying errors instead of logging them at development stage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM