レコードFreeBSD

2893 ワード

./configure -prefix=/usr/local/php -with-config-file-path=/usr/local/php/etc -with-mysql=mysqlnd -with-mysqli=mysqlnd -with-iconv-dir=/usr/local/bin -with-freetype-dir=/usr/local/freetype --with-jpeg-dir=/usr/local/jpeg -with-png-dir=/usr/local/libpng -with-zlib -with-libxml-dir=/usr/local/libxml -enable-xml -disable-rpath -enable-discard-path -enable-safe-mode -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -with-curl -with-curlwrappers -enable-mbregex -enable-fastcgi -enable-fpm -enable-force-cgi-redirect -enable-mbstring -enable-mcrypt --with-mcrypt=/usr/local/libmcrypt -with-gd=/usr/local/gd -enable-gd-native-ttf -with-openssl -with-mhash -enable-pcntl -enable-sockets -enable-soap -with-xmlrpc -enable-zip -disable-ipv6 -without-pear -with-iconv=/usr/local/libiconv

make ZEND_EXTRA_LIBS='-liconv' 

shutdown -h now halt
shutdown -h now reboot
/usr/local/bin/memcached -d -m 10  -u root -l 127.0.0.1 -p 11211 -c 256 -P/tmp/memcached.pid 
kill `cat/tmp/memcached.pid`
dmesg 
freebsdシステムステータス表示
システムのステータスを次の方法で確認します.
   1. Top
   2. netstat -m
   3. pstat -T
   4. systat -if 1
   5. q
 kill -HUP 1
/etc/rc.d/sshd restart
tail/var/log/messages
portsnap fetch extract初回更新時用
portsnap fetch update以降の更新時に使用
FETCH_CMD=axel
FETCH_BEFORE_ARGS= -n 10 -a
FETCH_AFTER_ARGS=
DISABLE_SIZE=yes
netstat -n | awk '/^tcp/{++state[$NF]} END {for(key in state) print key,"\t",state[key]}'
netstat -nat|grep -i "80"|wc -l
サーバの統計:
1)統計80ポート接続数
netstat -nat|grep -i "80"|wc -l
1
2)httpdプロトコル接続数の統計
ps -ef|grep nginx|wc -l
ps -ef|grep php-fcgi|wc -l
1
3)、統計が接続されている、状態が「established」である
netstat -na|grep ESTABLISHED|wc -l
2
4)、どのIPアドレスが最も接続するかを調べ、それを封印する.
netstat -na|grep ESTABLISHED|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r +0n 
netstat -na|grep FIN_WAIT_1|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r +0n
netstat -na|awk '{print $5}'| sort | uniq -c | sort -r | awk -F' ' '{if ($1 > 50) print $2}'
Netstat TCP接続状況をすばやく確認
netstat -n | awk '/^tcp/{++S[$NF]} END {for(a in S) print a, S[a]}'
SYN_RCVDの意味はman netstatで理解できます.SYN_RCVDは現在完了していないTCP SYNキューを表します
コマンド:
  # netstat -an | grep SYN | wc -l
$netstat -an | grep SYN_RECV | wc
97     582    7857
$netstat -an | grep 80 | wc
916    5500   74164
SERVERNAME=portsnap.hshh.org
[root@bsd01 ~]# portsnap fetch
[root@bsd01 ~]# portsnap extract
[root@bsd01 ~]# portsnap fetch extract
[root@bsd01 ~]# portsnap fetch
[root@bsd01 ~]# portsnap update
[root@bsd01 ~]# portsnap fetch update