Page 1 of 2

DirectAdmin virtual domain error logs not included.

Posted: 29 Jan 2014, 21:45
by Karel
I have a setup with DirectAdmin and CSF.

Default HTACCESS_LOG = /var/log/httpd/error_log is set.
BUT this monitors only a site configured at /var/www

DA puts an error.log file for every virtual domain in /var/log/httpd/domains/domain.tld.subdomain.error.log

If I am not mistaken these log files in /var/log/httpd/domains are NOT monitored!

The preferred method of monitoring all error.log files would be something like this: /var/log/httpd/domains/*.error.log
To prevent defining every virtual domain.

Perhaps HTACCESS_LOG = /var/log/httpd/error_log, /var/log/httpd/domains/*.error.log
would work, but I cannot find any reference of including multiple locations in HTACCESS_LOG.

Re: DirectAdmin virtual domain error logs not included.

Posted: 03 Feb 2014, 00:38
by nobodyfamous
I have a similar situation using virtualmin. I too would like to know how to add logs to be monitored

Re: DirectAdmin virtual domain error logs not included.

Posted: 03 Feb 2014, 08:57
by Karel
For DirectAdmin I found a temporarily solution. I hope temporarily because I hope CSF will fix this in a future version.

For DA (centos 6.5): Go to /usr/local/directadmin/data/users/xyz
xyz are the users controlled by DA.
Enter a xyz directory and edit httpd.conf
Place a # before every ErrorLog /var/log/httpd/domains/domain.tld.subdomain.error.log

Code: Select all

ErrorLog  /var/log/httpd/domains/domain.tld.subdomain.error.log
becomes

Code: Select all

# ErrorLog  /var/log/httpd/domains/domain.tld.subdomain.error.log
restart your httpd service.
Now all error messages will be logged to /var/log/httpd/error_log as this is the default location and CSF will monitor this.

For Virtualmin the procedure is simular, but is untested.

Edit /etc/httpd/conf/httpd.conf
Replace

Code: Select all

ErrorLog /var/log/virtualmin/domain.tld_error_log

with

Code: Select all

# ErrorLog /var/log/virtualmin/domain.tld_error_log
restart your httpd service.
Now all error messages will be logged to /var/log/httpd/error_log as this is the default location and CSF will monitor this.

Re: DirectAdmin virtual domain error logs not included.

Posted: 03 Feb 2014, 15:13
by nobodyfamous
I see I can set this in the Virtualmin Templates, so all new sites would use a common log. I need to look into this further. Thanks for the help.

Re: DirectAdmin virtual domain error logs not included.

Posted: 04 Feb 2014, 16:13
by ForumAdmin
File globbing will be allowed for *_LOG in the next version of csf when it is released.

Re: DirectAdmin virtual domain error logs not included.

Posted: 06 Feb 2014, 15:35
by Karel
Thanks for file globbing! Had to actually use a translator to find out it is something like a wildcard. Didn't expected such a quick implementation, great. :)

It seems the format for multiple files of "HTACCESS_LOG =" is important.
My suggested

Code: Select all

HTACCESS_LOG = /var/log/httpd/error_log, /var/log/httpd/domains/*.error.log
seems to work but the lfd.log shows:

Code: Select all

Feb  6 15:05:15 host lfd[24551]: Watching /var/log/httpd/error_log,...
note the ,
It seems separating files works best with a space.

Code: Select all

HTACCESS_LOG = /var/log/httpd/error_log /var/log/httpd/domains/*.error.log
Now all logs are correctly displayed as being watched in lfd.log including all *.error.log files.

One thing though. I like the CSF features "Watch System Logs" and "Search System Logs", but here these error_log and *.error.log files are not globbed together when you select the error_log. This would be really nice to have in a future version.

Re: DirectAdmin virtual domain error logs not included.

Posted: 06 Feb 2014, 15:37
by ForumAdmin
I'll have a look at adding globbing to the LOGSCANNER file too.

Re: DirectAdmin virtual domain error logs not included.

Posted: 06 Feb 2014, 15:40
by Karel
That would be great.

Re: DirectAdmin virtual domain error logs not included.

Posted: 06 Feb 2014, 15:52
by ForumAdmin
It will now definitely be in the next version.

One word of caution, file globs are only evaluated when lfd is started, so if logs are added that should be included lfd will have to be restarted.

Re: DirectAdmin virtual domain error logs not included.

Posted: 06 Feb 2014, 16:39
by Black Tiger
It's better to use the multiple HTACCESS logs then changing the user's httpd.conf files for a couple of reasons.

1.) If you change the log, a user can't view his domains error logs anymore. That's no problem if you're the only user on a VPS or something, but certainly not advisable for hosting company's or if you have multiple users for other reasons.

2.) If for ever reason (which happens more often then you think) somebody needs to use the "rewrite_confs" option, which is also being used after an apache upgrade and if I'm correct also php upgrade, or an upgrade of DA, the user's httpd.conf gets overwritten. At least if I'm not mistaken. And your changes are undone.

That's why you can better use the existing folders and the double log line like explained by Karel:

Code: Select all

HTACCESS_LOG = /var/log/httpd/error_log /var/log/httpd/domains/*.error.log
So if this line is working, that would be great.