debian安装nginx+php(spawn-fcgi)+mysql

10

前天购买了linode最低的那款VPS,一直用的都是CentOS系统,所以这次就试了试debian ,毕竟国外debian使用率占了半壁江山

linode的控制面板很好用,很方便,一下就安装debian 5.0 ,下载是昨天安装nginx+php(spawn-fcgi)+mysql 的记录

首先是添加源地址,目的只有一个,我要安装最新版的软件,debian默认的软件版本低啊

vi /etc/apt/sources.list
deb http://packages.dotdeb.org lenny all

接着,当然是更新一下系统啦.
apt-get update

下面是安装mysql5.1,安装过程会需要你输入root密码的

apt-get install mysql-server-5.1
/etc/init.d/mysql restart
/etc/init.d/mysql stop

接着是PHP5,自己选择需要安装的扩展吧

apt-get install php5-common php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-apc

安装nginx,代码如果下

apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev build-essential
wget http://sysoev.ru/nginx/nginx-0.7.64.tar.gz
tar zxvf nginx-0.7.64.tar.gz
cd nginx-0.7.64/
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_ssl_module
make
make install
cd ../

最后安装spawn-fcgi,用来启动PHP的

wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz
tar -zxf spawn-fcgi-1.6.3.tar.gz
cd spawn-fcgi-1.6.3
./configure --bindir=/usr/bin --libdir=/usr/lib --prefix=/etc
make&&make install

启动方法是

/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 8 -u www -g www -f "/usr/bin/php5-cgi -d /var/www"
/usr/local/nginx/sbin/nginx

这只是一篇简单的记录日志,没有给出配置文件,配置文件用一键包的就OK,另外,我还没弄好开机启动 php 和 nginx 的脚本,所以每次都要手动运行.

暧味日志

10 Responses

  1. LAONB says:

    我也喜欢DEB,我选择更直接的apt-get install.....
    上次配置mysql用户费了不少力气。

  2. Showfom says:

    猫猫来看看你~

  3. Showfom says:

    又换模板了 还不更新。。。

  4. ゞ猫 says:

    @Showfom 好吧,我就更新一篇吧...

  5. messfeel says:

    学习了!现在刚下载了linux,一周左右的时间要搬迁到linode,现在刚刚安装并简单了解了桌面版,据说服务器上是无桌面版的。。。恐怕我是要多学一段了

  6. 菜鸟 says:

    cd spawn-fcgi-1.6.3
    ./configure --bindir=/usr/bin --libdir=/usr/lib --prefix=/etc
    make&&make install

    我咋make&&make insall 不了阿。
    localhost:~/spawn-fcgi-1.6.3# make&&make install
    -bash: make: command not found

Leave a Reply

© 2007-2010 猫言猫语. All rights reserved. Powered by WordPress. 16 queries in 0.120 seconds.
Proudly designed by Theme Junkie.