View previous topic :: View next topic |
Author |
Message |
Sanjiyan n00b
Joined: 29 Mar 2004 Posts: 39
|
Posted: Thu Aug 26, 2004 4:00 am Post subject: help... I deleted /var/log how do I fix it? |
|
|
All,
I did a stupid thing. I deleted /var/log thinking it would be OK to do so as the files in there were rather large.
Now my system starts up with errors such as the apache logs being missing, as such apache no longer works.
sshd etc complains about a /var/log/lastlog being missing also....
Anyone know how I can fix this? I finally got my gentoo box all up and working the way I wanted it, after setting it up (took me 2 weeks ) now I do this and I mess it up again, is there away to fix this while not having to reinstall everything? |
|
Back to top |
|
|
metallikop Apprentice
Joined: 06 Jan 2004 Posts: 259 Location: Detroit, MI
|
Posted: Thu Aug 26, 2004 4:56 am Post subject: |
|
|
Oops
Code: | mkdir /var/log
mkdir /var/log/apache2
touch /var/log/apache2/access_log
touch /var/log/apache2/error_log
touch /var/log/messages
touch /var/log/lastlog
touch /var/log/syslog
chown -R root:root /var/log
chown root:adm /var/log/syslog /var/log/messages /var/log/lastlog
|
|
|
Back to top |
|
|
Sanjiyan n00b
Joined: 29 Mar 2004 Posts: 39
|
Posted: Thu Aug 26, 2004 5:01 am Post subject: |
|
|
metallikop wrote: | Oops
Code: | mkdir /var/log
mkdir /var/log/apache2
touch /var/log/apache2/access_log
touch /var/log/apache2/error_log
touch /var/log/messages
touch /var/log/lastlog
touch /var/log/syslog
chown -R root:root /var/log
chown root:adm /var/log/syslog /var/log/messages /var/log/lastlog
|
|
I did all that apart from the:
chown -R root:root /var/log
chown root:adm /var/log/syslog /var/log/messages /var/log/lastlog
I'll do that now, I had to make the syslog.
Many thanks is there a program I can use that rotates these logs? so I can delete the older ones? to stop me from messing this up again?
It all seems tobe working |
|
Back to top |
|
|
Red Sparrow Tux's lil' helper
Joined: 05 Feb 2004 Posts: 128 Location: Greeley, CO
|
Posted: Thu Aug 26, 2004 5:13 am Post subject: |
|
|
syslog-ng also has a built-in rotating facility, but I haven't used it myself.
(- Steve -) |
|
Back to top |
|
|
Sanjiyan n00b
Joined: 29 Mar 2004 Posts: 39
|
Posted: Thu Aug 26, 2004 6:04 am Post subject: |
|
|
Using logrotate, here is my config file for anyone who needs to use one as a basis for theirs:
Code: |
nomail
olddir /var/log/rotated_logs
# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v 1.2 2004/07/18 01:58:24 dragonheart Exp$
#
# Logrotate default configuration file for Gentoo Linux
#
# See "man logrotate" for details
# rotate log files weekly
weekly
#daily
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
# uncomment this if you want your log files compressed
compress
# packages can drop log rotation information into this directory
include /etc/logrotate.d
notifempty
nomail
# no packages own lastlog or wtmp -- we'll rotate them here
/var/log/wtmp {
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
/var/log/proftpd.log {
}
/var/log/cron.log {
}
/var/log/xferlog {
}
/var/log/kern.log {
}
/var/log/syslog {
}
/var/log/apache2/access_log {
}
/var/log/apache2/error_log {
}
/var/log/mysql/mysql.err {
}
/var/log/mysql/mysql.log {
}
/var/log/mysql/mysqld.err {
}
|
|
|
Back to top |
|
|
|