LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 07-09-2011, 08:41 AM   #1
masterav
Member
 
Registered: Aug 2008
Location: India
Distribution: redhat el5,fedora,centos
Posts: 30

Rep: Reputation: 0
Question HTTP Config + point error log to syslogd


Hi,
I have configured a virtual host.Here is what i have did,

<VirtualHost rubby.tob.net:80>
ServerAdmin root@localhost
DocumentRoot /var/www/html/
ServerName rubby.tob.net
# ErrorLog logs/dixie_error_log
ErrorLog syslog | local8.*
CustomLog logs/rubby_access_log common
</VirtualHost>
<VirtualHost tubby.tob.net:80>
ServerAdmin root@localhost
DocumentRoot /var/www/html/
ServerName tubby.tob.net
# ErrorLog logs/glpi_error_log
ErrorLog syslog | local9.*
CustomLog logs/tubby_access_log common
</VirtualHost>


The problem here is how to point the error log to syslogd.Here is my syslog file,

#vim /etc/syslog.conf


og all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages

# The authpriv file has restricted access.
authpriv.* /var/log/secure

# Log all the mail messages in one place.
mail.* -/var/log/maillog


# Log cron stuff
cron.* /var/log/cron

# Everybody gets emergency messages
*.emerg *

# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler

# Save boot messages also to boot.log
local7.* /var/log/boot.log

local8.* /var/log/httpd/rubby_error_log
local9.* /var/log/httpd/tubby_error_log
~
~

If i point the file,separatelt at httpd.conf for the errorlog,i'm getting the errog log.I'm using Centos 5.6.

Thanks in advance.
~
.
 
Old 07-09-2011, 09:27 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,775

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

First of all there are 8 local facilities (local0 to local7) in syslog.conf.
Second in apache ErrorLog directive you need a colon ":" and not the pipe symbol "|" to define the syslog facility. And you dont need a "*" at the end
So use:
Code:
ErrorLog syslog:local0
and in syslog.conf, add:
Code:
local0.*                                        /var/log/httpd/rubby_error_log
Regards

Last edited by bathory; 07-09-2011 at 09:36 AM.
 
Old 07-10-2011, 12:31 AM   #3
masterav
Member
 
Registered: Aug 2008
Location: India
Distribution: redhat el5,fedora,centos
Posts: 30

Original Poster
Rep: Reputation: 0
Hi Bathory,

Thanks for your reply,and i have tried as you have pointed out but still I couldn't find any error logs getting updated in the respective log files.When I point out directly to the error files at httpd.conf,it working perfectly,while using syslog it is not working.


Yes i have found the mistake, just a typo.....But still there is another problem ,I've two virtual host(Please see at the top for the httpd config file),I'm getting error logs onlt for first virtual host,that is rubby.gai.net and not for tubby.gai.net


Finalised the problem:

I found that only for the entry where there is local0 in syslog is taking.Whereas the local1 which is pointed for another virtual host is not taking.let me show,

#vim /etc/syslog.conf



# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages

# The authpriv file has restricted access.
authpriv.* /var/log/secure

# Log all the mail messages in one place.
mail.* -/var/log/maillog


# Log cron stuff
cron.* /var/log/cron

# Everybody gets emergency messages
*.emerg *

# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler

# Save boot messages also to boot.log
local7.* /var/log/boot.log

local1.* /var/log/httpd/rubby_error_log
local0.* /var/log/httpd/tubby_error_log





And my httpd.conf


<VirtualHost rubby.tob.net:80>
ServerAdmin root@localhost
DocumentRoot /var/www/html/
ServerName rubby.tob.net
# ErrorLog logs/dixie_error_log
ErrorLog syslog:local1
CustomLog logs/rubby_access_log common
</VirtualHost>
<VirtualHost tubby.tob.net:80>
ServerAdmin root@localhost
DocumentRoot /var/www/html/
ServerName tubby.tob.net
# ErrorLog logs/glpi_error_log
ErrorLog syslog:local0
CustomLog logs/tubby_access_log common
</VirtualHost>

Here is the case, i'm getting errors only for tubby.gai.net, and it going to the rubby_error_logs file.I'm not getting it for rubby.tob.net

Last edited by masterav; 07-10-2011 at 12:46 AM.
 
Old 07-10-2011, 03:59 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,775

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

You can change the ErrorLog for rubby.tob.net to
Code:
ErrorLog "|/usr/bin/logger -p local1.info"
so it logs to /var/log/httpd/rubby_error_log through the local1 facility

Regards
 
Old 07-10-2011, 05:43 AM   #5
masterav
Member
 
Registered: Aug 2008
Location: India
Distribution: redhat el5,fedora,centos
Posts: 30

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by bathory View Post
Hi,

You can change the ErrorLog for rubby.tob.net to
Code:
ErrorLog "|/usr/bin/logger -p local1.info"
so it logs to /var/log/httpd/rubby_error_log through the local1 facility

Regards

Hi Bathory,

That done the trick,

Thanks a lot :-)
 
  


Reply

Tags
error, httpdconf, syslogd


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How dom I configure syslogd to write to a memory buffer instead of /var/log/messages? forbin Linux - Server 1 02-17-2011 09:59 AM
[SOLVED] Why don't syslogd write severity of messages to log file? Himilhil Linux - Software 3 07-02-2009 02:41 AM
how can i log entire message displayed on console (no klogd, syslogd) neolunch Linux - General 0 02-25-2009 05:52 AM
syslogd - unable to log ? Vilius AIX 1 12-01-2008 11:18 AM
enable syslogd ppp log noir911 *BSD 3 08-10-2004 03:48 PM


All times are GMT -5. The time now is 05:01 AM.

Main Menu
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