设为首页 收藏本站
查看: 1473|回复: 0

[经验分享] httpd

[复制链接]

尚未签到

发表于 2018-12-17 10:17:08 | 显示全部楼层 |阅读模式
先展示几张效果图片,安装步骤文章后面;





一、      安装apache 、php
  tar -zxvfapr-1.5.2.tar.gz
  cdapr-1.5.2
  ./configure--prefix=/usr/local/apr
  make
  makeinstall
  tar -zxvfapr-util-1.5.4.tar.gz
  cdapr-util-1.5.4
  ./configure--prefix=/usr/local/apr-util --with-apr=/usr/local/apr
  make
  makeinstall
  unzippcre-8.38.zip
  cdpcre-8.38
  ./configure--prefix=/usr/local/pcre
  make
  makeinstall
  tar -zxvfhttpd-2.4.18.tar.gz
  cdhttpd-2.4.18
./configure --prefix=/usr/local/apache  --enable-so --enable-ssl --enable-cgi--enable-rewrite --with-zlib --with-pcre=/usr/local/pcre--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/--enable-modules=most --enable-mpms-shared=all --with-mpm=event
  make
  make install
  cd /etc/profile.d
  vim apache.sh
  增加# /etc/profile
  增加PATH=/usr/local/apache/bin:$PATH
  vim /etc/man.config
  增加MANPATH/usr/local/apache/man
  apachectlstart
  tar -zxvfphp-5.6.18.tar.gz
  cdphp-5.6.18
  yuminstall libxml2-devel.x86_64 libxml2.x86_64 -y
  ./configure--prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs
  make
  makeinstall
  cpphp.ini-development /usr/local/lib/php.ini
LoadModule php5_module modules/libphp5.so #编辑 httpd.conf文件以调用 PHP 模块
二、      安装nagios-core
Install required packages
  yuminstall gd -y
  安装gd-devel,由于在新版的系统不自带这个组件了,我们需要单独下载安装
  首先安装gd-devel的依耐组件
  yuminstall  fontconfig-devel.x86_64libX11-devel libXpm-devel libjpeg-devel libpng-devel zlib-devel
rpm -ivh gd-devel-2.0.35-11.el6.x86_64.rpm
  yuminstall  php gcc glibc glibc-common  make net-snmp
yum install gcc-c++.x86_64 openssl-devel
  yuminstall perl-CGI  perl-Time-HiResperl-CPAN perl-Module-Build rrdtool
  rpm -ivhperl-GD-2.45-1.el6.rfx.x86_64.rpm
  rpm -ivhrrdtool-perl-1.3.8-6.el6.x86_64.rpm
  (需额外下载的包gd-devel-2.0.35-11.el6.x86_64.rpm
  perl-GD-2.45-1.el6.rfx.x86_64.rpm
  rrdtool-perl-1.3.8-6.el6.x86_64.rpm
rrdtool-php-1.3.8-6.el6.x86_64.rpm)

Install nagios core
  groupadd-g 3000 nagios
  groupadd-g 3001 nagcmd
  useradd-u 3000 -g nagios -G nagcmd -d /usr/local/nagios -c 'Nagios Admin' nagios
  usermod  -a nagios nagios apache
  usermod  -a -G  nagcmd apache
  tar -zxvfnagios-cn-4.1.1.tar.gz
  cdnagios-4.1.1
./configure --prefix=/usr/local/nagios--with-nagios-user=nagios --with-nagios-group=nagios --with-command-user=nagios--with-command-group=nagcmd --with-httpd-conf=/usr/local/apache/conf/extra
  make all
  makeinstall
  makeinstall-init
  makeinstall-commandmode
  makeinstall-config
make install-webconf
  vimhttpd.conf
  增加Includeconf/extra/nagios.conf
  修改User apache
  修改Group apache
  修改
  DirectoryIndex index.html index.php
  
末行添加 AddType application/x-httpd-php .php
开启模块 cgid_module cgi_module php5_module  actions_module
  cp -Rcontrib/eventhandlers/ /usr/local/nagios/libexec/
  chown -Rnagios:nagios /usr/local/nagios/libexec/eventhandlers
  /usr/local/nagios/bin/nagios-v  /usr/local/nagios/etc/nagios.cfg
  /etc/init.d/nagiosstart
  apachectlstart
  htpasswd-c /usr/local/nagios/etc/htpasswd.users nagiosadmin
  设定密码
