LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 08-19-2009, 02:17 PM   #1
since1993
Member
 
Registered: Aug 2009
Location: Seoul in Korea
Distribution: Debian 5.0.2 lenny
Posts: 36
Blog Entries: 2

Rep: Reputation: 16
Question In Apache server, How to change log file location and log format for access log fil?


I installed Apache server with Debian 5.0.2 Lenny. I am trying to write a script which would analysis web log files. I found the log files on /var/log/apache2. There is an access log file, `access.log`.
My question is what configuration file determines the location and the name of the access log file. How can I change them? I used CustomLog in /etc/apache2/apache2.conf like below.

LogFormat ": %h %l %u %t \"%r\" %>s %b" common
CustomLog /home/test/my_log_file common

Apache2 generated /home/test/my_log_file. But no logs were written in the file even after I run `/etc/init.d/apache2 restart`. I changed the log file location. It still didn't work. However, Apache2 still wrote logs in the file `/var/log/apache2/access.log`
Please help me.
 
Old 08-19-2009, 05:14 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
Apache2 generated /home/test/my_log_file. But no logs were written in the file even after I run `/etc/init.d/apache2 restart`.
Are you sure that the user that runs apache has write access in that directory? Also if you have vhosts enabled, check where their log files are located.

Regarding the logs format you can take a look at this. I prefer the combined CustomLog as contaims Referrer and User-Agent, that is good for web site log analysis.

Regards

Last edited by bathory; 08-19-2009 at 05:20 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid Proxy is unable to log "access.log" file. nishith Linux - Server 6 08-10-2008 01:00 AM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 05:13 PM
Apache Access Log File Problem kirtimaan_bkn Linux - Server 2 10-24-2006 12:27 AM
Strange results in /var/log/apache/access.log subt13 Linux - Security 2 08-03-2004 02:21 PM
How do I view the default Apache access log file? johann519 Linux - General 2 05-10-2004 12:46 PM


All times are GMT -5. The time now is 05:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration