Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-29-2011, 05:15 AM   #1
Registered: Nov 2007
Posts: 73

Rep: Reputation: 17
Red face Apache "access_log" not created. "CustomLog" not working

Hi Team,
Recently I compiled Apache/2.2.21 from source. Everything working great except the access log not created at any where. But Error log is created and appended properly. I can see the following in my httpd.conf

ErrorLog "logs/error_log"
LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

    CustomLog "logs/access_log" common
I checked if log_config_module is loaded. Its loaded properly. Please see the following op.

[root@server conf]# /apache/bin/apachectl -t -D DUMP_MODULES
Loaded Modules:
 core_module (static)
 mpm_worker_module (static)
 http_module (static)
 so_module (static)
 sm_module (shared)
 authz_host_module (shared)
 proxy_module (shared)
 proxy_connect_module (shared)
 proxy_http_module (shared)
 include_module (shared)
 deflate_module (shared)
 log_config_module (shared)
 expires_module (shared)
 headers_module (shared)
 setenvif_module (shared)
 mime_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 speling_module (shared)
 alias_module (shared)
 rewrite_module (shared)
 jk_module (shared)
Syntax OK
But access_log file is not created in the log dir. The error log is working properly.

I tried to use CustomLog directive inside virtual host block as follows.

CustomLog "| /apache/bin/rotatelogs /apache/logs/mysitecom.%Y%m%d.access.log 86400" combined
The access log is created but it contains only one word "combined" is there.

Any help or suggestion will be appreciated.
Old 09-29-2011, 06:35 AM   #2
Registered: Sep 2011
Posts: 124

Rep: Reputation: Disabled
Have you tried accessing the web server? I expect you would have, but I guess we have to check.
Old 09-29-2011, 06:49 AM   #3
Senior Member
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
the Log command under <VirtualHost ...>
ErrorLog /var/log/httpd/error_log
CustomLog /var/www/html/sitedomain_dirname/example.com_access_log combined
the format in "httpd.conf" file:

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
ErrorLog /var/log/httpd/error_log

# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
LogFormat "%h %l %u %t \"%m %{Host}i%U%q %H\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here.  Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
CustomLog /var/log/httpd/access_log common
the files could not be there, so you can create them with : "touch /var/log/httpd/access_log" etc.
give them if needed "chmod 644 ..."

Last edited by lithos; 09-29-2011 at 06:52 AM.


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
".config" and ".kde" folders are being created under root directory (Slack Current) piratesmack Slackware 8 03-12-2011 11:06 PM
Strange "characters" appearing in auto "created" man pages Sector11 Linux - General 7 02-28-2010 11:05 AM
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 07:11 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM

All times are GMT -5. The time now is 01:33 PM.

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