##nginx
cd /opttar -xvf nginx-1.8.1.tar.gz -C /usr/src/cd /usr/src/nginx-1.8.1./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module --with-http_ssl_module && make && make install || echo "nginx error" >>/opt/error.txt nginx的启动 比如安装目录:/usr/local/nginx nginx的主配置文件:/usr/local/nginx/conf/nginx.conf
首次启动: /usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx -t #如果有successful 说明正常 /usr/local/nginx/sbin/nginx -s reload #重新加载 /usr/local/nginx/sbin/nginx -s stop #停止
#mysqlcd /opt/tar -xvf mysql-5.6.29.tar.gz -C /usr/src/cd /usr/src/mysql-5.6.29./configure --prefix=/usr/local/mysql --with-plugins=max --with-extra-charsets=all && make && make install || echo "mysql error" >>/opt/error.txt -DWITH_INNOBASE_STORAGE_ENGINE=1 -CMAKE_INSTALL_PREFIX=/usr/local/mysql -DEXTRA_CHARSETS=all
##PHP
cd /opttar -xvf php-5.6.19.tar.gz -C /usr/srccd /usr/src/php-5.6.19./configure --prefix='./configure' '--prefix=/usr/local/php5' '--host=x86_64-pc-linux-gnu' '--disable-cli' '--enable-cgi' '--enable-fastcgi' '--disable-discard-path' '--disable-force-cgi-redirect' '--without-pear' '--enable-bcmath' '--with-bz2' '--disable-calendar' '--disable-ctype' '--without-curl' '--without-curlwrappers' '--disable-dbase' '--disable-dom' '--disable-exif' '--without-fbsql' '--without-fdftk' '--disable-filter' '--disable-ftp' '--with-gettext' '--without-gmp' '--disable-ipv6' '--disable-json' '--without-kerberos' '--disable-libxml' '--disable-mbstring' '--with-mcrypt=/usr/local/lib' '--without-msql' '--without-mssql' '--with-ncurses' '--with-openssl' '--with-openssl-dir=/usr' '--disable-pcntl' '--disable-pdo' '--without-pgsql' '--without-pspell' '--without-recode' '--disable-simplexml' '--disable-shmop' '--without-snmp' '--disable-soap' '--enable-sockets' '--without-sybase' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--without-tidy' '--disable-tokenizer' '--disable-wddx' '--disable-xml' '--disable-xmlreader' '--disable-xmlwriter' '--without-xmlrpc' '--without-xsl' '--disable-zip' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--disable-flatfile' '--with-gdbm' '--disable-inifile' '--without-qdbm' '--without-freetype-dir' '--without-t1lib' '--disable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--without-xpm-dir' '--with-gd' '--with-mysql=/usr/local/mysql' '--with-readline' '--without-libedit' '--without-mm' '--without-sqlite' '--with-pic' '--with-config-file-path=/usr/local/php5/lib/php.ini' '--enable-pdo' '--with-pdo-mysql=/usr/local/mysql' '--with-curl' '--enable-ctype' '--enable-json' '--enable-filter' '--enable-dom' '--enable-hash' '--with-magickwand' '--with-imap' '--enable-libxml' '--enable-mbstring' '--enable-simplexml' '--with-kerberos' '--with-imap-ssl' '--with-snmp' '--enable-soap' '--enable-xml' '--with-mhash' '--enable-posix' '--enable-cache' '--enable-fpm' && make && make install ||echo "php erroe">>/opt/error.txt安装过程中报错 缺少包 就安装。其中几个重要的报错:
1 configure: error: DBA: Could not find necessary header file(s).解决:yum install gdbm-devel db4-devel2 checking for DB4 major version... configure: error: Header contains different version
解决:Error: configure: error: DBA: Could not find necessary header file(s).Fix: yum install gdbm-devel db4-develconfigure: error: Header contains different versio
编译安装db4cd build_unix../dist/configure --enable-cxxmakemake installlibc-client.a
yum install libc-client-devel.x86_64ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.sotar -zxvf libmcrypt-2.5.8.tar.gz
./configure make && make install 加速插件-----安装php扩展1.cd /opt/php-5.6.19/ext/opcache/ # 切换到php解压包目录/usr/local/php5/bin/phpize #用来扩展php扩展模块./configure --with-php-config=/usr/local/php5/bin/php-config #编译安装make && make install2.安装完成之后,在php.ini里面添加cp php.ini-production /usr/local/php5/etc/php.inivim /usr/local/php5/etc/php.iniextension=opcache.so/etc/init.d/php-fpm start## redis
cd /opttar -xvf redis-2.0.4.tar.gz -C /usr/local/cd /usr/local/redis-2.0.4make && make install || echo "redis error" >>/opt/error.txt 新项目各软件版本。erlang R19.1nginx 1.8.1php-5.6.19mysql 5.6.29jdk-8u45redis-2.0.4安装nagios被监控端 xinetd启动
useradd nagiostar -zxvf nagios-plugins-1.4.15.tar.gztar -zxvf nrpe-2.12.tar.gzyum install perl-devel perl-CPAN openssl-devel -y cd /home/cmge/nagios-plugins-1.4.15./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-gourp=nagios --enable-perl-modules --with-mysql=/usr/local/mysql/ --with-openssl=/usr/local/openssl make make install cd /home/cmge/nrpe-2.12./configure --prefix=/usr/local/nagiosmake allmake install-pluginmake install-daemonmake install-daemon-configmake install-xinetdchown -R nagios:nagios /usr/local/nagios\cp /home/cmge/nrpe.cfg /usr/local/nagios/etc/ \cp /home/cmge/nrpe /etc/xinetd.d/ \cp /home/cmge/snmpd.conf /etc/snmp cd /home/cmge sh yum2.txt yum install xinetd -yecho '# Local services' >> /etc/services echo 'nrpe 5666/tcp #nrpe' >> /etc/servicesyum install dstat iptraf sysstat -yiptables -I INPUT -s 58.215.41.132 -p udp --dport 161 -j ACCEPThttp://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html 安装nagiox
客户端nagios https://blog.csdn.net/jiedushi/article/details/6524375nagios添加被监控的机器 https://blog.csdn.net/u012063703/article/details/46707763服务端,监控客户端,ip配置在/usr/local/nagios/etc/objects/hosts.cfg里面
要监控的服务,目前暂时是给你加在/usr/local/nagios/etc/objects/templates.cfg的末尾,你可以自己调整下位置,比如另外写文件services.cfg,如果修改为其他名称,nagios.cfg对应的需要修改,不然加载不到监控端,安装配置完之后,主要配置文件:/usr/local/nagios/etc/nrpe.cfg 这里面以command开头的,是一些默认的监控服务器,比如磁盘,负载