Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 16th, 2001, 03:51 AM
Sheriff's Avatar
Sheriff Sheriff is offline
Oheim
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Austria
Posts: 69 Sheriff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Unhappy Log files - please help!!!

Hy guys!

I'm about to give up...
First up: I have not a lot knowledge about Linux. The company I work for just rented a web-server. I know how to get those Apache Log files to rotate every 24 hours.

But my boss wants monthly ones, which are named like browser_log_2001-10.log. Now I know that I sorta need to merge the daily ones into one monthly one and delte the old daily ones.

Now, I could have Apache make that, but in the Docs it says you shouldn't because of performance.

How would I do this? I searched for progs which would do this task for me, but the only one I could find doesn't work on our Server.

Can anybody point me to a prog like that, or tell me how to do this?

Bear in mind, that I am a total Linux newbie!

Thanks in advance!
Sheriff
__________________
There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.

God is just hacker who rooted the world!

Reply With Quote
  #2  
Old October 17th, 2001, 06:51 PM
unluckyboy unluckyboy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: L.A.
Posts: 49 unluckyboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
I too went throught the same thing with my boss, but I found a program that you should really check out it will take care of you log problems its called webalizer and you can get it from http://www.mrunix.net/webalizer/
__________________
Have a lot of fun...

Reply With Quote
  #3  
Old October 18th, 2001, 07:24 AM
Sheriff's Avatar
Sheriff Sheriff is offline
Oheim
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Austria
Posts: 69 Sheriff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Hy-
thanks for your reply, but my problem is the rotation of the logfiles, not the processing. To get our stats, we use something different. But thanks anyways!
best regards
Sheriff

Reply With Quote
  #4  
Old October 18th, 2001, 07:43 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You need a log processing program more than a log rotation one since they are already rotated. The biggest concern is performance and resources, including the merging and parsing whenever your boss needs to read it.

When you can't find such script for such abnormal task, why not writing your own script? It should be plain simple and doesn't take you 1 month of Perl/PHP knowledge.

Once you decide which language to use, and if you have a problem, post it to Perl/PHP forum.

Keep in mind, you don't need to merge them to one big file for parsing. You can even gunzip it on the fly if it's browser_log_2001-10_log.gz.

Reply With Quote
  #5  
Old October 18th, 2001, 08:58 AM
Sheriff's Avatar
Sheriff Sheriff is offline
Oheim
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Austria
Posts: 69 Sheriff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Actually I was thinking of writing my own PHP script to do what I want it to do.
I have only 2 problems with that:
1) How do I get the Logfile to be read/writeable by PHP?
2) Can I run PHP as a bash script? Cos if I can't I have the problem, that apache will have to do it again...

Oh, at the moment my logfiles are
user/goup: root/root
permissions: -rw-r--r--

If I do it with PHP they need to be r/w for the apache server right?

best regards
Sheriff

Reply With Quote
  #6  
Old October 18th, 2001, 05:27 PM
IceMan IceMan is offline
Roving Icicle
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Netizen
Posts: 56 IceMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Send a message via ICQ to IceMan Send a message via AIM to IceMan Send a message via Yahoo to IceMan
In order for any script to proccess the logs, or any file for that matter, its process must have r/w privs.

As for the script itself, I'd actually reccomend using a shell scripting language such as Bourne (Again) or Korn. The script will be a bit simpler (IMO) and run with less overheard. Its also much eaiser to cron a shell script than to do the equivelant to a PHP script.

And, no, as far as I know, you can't run PHP as a bash script.
__________________
Is it just me or is it cold in here?

Reply With Quote
  #7  
Old October 18th, 2001, 10:55 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> 1) How do I get the Logfile to be read/writeable by PHP?

The user Apache runs as just need priviledge to READ, not WRITE. And permissions: -rw-r--r-- is world-readable and fine.

>> 2) Can I run PHP as a bash script?

If you can't use PHP to do it, always look for alternative. BTW, you can write a Perl or Shell script or whatever to do the backend stuff via cron and use PHP as the frontend for viewing log info via browser.

If you don't know where to start, go buy a Perl for dummies or PHP newbie book. The task you need to do is very basic.

Reply With Quote
  #8  
Old October 21st, 2001, 08:02 AM
telex4's Avatar
telex4 telex4 is offline
Wacky hack
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 513 telex4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 m 37 sec
Reputation Power: 13
I would havethought Perl would be the obvious choice here, being more suited for admin scripting... in fact you'll probably find there are loads of Perl scripts hidden throughout your OS already. And if you like you can give the script a web frontend too. Look for O'Reilly - Learning Perl, or O'Reilly - Programming Perl (or both, even better!).

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Log files - please help!!!

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap