DirectAdmin virtual domain error logs not included.
DirectAdmin virtual domain error logs not included.
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.
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.
-
- Junior Member
- Posts: 13
- Joined: 29 Dec 2013, 16:18
Re: DirectAdmin virtual domain error logs not included.
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.
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
becomes
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
with
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 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
Code: Select all
# ErrorLog /var/log/httpd/domains/domain.tld.subdomain.error.log
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
Now all error messages will be logged to /var/log/httpd/error_log as this is the default location and CSF will monitor this.
-
- Junior Member
- Posts: 13
- Joined: 29 Dec 2013, 16:18
Re: DirectAdmin virtual domain error logs not included.
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.
-
- Moderator
- Posts: 1524
- Joined: 01 Oct 2008, 09:24
Re: DirectAdmin virtual domain error logs not included.
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.
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 seems to work but the lfd.log shows:
note the ,
It seems separating files works best with a space.
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.
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
Code: Select all
Feb 6 15:05:15 host lfd[24551]: Watching /var/log/httpd/error_log,...
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
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.
-
- Moderator
- Posts: 1524
- Joined: 01 Oct 2008, 09:24
Re: DirectAdmin virtual domain error logs not included.
I'll have a look at adding globbing to the LOGSCANNER file too.
Re: DirectAdmin virtual domain error logs not included.
That would be great.
-
- Moderator
- Posts: 1524
- Joined: 01 Oct 2008, 09:24
Re: DirectAdmin virtual domain error logs not included.
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.
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.
-
- Junior Member
- Posts: 73
- Joined: 17 Feb 2009, 14:14
- Contact:
Re: DirectAdmin virtual domain error logs not included.
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:
So if this line is working, that would be great.
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