How to remove error_logs file?

Posted April 21, 2014 5.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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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
Anyone who can help me?
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.