NMP on debian (apt-get 方式)

#编译的软件,这个看自己的情况 ,如果要源码编译一下东西 ,那就一定要安装了
apt-get install automake wget zip unzip make time
#+——————————————————-+
#| !!! START NMP !!! |
#+——————————————————-+
首先添加 mysql php等第三方源,因为 debain 6 官方源没有 php-fpm
#vi /etc/apt/sources.list
echo "deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all
#deb http://mirror.us.leaseweb.net/dotdeb/ stable all
#deb-src http://mirror.us.leaseweb.net/dotdeb/ stable all " >> /etc/apt/sources.list

wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | apt-key add -
rm dotdeb.gpg

apt-get update
#+——————————————————-+
#| 1, !!! Install mysql !!! |
#+——————————————————-+
apt-get install -y mysql-server mysql-client
#在弹出的页面输入2次密码
#修改mysql配置文件,去掉innodb,这样可以节省不少内存
vi /etc/mysql/my.cnf
#增加下面语句 好像 加了启动不了哦
skip-innodb
#+——————————————————-+
#| 2, !!! Instal nginx !!! |
#+——————————————————-+
# nginx http://wiki.nginx.org/Install #添加 nginx 官方的源
echo "deb http://nginx.org/packages/debian/ squeeze nginx
deb-src http://nginx.org/packages/debian/ squeeze nginx " >> /etc/apt/sources.list
apt-get update
apt-get install --force-yes -y nginx

#apt-get install -y nginx
#include /etc/nginx/conf.d/*.conf;
# /usr/share/nginx/html
vi /etc/nginx/fastcgi_params
在 fastcgi_param SCRIPT_NAME $fastcgi_script_name;
前添加
#这个一定要加,不然没有PHP解析不了
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
####新建一个
vi /etc/nginx/conf.d/1.conf
server {
listen 80;
server_name 192.168.22.131 ;
charset utf-8;
access_log off;
root /data/www/;
index index.php index.htm index.html;
location ~ .*.(gif|jpg|jpeg|png|bmp|ico|swf|html|htm|mp3|wma|js|css)$ {
expires 7d;
}
location ~ .*.php?$ {
# include /data/apps/nginx/conf/fcgi.conf;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
location /NginxStatus {
stub_status on;
access_log off;
auth_basic "NginxStatus";
auth_basic_user_file /data/apps/nginx/conf/htpasswd;
}
# location / {
# root /data/www/html_s1;
# index index.php index.html index.htm;
# }
error_page 404 /error/404.php;
}

#####
#/etc/nginx/nginx.conf
#NGINX 配置看 这个
http://imcn.me/html/y2012/11870.html
#+——————————————————-+
#| 3, !!! Instal php !!! |
#+——————————————————-+
apt-get install -y php5-cgi php5-mysql php5-gd php5-imagick php5-mcrypt php5-memcache memcached php5-fpm php5-cli #nginx
#压力测试
apt-get install exuberant-ctags
wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz
tar zxvf webbench-1.5.tar.gz && cd webbench-1.5
make && make install

### 问题的解决
[general-l] /bin/sh: line 1: ctags: command not found {02}
apt-get install exuberant-ctags
报403 一般 是没权限,不爽就直接上 777
下面这个是内存 100M debian 的压力测试
[email protected]:~/webbench-1.5# webbench -c 50 -t 60 http://192.168.22.126/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.22.126/
50 clients, running 60 sec.
Speed=0 pages/min, 0 bytes/sec.
Requests: 0 susceed, 0 failed.
参考 http://fak3r.com/2011/09/27/howto-install-php5-fpm-on-debian-squeeze/