Linux

  • 参考文章

    https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-14-04

    http://ubuntuhandbook.org/index.php/2014/04/install-nginx-with-php5-mysql-lemp-in-ubuntu-14-04-server/

    http://www.unixmen.com/install-lemp-server-nginx-mysql-mariadb-php-phpmyadmin-u

  • Should work on RHEL, Fedora, CentOS. Tested on CentOS 5.

    /etc/init.d/nginx

    #!/bin/sh
    #
    # nginx - this script starts and stops the nginx daemon
    #
    # chkconfig:   - 85 15 
    # description:  Nginx is an HTTP(S) server, HTTP(S) reverse \
    #               proxy and IMAP/POP3 proxy server
    # processname: nginx
  • linux查看httpd进程数

    ps -ef | grep httpd | wc -l

    查看Apache的并发请求数及其TCP连接状态

    netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

    (这条语句是从新浪互动社区事业部技术总监王老大那儿获得的,非常不错)

    返回结果示例:

    LAST_ACK 5
    SYN_RECV 30
    ESTABLISHED 1597
    FIN_WAIT1 51
    FIN_WAIT2 504
    TIME_WAIT 1057

    其中的SYN_RECV表示正在等待处理的请求数;ESTABLISHED表示正





    • 缺少 libXtst.so.6
    Caused by: java.lang.UnsatisfiedLinkError: /opt/jdk1.7/jre/lib/amd64/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory

    安装 libxtst6

    $ sudo apt-get update
    $ sudo apt-get install libxtst6

    http://stackoverflow.com/questions/17355863/cant-find-inst

  • Linux统计文件行数 字节数 单词个数

    wc - lcw file1 file2

    输出结果

    4 33 file1
    7 52 file2
    11 11 85 total
    

    该命令各选项含义如下:

    - c 统计字节数。
    - l 统计行数。
    - w 统计字数。