linux系统中配置Apache服务
学习linux系统服务时,你可能会遇到多种问题,这里将介绍在linux系统中配置Apache服务问题的解决方法,在这里拿出来和大家分享一下。
1.备份Apache服务的主配置文件
[root@KCentOS5C ~]# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.backup
2.linux系统中配置Apache服务的主配置文件
[root@KCentOS5C ~]# vi /etc/httpd/conf/httpd.conf
这里主要改动以下这些参数:
ServerName *:80
配置Apache的服务器名,如果有域名的话请填写正确的服务器名。
Include conf.d/*.conf (/etc/httpd/conf.d)
确认Apache扩展配置文件的存放路径。
3.查看Nagios网页配置模板文件
[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.
#setting for nagios
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin" ###设定了Nagios的CGI执行目录对应的系统路径。
# 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.user ###这里指定了访问用户帐户库文件。
Require valid-user
Alias /nagios "/usr/local/nagios/share" ###设定了Nagios的网页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"
- 最新评论