2010/05/23 | Written by
rust | under
Blog
どうやらDTIのVPSではvm.memory.size[free]とかは使えないらしい。実際には使えないのではなくて、ホストの方のメモリが出てくるようなので、計測には使えないと言うこと。で、どうすればいいのかというと、/proc/meminfoの値を使う。具体的にはこんな感じ。
1 2
| $ grep 'MemFree' /proc/meminfo | sed -e 's/^[^:]\+:[^0-9]\+\([0-9]\+\)[^0-9]\+$/\1/g'
363892 |
んで、この値はkBなので適宜どこかで補正してやればいい。大まかで良ければ1000倍するなど。
Tags:
VPS,
Zabbix,
監視
2010/04/29 | Written by
rust | under
Blog
Standardプランの契約ができたので、早速設定。
- /etc/ssh/sshd_config
1 2 3
| Port xxxxx # ポート番号変更
PasswordAuthentication no # パスワードログインの禁止
PermitRootLogin no # rootログインの禁止 |
- 必要なパッケージの導入
1 2 3 4 5 6 7 8 9 10
| $ sudo su -
# yum update
# yum install zsh lv
# chsh -s /bin/zsh
# useradd hoge
# passwd hoge
# su - hoge
$ chsh -s /bin/zsh
$ exit
# visudo |
- 公開鍵の登録とsshサーバの再起動、確認
- パッケージのインストールと設定
1 2
| % sudo yum install mysql-server php-mysql
% sudo vim /etc/httpd/conf/httpd.conf |
- iptablesの設定
- PHPのインストール
1 2 3 4
| $ sudo yum install php-pear-Net-Socket php-pear php-common php-gd php-devel php php-mbstring php-pear-Mail php-cli php-imap php-snmp php-pdo php-xml php-pear-Auth-SASL php-ldap php-pear-Net-SMTP php-mysql
$ sudo vim /var/www/html/index.php
$ sudo /sbin/service httpd restart
$ sudo rm /var/www/html/index.php |
- nginxのインストール
1 2 3 4 5
| $ sudo /sbin/service httpd stop
$ sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-3.noarch.rpm
$ sudo yum install nginx
$ sudo chkconfig httpd off
$ sudo chkconfig nginx on |
と、ここまで設定して面倒になったので続きは後日。
Tags:
CentOS,
Linux,
VPS