How to remove error_logs file?

April 21, 2014 2.2k views
Hi, I have a setup of centos / apache with virtualmin. I just noticed today that error_logs files are being created in public_html folder and is publicly accessible. How can I prevent this file from being created in public_html, can I shift the location of this file? OR any other solutions? Please help. Thanks for your help in advance.
8 Answers
Can you pastebin your .htaccess file (if any) and your virtualhost's config?

here is the link for virtualhost and .htaccess file
Please discard the previous one is the new link.

Thanks for the help
You can change the error log by changing the path on this line

ErrorLog /var/log/virtualmin/domainname.com_error_log

Or you can use the CHMOD command to change the permissions so that it is not publicly accessible.
Thanks Colin for the help.
The CHMOD is working fine.

Can you please help me in how to change the path
ErrorLog /var/log/virtualmin/domainname.com_error_log

can I do this
ErrorLog /var/log/virtualmin/
is this correct way to do.

Thanks for further help.
@hypertextsol: That line is what determines where the log file is stored. So, just change the line and make sure that the directory actually exists. And restart apache.
Have another answer? Share your knowledge.