Apache

Getting Started

This guide will go over how to set up a Linux server running Apache to send error_log and apache_log to Nagios Log Server using rsyslog. Before you start you should make sure that both rsyslog and Apache are installed on the system you are going to send logs from.

Configuration Setup

This uses a script to configure your syslogs to send to Log Server. To customize your syslog install, configure syslog manually by clicking on one of the tabs above.

Automatic Script - Supported Operating Systems
  • CentOS, Fedora, and RHEL
  • Ubuntu and Debian

You must have rsyslog installed. If your operating system is not listed, you can manually configure syslog.

Run the Script

On the system you want to send Apache access_log and error_log logs from, run the following commands to download and run the script to automatically setup for rsyslog to send apache logs to Nagios Log Server. Validate below that your apache logs are in the default location specified, /var/log/httpd/.

Verify Spool and Config Location

Put the following commands in your terminal window to verify the rsyslog spool directory and that the rsyslog.d folder exists. The second line will output the spool path you will need to add in the next section for $WorkDirectory in the configuration.

Setup the Rsyslog Configuration File

Edit your /etc/rsyslog.conf file. Add the following to to the configuration file, looking for the 'begin forwarding rule.' There are two different sections in the configuration below, the top section is for the Apache error_log and the second section is for the Apache access_log.

Verify Incoming Logs

Once you have configured the log sender, you should start receiving logs right away. Put in the senders IP address to see if you are receiving logs from that IP.

IP Address