自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Nagios編譯安裝之配置Apache服務(wù)

運維 系統(tǒng)運維
Nagios是一個可運行在Linux/Unix平臺之上的監(jiān)視系統(tǒng),Nagios可以用來監(jiān)視系統(tǒng)運行狀態(tài)和網(wǎng)絡(luò)信息。Nagios可以監(jiān)視所指定的本地或遠程主機以及服務(wù),同時提供異常通知功能。本文來學(xué)習(xí)下Nagios里面的配置Apache服務(wù)

Nagios里面的配置Apache服務(wù)如下:

  配置Apache服務(wù):

  1.備份Apache服務(wù)的主配置文件

  [root@KCentOS5C ~]# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.backup

  2.配置Apache服務(wù)的主配置文件

  [root@KCentOS5C ~]# vi /etc/httpd/conf/httpd.conf

  這里主要改動以下這些參數(shù):

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

  ServerName *:80

  配置Apache的服務(wù)器名,如果有域名的話請?zhí)顚懻_的服務(wù)器名。

  Include conf.d/*.conf

  確認Apache擴展配置文件的存放路徑。

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

  3.察看Nagios網(wǎng)頁配置模板文件

  [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 incorporated into your Apache web server

  # configuration file. Customize the paths, etc. as

  # needed to fit your system.

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

  設(shè)定了Nagios的CGI執(zhí)行目錄對應(yīng)的系統(tǒng)路徑。

  # 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

  這里指定了訪問用戶帳戶庫文件。

  Require valid-user

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

  設(shè)定了Nagios的網(wǎng)頁URL對應(yīng)的系統(tǒng)路徑。

  # 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

  這里指定了訪問用戶帳戶庫文件

  Require valid-user

  基本上這個文件可以直接使用。根據(jù)這個配置文件中指定的AuthUserFile項,它指定的是通過Apache訪問Nagios的合法用戶的帳戶名單庫文件,需要使用htpasswd命令對這個名單庫進行用戶的添加。而默認安裝環(huán)境下在/usr/local/nagios/etc/目錄下是沒有htpasswd.user這個文件的,所以需要手動添加。請?zhí)貏e注意,用root身份建立的htpasswd.user文件的權(quán)限問題,應(yīng)該在建立該文件完畢后立即更改為nagios用戶nagios組的所有權(quán),并且要增加Nagios同組用戶讀寫權(quán)限。

#p#

 

  4.整合Nagios網(wǎng)頁配置文件到Apache中

  將Nagios網(wǎng)頁配置文件作為Apache的擴展配置文件復(fù)制改名到Apache的擴展配置文件目錄/etc/httpd/conf.d/目錄下

  [root@KCentOS5C ~]# cp nagios-2.9/sample-config/httpd.conf /etc/httpd/conf.d/nagios-httpd.conf

  5.建立Nagios的網(wǎng)頁訪問用戶帳戶文件(這里必須要與Nagios網(wǎng)頁配置文件當中AuthUserFile指定的路徑文件名一致)

  [root@KCentOS5C ~]# touch /usr/local/nagios/etc/htpasswd.user

  6.更改Nagios網(wǎng)頁訪問用戶帳戶文件的屬主

  [root@KCentOS5C ~]# chown nagios.nagios /usr/local/nagios/etc/htpasswd.users

  7.對Nagios網(wǎng)頁訪問用戶帳戶文件增加同組成員讀寫權(quán)限(這主要是賦給apache這個系統(tǒng)用戶)

  [root@KCentOS5C ~]# chmod g+wr /usr/local/nagios/etc/htpasswd.users

  8.察看Nagios網(wǎng)頁訪問用戶帳戶文件的屬性信息

  [root@KCentOS5C ~]# ll /usr/local/nagios/etc/htpasswd.users

  -rw-rw-r-- 1 nagios nagios 0 Oct 5 14:05 /usr/local/nagios/etc/htpasswd.users

#p#

  9.添加htpasswd.user用戶

  我添加了一個kanecruise用戶,口令是123456。

  [root@KCentOS5C ~]# htpasswd -m /usr/local/nagios/etc/htpasswd.user kanecruise

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

  New password: 123456

  Re-type new password: 123456

  Adding password for user kanecruise

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

  10.察看htpasswd的使用方法,這里我就解釋一些比較重要和常用的。

  [root@KCentOS5C ~]# htpasswd

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

  Usage:

  htpasswd [-cmdpsD] passwordfile username

  htpasswd -b[cmdpsD] passwordfile username password

  htpasswd -n[mdps] username

  htpasswd -nb[mdps] username password

  -c Create a new file.

  建立新的帳戶庫文件。

  -n Don't update file; display results on stdout.

  -m Force MD5 encryption of the password.

  添加一個MD5口令加密的新用戶。

  -d Force CRYPT encryption of the password (default).

  -p Do not encrypt the password (plaintext).

  添加一個口令不加密的新用戶。

  -s Force SHA encryption of the password.

  添加一個SHA口令加密的新用戶。

  -b Use the password from the command line rather than prompting for it.

  -D Delete the specified user.

  刪除一個指定的用戶

  On Windows, NetWare and TPF systems the '-m' flag is used by default.

  在Windows、NetWare以及TPF這些操作系統(tǒng)中“-m”參數(shù)(啟用MD5對口令加密)是默認使用的

  On all other systems, the '-p' flag will probably not work.

  在其他的所有操作系統(tǒng)中“-p”(不對口令啟用加密)參數(shù)將可能會引起失敗。

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

  11.檢查htpasswd帳戶文件

  [root@KCentOS5C ~]# cat /usr/local/nagios/etc/htpasswd.users

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

  kanecruise

  apr1$Qwk9h/..$HaRakpabADGZL10dwPcrx1

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

  用戶添加正確,并且口令都以MD5的方式加密了。

通過文章的詳細介紹,我們又學(xué)會了Nagios里的Apache服務(wù)配置!

【編輯推薦】

責(zé)任編輯:趙鵬 來源: 網(wǎng)絡(luò)轉(zhuǎn)載
相關(guān)推薦

2011-03-22 14:20:30

Nagios安裝

2011-03-31 15:31:06

Redhat配置nagios

2010-05-31 12:22:13

Nagios pnp

2011-03-22 13:53:00

CentsNagios安裝

2010-01-07 16:34:08

Ubuntu apac

2011-03-31 16:05:15

Redhat配置nagios

2011-03-25 16:49:33

nagios服務(wù)

2011-08-22 12:25:05

nagios

2011-03-31 16:05:18

Redhat配置nagios

2011-08-22 12:25:02

nagios

2010-05-31 11:10:37

Nagios pnp

2011-03-11 14:02:53

Apache配置

2011-03-31 16:05:18

Redhat配置nagios

2011-03-09 14:34:10

lamp安裝

2011-03-25 16:59:07

編譯Nagios

2010-06-01 09:51:11

2011-03-31 16:09:21

Redhat配置nagios

2011-03-24 13:00:30

2011-03-25 17:06:55

Nagios插件plugins

2011-03-22 13:37:29

Nagios安裝
點贊
收藏

51CTO技術(shù)棧公眾號