Configure Apache service for Nagios compilation and installation (1)

Source: Internet
Author: User

NagiosConfiguration inApacheThe service is as follows:

Configure Apache service:

1. Back up the master configuration file of the Apache service

[Root @ KCentOS5C ~] # Cp/etc/httpd/conf/httpd. conf/etc/httpd/conf/httpd. conf. backup

2. Configure the main configuration file of the Apache service

[Root @ KCentOS5C ~] # Vi/etc/httpd/conf/httpd. conf

Here we mainly change the following parameters:

-----------------------------------------------------

ServerName *: 80

Configure the Apache server name. If there is a domain name, enter the correct server name.

Include conf. d/*. conf

Confirm the path for storing the Apache extension configuration file.

-----------------------------------------------------

3. view the Nagios webpage configuration Template File

[Root @ KCentOS5C ~] # Less nagios-2.9/sample-config/httpd. conf

-----------------------------------------------------

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER

# Last Modified: 11-26-2005

#

# This file contains examples of entries that need

# To be ininitialized ated into your Apache web server

# Configuration file. Customize the paths, etc.

# Needed to fit your system.

ScriptAlias/nagios/cgi-bin "/usr/local/nagios/sbin"

Set the system path corresponding to the CGI execution directory of Nagios.

# SSLRequireSSL

Options ExecCGI

AllowOverride None

Order allow, deny

Allow from all

# Order deny, allow

# Deny from all

# Allow from 127.0.0.1

AuthName "Nagios Access"

AuthType Basic

AuthUserFile/usr/local/nagios/etc/htpasswd. users

Access to the user account library file is specified here.

Require valid-user

Alias/nagios "/usr/local/nagios/share"

Set the system path of the Nagios webpage URL.

# SSLRequireSSL

Options None

AllowOverride None

Order allow, deny

Allow from all

# Order deny, allow

# Deny from all

# Allow from 127.0.0.1

AuthName "Nagios Access"

AuthType Basic

AuthUserFile/usr/local/nagios/etc/htpasswd. users

The access to the user account library file is specified here

Require valid-user

Basically, this file can be used directly. According to the AuthUserFile item specified in this configuration file, it specifies that the account list library file of Valid users of Nagios is accessed through Apache. You need to use the htpasswd command to add users to this list library. By default, the file htpasswd. user does not exist in the/usr/local/nagios/etc/directory. Therefore, you must manually add the file. Please note that htpasswd created as root. the permission of the user file should be changed to the nagios group ownership immediately after the file is created, and the read and write permissions of users in the nagios group should be added.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.