First, apologize if I didn’t put it under the correct category for it, because I don’t need help with hosting, rather just a suggestion. It is actually related to Ifastnet itself but I wanted to say it here too.
I think it would be good if we allow users to see their own error logs in their own accounts, by logs I mean the log files stored in /var/log/apache2.
Refering to this KB article
.htaccess rules are quite sensitive to errors. And when they break, servers are not very clear about what the issue is.
It actually is, if I write for example foo inside the .htaccess file and then visit my site (hosted on my vps), I will see 500 Error, this is what is logged in the error.log file after i visit my site:
[Thu Aug 05 19:19:24.502378 2021] [core:alert] [pid 247482] [client 172.70.34.33:20924] /var/www/html/.htaccess: Invalid command 'foo', perhaps misspelled or defined by a module not included in the server configuration, referer: arc.io
But when it comes to Infinityfree and most of shared hosting providers, users cannot access such file which means it becomes hard to debug for them, hence most of people who face into issues complain these:
My website is configured to write error logs in the log file due to the security. Where can I access logs?
My website works fine on localhost but it throws 500 error on this hosting.
Would be such thing possible for users in future? Thanks!
That’s how you normally do it, yes. But having access to this file (At least partially) would help a lot in debugging and would definitely speed things up.
Rereading your post w more seriousness than originally, I would suggest that you instead try to capture errors BEFORE they are thrown and log them yourself as well rather than relying on the server.
Sadly, no. Shared hosting limitations make this inherently hard to do, and free hosting limitations even more so.
I completely agree that having such logs would make things much easier to debug websites, but there are good reasons why we don’t have them.
For starters, giving people access to /var/log/apache2 doesn’t just give users access to their own error logs, it gives everyone access to everyone’s access and error logs.
Second, catching .htaccess errors is finicky because they aren’t so easily linked to a specific domain or vhost, unlike access logs or PHP errors.
And third, free hosting had log collection for user sites for a while, but processing and storing logs for millions of sites has some inherent challenges that made it hard to keep running in stable, sustainable way, so it was cut.
A VPS makes everything easier because you have the entire server to yourself and are most likely paying for it. And of course a paid service is going to be better than a free one.
In my experience, most people don’t ask where they can find the error error logs. They just ask why their website doesn’t work.
And when they look for error logs it is because they Googled a bit themselves and found an answer saying “you need to check this log file here” without actually understanding what’s in that file or what to do with the result.
Web hosting is designed for hosting websites, not so much for building them. If you’re developing a site, a local XAMPP stack is much easier to use, gives you full logs and you don’t have to develop files over an FTP connection.
Oh I did not mean it, as far as I am aware apache allows you to change the error log path for every virtual host, every website is a virtual host so yeah.
Hmm it actually does link, if you notice there is /var/www/html/.htaccess in that error, although it does not really link to the line of what caused the issue, however it is easier than trying to find what caused the issue.
I thought it is actually easy to debug as the server configurations are different than local ones.
Anyway, makes sense, thanks for the response.