[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apache Server Log Rotation



Most files in http.conf are referenced relative to the server root.  So
if you're somewhere else and run the script, it can't find the file.
>From your prompt, I'd say you're in "/root", which means the script is
looking for log files in "/root/conf.d/bla/bla".

Try "cd /etc/httpd" then run the script.  Or, modify the

	push @files, $2;

to say

	push @files, "$server_root/$2";

I'm not a big fan of relative links, so I'd opt for the latter, but the
first way is faster to test.  Of course, I also prefer to list out the
logfiles for rotation explicitly instead of depending on the script to
paw through a configuration file... but that may just be the sysadmin in
me :)

Thanks,
Dave

On Fri, 2005-11-11 at 20:58 -0500, S Gowtham wrote:
> Hi,
> 
> Following this week's LUG Meeting comes this 
> script, to rotate and compress the Apache server
> log files.
> 
> When I ran this script as root (for RedHat 
> Enterprise Linux, Serer Root is /etc/httpd), I get 
> the following error :
> 
> [sgowtham@guardian ~]# ./aplogrot.pl
> Cannot open config file conf.d/auth_kerb.conf: No 
> such file or directory
> [sgowtham@guardian ~]#
> 
> eventhough the file, auth_kerb.conf (and others)
> exist under /etc/httpd/conf.d/
> 
> I am 'Perl'y-challenged and can't figure out
> where exactly the bug is. If any of you can get 
> this to work, please post the bug-fix to this
> list.
> 
> This and other scripts are also available in
> 
>   http://www.sgowtham.net/scripts.html
> 
> Cheers,
> Gowtham
> 
-- 
David Torrey <tj@xxxxxxx>
Michigan Tech University