You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Steve Reilly <sf...@roadrunner.com> on 2007/12/10 00:04:05 UTC

[users@httpd] access.log problem

good evening,


I admit through fault of my own, the apache2 access logs were deleted.  
My question is this,  are these logs automagically regenerated on their 
own when apache2 is restarted?, and if they are, what can I do if they 
have not been regenerated by numerous apache2 restarts, and also 
complete system reboots.

I have not modified the portion of the virtual server where the logs are 
mentioned, it is as it was when first installed.  I am using debian 
etch, and apache2.  After several hours of googling, I have resorted to 
asking the list, thanks for any pointers..!

Steve

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] access.log problem

Posted by Steve Reilly <sf...@roadrunner.com>.
>
>
> Try the following:
>
> root> su - apache
> apache> cd /var/log/apache
> apache> echo test > access.log

well, I think I might be making some progress, the above did in fact
write test to the access.log (i physically made this log, not apache)
>
> That of course assumes that 'apache' is a working user, with a login
> shell, but you get the idea.
>
> Furthermore check what your logrotate does. Are the access.log.*
> files written by Apache itself (using a log statement configuration
> that pipes into a log rotator) or via a cron driven logrotate? In
> the latter case, Apache doesn't need to write access.log.1 and "tail
> -f" on the file wouldn't be too useful.

I did not touch the base config for debian etch when I installed the
server last year.   Im also not too familiar with logrotate, Im going to
assume it is the standard debian install as I have touched nothing. 
Last I knew before the contents of /var/log/apache2 was deleted there
was access.log, access.log.1 text files and then tars of .2 through
.28.  I made the access.log and access.log.1 to see if apache would
write anything to it. no dice yet.

>
> What are the exact permissions of: /var, /var/log,
/var owned by root, and root filegroup 1600755
/var/log owned by root, and  root filegroup 1600755
/var/log/apache2 owned by root, and root filegroup 1600755
/var/log/apache2/access.log owned by root, root filegroup 1600644
/var/log/apache2/error.log owned by root, root filegroup 600644

I made the access.log the same permissions as error.log, was that wrong?




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] access.log problem

Posted by Karel Kubat <ka...@e-tunity.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steve,

On Dec 12, 2007, at 1:10 PM, Steve Reilly wrote:

> I wish it was that easy lol, Ive been at this for days now.  system
> restarts dont even cure the problem.  All I did was remove all the log
> files (access.log through access.log.28) written by apache2 in
> /var/log/apache2/ directory thinking that an apache2 -k restart or
> apache2ctl restart would rewrite them but it did not.  now Im screwed,
> because everything ive tried is not working.  The reason why I did  
> this
> is because for some reason beyond me apache was no longer writing to
> access.log.1 . it  stopped one day and never continued.  Webalizer
> showed no logs after like the middle of november, and if I did a  
> tail -f
> /var/log/apache2/access.log.1 nothing showed no matter how many  
> times I
> accessed any site of mine.   I never messed with ownership of any
> directory in /var.  error.log shows normal operations, which im  
> curious
> about?  if apache2 is not able to write logs, wouldnt it say something
> about it?

Be sure to verify and re-verify permissions. In 90% of the cases  
that's where the problem lies, even though it may seem otherwise at  
first.

Try the following:

root> su - apache
apache> cd /var/log/apache
apache> echo test > access.log

That of course assumes that 'apache' is a working user, with a login  
shell, but you get the idea.

Furthermore check what your logrotate does. Are the access.log.*  
files written by Apache itself (using a log statement configuration  
that pipes into a log rotator) or via a cron driven logrotate? In the  
latter case, Apache doesn't need to write access.log.1 and "tail -f"  
on the file wouldn't be too useful.

What are the exact permissions of: /var, /var/log, /var/log/apache, / 
var/log/apache/* (especially error_log compared to access*)?

HTH,
    --
    Karel Kubat / M +31 6 2956 4861 (+31 6 AWK 6 HUM 1)
    Blind Spot: What Dick and Jane did to be cruel.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)

iD8DBQFHX9LF23FrzRzybNURAiRpAJwKhtnoamzX/wHkpnsIUs63lcGKJgCgzdDh
mx7w1U4ML8IsTX5AdAmu87E=
=uCeK
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] access.log problem

Posted by Steve Reilly <sf...@roadrunner.com>.
Staf Wagemakers wrote:
>
>
> On Dec 10, 2007 12:04 AM, Steve Reilly <sfreilly@roadrunner.com
> <ma...@roadrunner.com>> wrote:
>
>
>     I admit through fault of my own, the apache2 access logs were deleted.
>     My question is this,  are these logs automagically regenerated on
>     their
>     own when apache2 is restarted?, and if they are, what can I do if
>     they
>     have not been regenerated by numerous apache2 restarts, and also
>     complete system reboots.
>
>
> The access-log file is created automatically at a httpd server start
> if it doesn't exists..
>
> apache2ctl restart should do the trick
>
> -- 
> Staf Wagemakers   - http://www.wagem <http://www.wagemakers.be>

I wish it was that easy lol, Ive been at this for days now.  system
restarts dont even cure the problem.  All I did was remove all the log
files (access.log through access.log.28) written by apache2 in
/var/log/apache2/ directory thinking that an apache2 -k restart or
apache2ctl restart would rewrite them but it did not.  now Im screwed,
because everything ive tried is not working.  The reason why I did this
is because for some reason beyond me apache was no longer writing to
access.log.1 . it  stopped one day and never continued.  Webalizer
showed no logs after like the middle of november, and if I did a tail -f
/var/log/apache2/access.log.1 nothing showed no matter how many times I
accessed any site of mine.   I never messed with ownership of any
directory in /var.  error.log shows normal operations, which im curious
about?  if apache2 is not able to write logs, wouldnt it say something
about it?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] access.log problem

Posted by Sander Smeenk <ss...@freshdot.net>.
Quoting Staf Wagemakers (staf.wagemakers@gmail.com):

> > own when apache2 is restarted?, and if they are, what can I do if they
> > have not been regenerated by numerous apache2 restarts, and also
> > complete system reboots.
> The access-log file is created automatically at a httpd server start if it
> doesn't exists..  apache2ctl restart should do the trick

If, however, you've rm -rf'ed the log directory and recreated it, please
make sure the ownerships and mode on the directory (and files therein)
are correct so your Apache user can write to them.

-Sndr.
-- 
| Intaxication: Euphoria at getting a tax refund, which lasts until you
| realize it was your money to start with.
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8  9BDB D463 7E41 08CE C94D

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] access.log problem

Posted by Staf Wagemakers <st...@gmail.com>.
On Dec 10, 2007 12:04 AM, Steve Reilly <sf...@roadrunner.com> wrote:

>
> I admit through fault of my own, the apache2 access logs were deleted.
> My question is this,  are these logs automagically regenerated on their
> own when apache2 is restarted?, and if they are, what can I do if they
> have not been regenerated by numerous apache2 restarts, and also
> complete system reboots.


The access-log file is created automatically at a httpd server start if it
doesn't exists..

apache2ctl restart should do the trick

-- 
Staf Wagemakers   - http://www.wagemakers.be