Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

stop logs file

General questions about VestaCP
Locked
  • Print view
Advanced search
7 posts • Page 1 of 1
vestacp89
Posts: 83
Joined: Thu Aug 14, 2014 11:04 am

stop logs file

Post by vestacp89 » Thu Jul 09, 2015 11:57 am

hi,

how i can remove and stop all logs file like e.g. for each domain who make really big files and kill my hdd ?

Thanks.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: stop logs file

Post by skurudo » Fri Jul 10, 2015 9:06 am

It's not good idea, but if you like it, do it ;-)
Most size of logs - apache2 and nginx - you can disable those.
There is not one option, but simple way - config file.

/etc/apache2/apache2.conf

Code: Select all

LogLevel crit
and you must comment out any ErrorLog and CustomLog directives in your Apache configuration files

Same way for nginx, replace access_log/error_log in your nginx configuration files

Code: Select all

 access_log  off;
 error_log off;
Once the changes are made, run /etc/init.d/apache2 restart and /etc/init.d/nginx restart for the changes to take effect.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: stop logs file

Post by skurudo » Fri Jul 10, 2015 9:08 am

Much better way is to use logrotate and limit size of your logs.. look at your /etc/logrotate.d/ folder and edit files to add limits

1 megabyte:

Code: Select all

size 1M
and rotate faster ;-)

Code: Select all

rotate 14
Top

vestacp89
Posts: 83
Joined: Thu Aug 14, 2014 11:04 am

Re: stop logs file

Post by vestacp89 » Wed Nov 11, 2015 10:18 am

skurudo wrote:Much better way is to use logrotate and limit size of your logs.. look at your /etc/logrotate.d/ folder and edit files to add limits

1 megabyte:

Code: Select all

size 1M
and rotate faster ;-)

Code: Select all

rotate 14

etc/logrotate.conf this ?
my logrotate.conf file content is:

Code: Select all

# see "man logrotate" for details
# rotate log files weekly
weekly

# use the syslog group by default, since this is the owning group
# of /var/log/syslog.
su root syslog

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}

/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}

# system-specific logs may be configured here
I need bellow /var/log/btmp add e.g.

Code: Select all

/var/log/apache2/domains/domain.com.error.log {
  missingok
  daily
  create 0660 root root
  rotate 1
  size 2M
}
this is it ? i need run cron ?

Thanks.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: stop logs file

Post by skurudo » Thu Nov 12, 2015 5:00 pm

vestacp89 wrote: etc/logrotate.conf this ?
my logrotate.conf file content is:
this is it ? i need run cron ?
CentOS?

See this topic, it's pretty full with examples and explanation:
http://stackoverflow.com/questions/2016 ... r-all-logs
Top

vestacp89
Posts: 83
Joined: Thu Aug 14, 2014 11:04 am

Re: stop logs file

Post by vestacp89 » Thu Nov 19, 2015 3:31 pm

skurudo wrote:
vestacp89 wrote: etc/logrotate.conf this ?
my logrotate.conf file content is:
this is it ? i need run cron ?
CentOS?

See this topic, it's pretty full with examples and explanation:
http://stackoverflow.com/questions/2016 ... r-all-logs
ubuntu 14.04
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: stop logs file

Post by skurudo » Wed Jul 27, 2016 12:32 pm

vestacp89 wrote:
skurudo wrote:
vestacp89 wrote: ubuntu 14.04
/etc/logrotate.d
Top


Locked
  • Print view

7 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password