サーバインフラストラクチャ(Redhat/CentOS)
サーバにシステムをインストールした後、正常な動作を保証するには、日常的な構成が必要です.
基本構成ネットワーク /etc/sysconfig/network-scriptsパスの下でeth 0,eth 1,loなどの を構成する
DNS /etc/resolv.conf nameserver 8.8.8.8
selinuxクローズ /etc/selinux/config(SELINUX=disabled)
システムパラメータ構成 /etc/security/limits.conf /etc/sysctl.conf(カーネルパラメータ) ユーザーおよびユーザー・グループ mysql,www,nagiosなどの必要なユーザーとグループを追加する 変更権限(chattr+i) rsync/sshパスワードなしで にログイン計画タスク ntpdate同期時間を設定ntpdate 202.120.2.101 pool.ntp.org ログスクロール/削除(nginx,phpログ) ファイアウォールオープン nfsマウント 中国語インストールフォント(/usr/share/fonts/chinese) jdk インストール順序は、低バージョンから高バージョン(/usr/java)まで rpmインストールjdk-7 u 9およびjdk-7 u 21 chmod +x jdk-7u9-linux-x64.rpm/jdk-7u21-linux-x64.rpm rpm -ivh jdk-7u9-linux-x64.rpm/jdk-7u21-linux-x64.rpm
インストール依存ライブラリ(phpやnginxなどのインストールに必要) pcre,zlib,openssl,libunwind,curl,freetype,gettext,ImageMagick,jepg,libevent,libmcrypt,libmemcached,libpng,libxml,scws,tokyocabinet,tokyotyrant
openrestyプラグイン追加:google_perftoolsとhttp_stub_status_module コンパイルパラメータ: インストールと構成 nginx/conf
php phpバージョンインストール コンパイルパラメータ: php拡張インストール(*.soファイル) パス:/web/php/lib/php/extensions/no-debug-non-zts-231226 apcu, blite, gd, igbinary, imagick, mcrypt, memcached, memcache, mongo, opcache, qqwry, redis, scws, tokyo_tyrant
プロファイルの変更 /web/php/lib/php.ini /web/php/etc/php-fpm.conf /etc/init.d/php-fpm(関連項目の起動用)
mysqlバイナリ 構成:mysqlユーザー、dataデータディレクトリ、my.cnf等 詳細は公式サイトを参照してください.http://dev.mysql.com/doc/refman/5.5/en/binary-installation.html
導入の監視 nagios インストール:xintd,nagios-plugins,nrpe 構成:/etc/servicesおよび/etc/xinetd.d/nrpe モニタ項目:/web/nagios/etc/nrpe.cfg 追加プラグイン:/web/nagios/libexecの下に監視スクリプト(mysql主従、nginxとphp接続数など) を追加
cacti インストール:snmp 構成:/etc/snmp/snmpd.conf
キャッシュ memcached redis twemproxy(エージェント) キュー UCmq
基本構成
インストール依存ライブラリ(phpやnginxなどのインストールに必要)
openresty
./configure --prefix=/web/openresty --user=www --group=www --with-luajit --without-http_redis2_module --with-http_postgres_module --with-http_iconv_module --with-google_perftools_module --with-pcre=/root/web/nginx/pcre-8.36 --with-pcre-jit --with-zlib=/root/web/nginx/zlib-1.2.8 --add-module=../ngx_cache_purge-2.3 --with-http_stub_status_module
php
./configure --prefix=/web/php --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-jpeg-dir=/web/jpeg6 --with-png-dir=/web/libpng2 --with-freetype-dir=/web/freetype2 --with-zlib-dir=/web/zlib --disable-ipv6 --enable-sockets --disable-debug --with-config-file-path=/web/php/lib --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-sysvmsg --enable-sysvshm --enable-mbregex --enable-mbstring --with-bz2=/usr --with-libxml-dir=/web/libxml2 --with-curl=/web/curl --enable-gd-native-ttf --with-openssl --with-mhash --with-xmlrpc --enable-zip --enable-soap --without-pear --enable-fpm --with-libdir=lib64
mysql
導入の監視
キャッシュ