lnmp安裝及nagios

來源:互聯網
上載者:User

標籤:for   bcmath   nagios   mha   tar -xvf   udp   fpm   其他   bst   

##nginx
cd /opt
tar  -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


#mysql
cd /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 /opt
tar -xvf php-5.6.19.tar.gz -C /usr/src
cd /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-devel

2 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-devel

configure: error: Header contains different versio
編譯安裝db4
cd build_unix
../dist/configure --enable-cxx
make
make install

libc-client.a
 yum install libc-client-devel.x86_64
ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so

tar -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 install
2.安裝完成之後,在php.ini裡面添加
cp php.ini-production /usr/local/php5/etc/php.ini
vim /usr/local/php5/etc/php.ini
extension=opcache.so
/etc/init.d/php-fpm start

## redis
cd /opt
tar -xvf redis-2.0.4.tar.gz  -C /usr/local/
cd /usr/local/redis-2.0.4
make && make install || echo "redis error" >>/opt/error.txt


新項目各軟體版本。
erlang R19.1
nginx 1.8.1
php-5.6.19
mysql 5.6.29
jdk-8u45
redis-2.0.4

安裝nagios被監控端  xinetd啟動
useradd nagios
tar -zxvf nagios-plugins-1.4.15.tar.gz
tar -zxvf nrpe-2.12.tar.gz
yum 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/nagios
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
chown -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 -y
echo ‘# Local services‘ >> /etc/services
echo ‘nrpe            5666/tcp                #nrpe‘ >> /etc/services
yum install dstat iptraf sysstat -y
iptables -I INPUT  -s 58.215.41.132 -p udp  --dport  161 -j ACCEPT

http://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html 安裝nagiox
用戶端nagios   6524375
nagios添加被監控的機器  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開頭的,是一些預設的監控伺服器,比如磁碟,負載

 

lnmp安裝及nagios

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.