2013年9月8日日曜日

AmazonLinuxにzabbix 2.0をRPMで入れてみた

公式サイトからリポジトリを入れてyumでやろうとしたら、コンフリクトしてインストールが進まなかった

で、src.rpmを持ってきてビルド!
# yum install rpm-build
# rpm -ivh zabbix-2.0.8-1.el5.src.rpm
# cd /root/rpmbuild/SOURCE
# cp * /usr/src/rpm/SOURCE/
# rpmbuild -ba /root/rpmbuild/SPEC/zabbix.spec
コンパイラーがインストールされてないエラーが出たので、インストール
# yum groupinstall "Development Libraries" "Development tools"

# rpmbuild -ba /root/rpmbuild/SPEC/zabbix.spec
依存関係がたくさん出てくるから、それらを全部yumでインストール

# rpmbuild -ba /root/rpmbuild/SPEC/zabbix.spec

出来上がったRPMをインストール
# cd /usr/src/rpm/RPMS/x86_64/
# rpm -ivh zabbix-server-mysql-2.0.8-1.amzn1.x86_64.rpm zabbix-agent-2.0.8-1.amzn1.x86_64.rpm zabbix-web-mysql-2.0.8-1.amzn1.x86_64.rpm zabbix-2.0.8-1.amzn1.x86_64.rpm  zabbix-web-2.0.8-1.amzn1.x86_64.rpm zabbix-server-2.0.8-1.amzn1.x86_64.rpm

依存関係の問題が出てくるので、それらを全部yumでインストール
# yum install php-mysql php-bcmath php-gd php-mbstring php-xml fping php

php.iniのdate.timezoneを修正
date.timezone = Asia/Tokyo

# service mysqld start
# service httpd start

# mysql
mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> flush privileges;
mysql> quit;

# cd /usr/share/doc/zabbix-server-mysql-2.0.8/create/
# mysql zabbix < schema.sql
# mysql zabbix < images.sql
# mysql zabbix < data.sql
# vi /etc/zabbix/zabbix_server.conf
  DBHost=localhost
  DBName=zabbix
  DBUser=zabbix
  DBPassword=zabbix

# service zabbix-agent start
# service zabbix-server start

# chkconfig mysqld on
# chkconfig httpd on
# chkconfig zabbix-agent on
# chkconfig zabbix-server on

2013年8月25日日曜日

AWSでメールサーバ

注意点
EIPがSPAMのブラックリストに登録されてないことを確認したほうがいい
確認するのは、以下のURLが便利
http://www.blacklistalert.org/

そして、逆引きの設定もしっかりやっておかないと拒否されるかもしれない
逆引きの設定依頼は
https://portal.aws.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request

2013年8月22日木曜日

mailmanのnewlist

mailmanでnewlistコマンドを使うと、ML管理者宛にメールが飛ぶ
飛ばしたくなければ、-qを付けると飛ばない

けど、pleskを使うと、内部で勝手にnewlistコマンドを使ってしまい、そして-qオプションが付いていないのでメールが飛ぶ
飛ばしたくなければ・・・

vi newlist
quiet = 0 を quiet = 1に書き換えちゃう!

2013年8月19日月曜日

AWSにswap

たまにAMIからインスタンスを作るとswap領域が無い

EBSをswap領域にした

fdisk /dev/xvdf

mkswap /dev/xvdf1

vi /etc/fstab

swapon -a

再起動しても問題無し

2013年8月16日金曜日

BINDのデフォルト設定

allow-query-cache
デフォルト { localnets; localhost; };


設定されていなければ、allow-query-cacheの設定が適用され、
allow-query-cacheが設定されていなければ、allow-queryの設定が適用され、
allow-queryも設定されていなければ、デフォルト値が適用される。

2013年8月15日木曜日

rsyncの罠

いまさら書くほどのことじゃないけど・・・ミスらないようにいつも調べてしまうこと

 ①rsync -av ~/dir1  /dir2
 ②rsync -av ~/dir1/ /dri2

この2つは動作が異なる

①は、dir1をdri2の下に作られる
②は、dir1以下のファイルをdir2の下に作る

dir1以下にfile1があるとすると
①は、/dir2/dir1/file1
②は、/dir2/file1

--deleteがついてると、大変なことになっちゃう

2013年8月9日金曜日

CentOS6.2でPHP5.1.6

configureに失敗しまくる!
オプションは以下のとおり

'./configure' \
'--prefix=/usr/local' \
'--sysconfdir=/usr/local/etc' \
'--with-config-file-path=/usr/local/etc' \
'--with-config-file-scan-dir=/usr/local/etc/php.d' \
'--disable-debug' \
'--with-pic' \
'--disable-rpath' \
'--without-pear' \
'--with-bz2' \
'--with-curl' \
'--with-freetype-dir=/usr' \
'--with-png-dir=/usr' \
'--enable-gd-native-ttf' \
'--without-gdbm' \
'--with-gettext' \
'--with-gmp' \
'--with-iconv' \
'--with-jpeg-dir=/usr' \
'--with-openssl' \
'--with-png' \
'--with-pspell' \
'--with-expat-dir=/usr' \
'--with-pcre-regex=/usr' \
'--with-zlib' \
'--with-layout=GNU' \
'--enable-exif' \
'--enable-ftp' \
'--enable-magic-quotes' \
'--enable-sockets' \
'--enable-sysvsem' \
'--enable-sysvshm' \
'--enable-sysvmsg' \
'--enable-track-vars' \
'--enable-trans-sid' \
'--enable-yp' \
'--enable-wddx' \
'--with-kerberos' \
'--enable-ucd-snmp-hack' \
'--with-unixODBC=shared,/usr' \
'--enable-memory-limit' \
'--enable-shmop' \
'--enable-calendar' \
'--enable-dbx' \
'--enable-dio' \
'--with-mime-magic=/usr/share/misc/magic.mgc' \
'--without-sqlite' \
'--with-libxml-dir=/usr' \
'--with-xml' \
'--with-system-tzdata' \
'--with-mysql' \
'--with-pgsql' \
'--with-sqlite' \
'--with-gd' \
'--without-odbc' \
'--enable-dom' \
'--disable-dba' \
'--without-unixODBC' \
'--enable-pdo' \
'--enable-xmlreader' \
'--enable-xmlwriter' \
'--with-pdo-sqlite' \
'--enable-mbstring' \
'--with-xsl' \
'--with-pdo-pgsql' \
'--with-pdo-mysql' \
'--with-mysqli' \
'--with-kerberos' \
'--enable-dbase'