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

前天购买了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 Comments

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

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

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

    1. @messfeel 命令就可以了.很简单的,linode用的一键包安装就可以了..debian和CentOS没什么都分别的.倒是我用惯了CentOS,对debian不太熟悉

      1. @ゞ猫
        那我也跟着学centos 据说Kloxo只支持centos 国内centos用户也挺多
        再问一个特别弱的问题 vps商家的vps装过系统后就是直接可以联网的吧
        咱远程或ssh连接后 就可以直接输入命令 下载包了吧 这问题问的真有水准 – -#

  4. 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

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

猫言猫语 © 2007-2014 Frontier Theme