chown nagios:nagcmd /usr/local/nagios/etc/htpasswd.users
三、      安装Nagios Plugins
  tar -zxvf nagios-plugins-2.1.1.tar.gz
  cd nagios-plugins-2.1.1
  ./configure --with-nagios-user=nagios--with-nagios-group=nagios
  make
  make install
  chown -R nagios.nagios/usr/local/nagios/libexec
四、      安装nrpe
  tar -zxvf nrpe-2.15.tar.gz
  cd nrpe-2.15
  ./configure
  make all
  make install-plugin
  make install-daemon
  make install-daemon-config
  make install-xinetd
  编辑 /etc/xinetd.d/nrpe 文件,添加监控ip
  only_from       = 127.0.0.1
  编辑/etc/services添加NRPE daemon
  nrpe            5666/tcp # NRPE
  service xinetd restart
  /usr/local/nagios/libexec/check_nrpe -Hlocalhost  #验证插件,和client验证,-H后面添加client地址
  chown nagios.nagios /usr/local/nagios
  chown -R nagios.nagios/usr/local/nagios/libexec
五、      客户端安装NRPE Nagios 、Plugins
  客户端:
  useradd -s /sbin/nologin nagios
  安装 nagios-plugins
  ./configure --with-nagios-user=nagios--with-nagios-group=nagios
  make
  make install
  ….参照 三、四 两点安装
六、      安装Nagios Graph
  tar -zxvf nagiosgraph-1.5.2.tar.gz
  cd nagiosgraph-1.5.2
  perl install.pl --check-prereq
  perl install.pl
  ./install.pl --layout overlay --prefix/usr/local/nagios
  (配置路径部分均选择/usr/local/nagios)
  vi share/nagiosgraph.ssi
  src="/nagiosgraph/nagiosgraph.js"   to   src="/nagios/nagiosgraph.js"
  cp share/nagiosgraph.ssi/usr/local/nagios/share/ssi/common-header.ssi
  编辑Nagiosgraphp配置文件,确保一下参数路径
  vi/usr/local/nagios/etc/nagiosgraph/nagiosgraph.conf
  perflog           =/usr/local/nagios/var/perfdata.log
  rrddir            = /usr/local/nagios/var/rrd
  mapfile           =/usr/local/nagios/etc/nagiosgraph/map
  nagiosgraphcgiurl = /nagios/cgi-bin
  javascript        =/nagios/nagiosgraph.js
  stylesheet        =/nagios/nagiosgraph.css
  logfile           =/usr/local/nagios/var/nagiosgraph.log
cgilogfile        =/usr/local/nagios/var/nagiosgraph-cgi.log
调整以下文件所属用户
   chown nagios:nagios/usr/local/nagios/etc/nagiosgraph
   chown nagios:nagios /usr/local/nagios/sbin
   chown nagios:nagios/usr/local/nagios/libexec/insert.pl
   chown nagios:nagios/usr/local/nagios/share/nagiosgraph.css /usr/local/nagios/share/nagiosgraph.js
   chown nagios:nagios/usr/local/nagios/share/ssi/common-header.ssi
创建RRD目录,并设置以下权限
   mkdir /usr/local/nagios/var/rrd
   chmod nagios:apache/usr/local/nagios/var/rrd
   chmod 755 /usr/local/nagios/var/rrd

创建nagiosgraph.log nagiosgraph-cgi.log文件(有就不必创建),并调整权限
   touch /usr/local/nagios/var/nagiosgraph.log
   chown nagios/usr/local/nagios/var/nagiosgraph.log
   chmod 644/usr/local/nagios/var/nagiosgraph.log


   touch/usr/local/nagios/var/nagiosgraph-cgi.log
   chown apache/usr/local/nagios/var/nagiosgraph-cgi.log
   chmod 644/usr/local/nagios/var/nagiosgraph-cgi.log

编辑/usr/local/nagios/share/side.php在 ‘Trends’ heading下添加:

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-652323-1-1.html 上篇帖子: 关于PHP错误日志不记录的问题 下篇帖子: php 得到所选择的mysql数据库名称和链接信息
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表