linux監控平台nagios的使用(一)lamp環境

來源:互聯網
上載者:User

環境OS:centos 5.8 x86_64

這次指令碼比上篇有些許修改,指令碼如下

#mkdir /etc/yum.repos.d/backup     #mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/     #mv /tmp/lamp/ftp.repo /etc/yum.repos.d/     #yum clean all     #yum makecache     path=`pwd`     yum -y install gcc gcc-c++ screen autoconf automake libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel pcre pcre-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libtiff libtiff-devel gettext gettext-devel pam pam-devel fontconfig-devel libXpm-devel libtool php-common     cd $path     tar -zxvf httpd-2.2.9.tar.gz     cd $path/httpd-2.2.9     ./configure --prefix=/usr/local/apache2/ --sysconfdir=/etc/httpd/ --with-included-apr --disable-userdir --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support     make     make install     mv $path/httpd /etc/rc.d/init.d/httpd     chmod +x /etc/rc.d/init.d/httpd     chkconfig --add httpd     chkconfig httpd on     service httpd start     #install mysql-server     groupadd mysql     useradd -g mysql mysql     mkdir -p /data/mysql/var     cd $path     tar -zxvf Percona-Server-5.1.58.tar.gz     cd $path/Percona-Server-5.1.58     ./configure --prefix=/usr/local/mysql/ --localstatedir=/data/mysql/var --with-extra-charsets=utf8,gbk --with-pthread --enable-thread-safe-client --with-ssl --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-plugins=partition,innobase,csv,myisam,innodb_plugin --enable-shared --enable-assembler     make && make install     cp support-files/my-medium.cnf /etc/my.cnf     cp support-files/mysql.server /etc/init.d/mysqld     chmod +x /etc/init.d/mysqld     ln -s /usr/local/mysql/bin/* /usr/local/bin/     ln -s /usr/local/mysql/lib/mysql/lib* /usr/lib/     /usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/data/mysql/var --user=mysql &     chown -R root.mysql /usr/local/mysql/     #chown -R mysql.mysql /usr/local/mysql/var/     chown -R mysql.mysql /data/mysql/     sed -i '38a\basedir = /usr/local/mysql/ \' /etc/my.cnf     sed -i '39a\datadir = /data/mysql/var/ \' /etc/my.cnf     service mysqld start     #install php     cd $path     tar -zxvf libmcrypt-2.5.8.tar.gz     cd $path/libmcrypt-2.5.8/     ./configure --prefix=/usr/local/libmcrypt/     make     make install     cd $path/libmcrypt-2.5.8/libltdl     ./configure --enable-ltdl-install     make     make install     cd $path     tar -zxvf libiconv-1.13.1.tar.gz     cd $path/libiconv-1.13.1     ./configure --prefix=/usr/local/     make     make install     ln -s /usr/local/lib/libmcrypt* /usr/lib     ln -s /usr/local/lib/libiconv.* /usr/lib     ln -s /usr/local/lib/libiconv.* /usr/lib64/     yum -y install libxml2-devel curl-devel libpng-devel openldap-devel     cd $path     tar -zxvf php-5.2.6.tar.gz     cd $path/php-5.2.6     ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-gd --with-zlib-dir --with-mcrypt=/usr/local/libmcrypt --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets     make ZEND_EXTRA_LIBS='-liconv' make install     ln -s /usr/local/php/bin/php /usr/bin/     cp php.ini-dist /usr/local/php/etc/php.ini     sed -i '170 s/DirectoryIndex/ DirectoryIndex index.php/' /etc/httpd/httpd.conf     sed -i '312a\    AddType application/x-httpd-php .php .phtml \' /etc/httpd/httpd.conf     cd $path     tar -zxvf PDO_MYSQL-1.0.2.tgz     cd PDO_MYSQL-1.0.2     /usr/local/php/bin/phpize     ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql     make && make install     sed -i '486 s/extension_dir/ ;extension_dir/' /usr/local/php/etc/php.ini     sed -i '597a extension = "pdo_mysql.so" ' /usr/local/php/etc/php.ini     sed -i 's#;date.timezone.*#date.timezone = "Shanghai/Asia"# '/usr/local/php/etc/php.ini     cp $path/index.php /usr/local/apache2/htdocs/index.php     #/usr/local/apache2/bin/apachectl restart     service httpd restart     service mysqld restart

想單獨下載lamp安裝包,地址如下:

http://down.51cto.com/data/596769  免豆下載

補充一下:yum源請事先先設定好,直接解壓完,執行./install-all.sh就可以了

apache安裝目錄:/usr/local/apache2

php:/usr/local/php

mysql:/usr/lcoal/mysql

本文出自 “TNT、營運之路” 部落格,請務必保留此出處http://tntdba.blog.51cto.com/1199791/1056153

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.