首先参考这篇文章http://blog.s135.com/nginx_php_v5/
选择一个比较好的source.list,网易(缺少libpng),速度快
deb http://mirrors.163.com/ubuntu/ jaunty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jaunty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jaunty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ jaunty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ jaunty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ jaunty-backports main restricted universe multiverse
lupaworld,更全,但是国外速度比较慢
deb http://mirror.lupaworld.com/ubuntu/archive/ jaunty main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu/archive/ jaunty main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ jaunty-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu/archive/ jaunty-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ jaunty-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu/archive/ jaunty-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ jaunty-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu/archive/ jaunty-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ jaunty-proposed main multiverse restricted universe
deb-src http://mirror.lupaworld.com/ubuntu/archive/ jaunty-proposed main restricted universe multiverse
国外,全(MYSQL-SERVER损坏)
# deb cdrom:[Ubuntu 8.04 _Hardy Heron_ - Release amd64 (20080423)]/ hardy main restricted
deb-src http://archive.ubuntu.com/ubuntu/ hardy main restricted #Added by software-properties
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ca.archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://ca.archive.ubuntu.com/ubuntu/ hardy restricted main multiverse universe #Added by software-properties
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ca.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
deb-src http://ca.archive.ubuntu.com/ubuntu/ hardy-updates restricted main multiverse universe #Added by software-properties
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://ca.archive.ubuntu.com/ubuntu/ hardy universe
deb http://ca.archive.ubuntu.com/ubuntu/ hardy-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ca.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
deb http://archive.canonical.com/ubuntu hardy partner
deb-src http://archive.canonical.com/ubuntu hardy partner
deb http://security.ubuntu.com/ubuntu hardy-security main restricted
deb-src http://security.ubuntu.com/ubuntu hardy-security restricted main multiverse universe #Added by software-properties
deb http://security.ubuntu.com/ubuntu hardy-security universe
deb http://security.ubuntu.com/ubuntu hardy-security multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ hardy-proposed restricted main multiverse universe
deb http://ca.archive.ubuntu.com/ubuntu/ hardy-backports restricted main multiverse universe
更新
apt-get update
apt-get upgrade
安装启动管理工具
apt-get install rcconf
GCC和make,用于编译
apt-get install gcc g++ make patch autoconf
xml2-config not found. Please check your libxml2 installation
解决方法:apt-get install libxml2 libxml2-dev
Couldn't find package openssl-dev
解决方法:apt-get install libcurl3-openssl-dev
libpng.(a|so) not found
解决方法:apt-get install libpng-dev
libjpeg.(a|so) not found
解决方法:apt-get install libjpeg-dev
configure: error: Cannot find MySQL header files under /usr/local/src/php-4.3.7/ext/mysql/libmysql.
Note that the MySQL client library is not bundled anymore."
解决方法:apt-get install libmysqlclient16 libmysqlclient15-dev
freetype.h: No such file or directory
apt-get install libfreetype6-dev
./configure 后,出现 “checking for termcap functions library… configure: error: No curses/termcap library found”错误,发现是没有安装curses/termcap库,
#apt-get install libncurses5-dev
mark:可以上http://packages.ubunut.com/搜索相应package
最后显示
Installing PHP SAPI module: cgi
Installing PHP CGI binary: /usr/local/webserver/php/bin/
Installing FPM config: /usr/local/webserver/php/etc/php-fpm.conf
(installing as php-fpm.conf.default)
Installing init.d script: /usr/local/webserver/php/sbin/php-fpm
Installing PHP CLI binary: /usr/local/webserver/php/bin/
Installing PHP CLI man page: /usr/local/webserver/php/man/man1/
Installing build environment: /usr/local/webserver/php/lib/php/build/
Installing header files: /usr/local/webserver/php/include/php/
Installing helper programs: /usr/local/webserver/php/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/webserver/php/man/man1/
page: phpize.1
page: php-config.1
Installing PDO headers: /usr/local/webserver/php/include/php/ext/pdo/
nginx
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1 library is not used
+ using system zlib library
nginx path prefix: "/usr/local/webserver/nginx"
nginx binary file: "/usr/local/webserver/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/webserver/nginx/conf"
nginx configuration file: "/usr/local/webserver/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/webserver/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/webserver/nginx/logs/error.log"
nginx http access log file: "/usr/local/webserver/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
crontab的安装
sudo apt-get install cron
/usr/local/dimdim/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
解决方法:
ln -s /usr/lib/libpcre.so.3 /usr/lib/libpcre.so.0
apt-get 安装、删除后不能再次安装,执行如下命令aptitude purge 包名
如果VPS内存为128M的,还可以参照这篇文章来优化http://blog.s135.com/post/375/