由于ecvps提供的VPS系统中没有debian 6.0 ,只能选择使用5.0或4.0的版本,没法只好安装5.0的debian,以下为安装步骤
一. 检查系统环境
1. netstat -ntlp 查看系统中运行哪些网络服务,不需要用的都可以关掉,比如exim4(邮件服务程序), aptitude purge exim4-base exim4-config exim4-daemon-light .
2. 安装编译环境,debian 5系统发行版默认没有安装gcc等工具。需安装一下
aptitude install build-essential
二. 编译安装相关组件
1.安装zlib,openssl等组件
wget http://bbs.oslet.net/software/webserver/zlib125.zip
unzip -x zlib125.zip
cd zlib-1.2.5
./configure --prefix=/usr
make && make install
wget http://bbs.oslet.net/software/webserver/openssl-0.9.8r.tar.gz
tar zxvf openssl-0.9.8r.tar.gz
cd openssl-0.9.8r
make && make install
2.安装 nginx
wget http://bbs.oslet.net/software/webserver/nginx-1.0.5.tar.gz
wget http://bbs.oslet.net/software/webserver/pcre-8.13.tar.gz
tar zxvf pcre-8.13.tar.gz
tar zxvf nginx-1.0.5.tar.gz
cd nginx-1.0.5
./configure --prefix=/usr/local/nginx --sbin-path=/usr/sbin --with-http_ssl_module --with-http_sub_module --with-http_flv_module --with-http_stub_status_module --with-zlib=../zlib-1.2.5 --with-openssl=../openssl-0.9.8r --with-pcre=../pcre-8.13make && make install
配置开机启动
wget http://bbs.oslet.net/software/webserver/nginx.txt
cp nginx.txt /etc/init.d/nginx
chmod + x /etc/init.d/nginx
chkconfig nginx on
3.安装 mysql ,安装mysql-5.5.15需安装cmake ,
wget http://bbs.oslet.net/software/webserver/cmake-2.8.5.tar.gz
wget http://bbs.oslet.net/software/webserver/mysql-5.5.15.tar.gz
tar zxvf cmake-2.8.5.tar.gz
cd cmake-2.8.5
./bootstrap
make
make install
在安装最后一步时可能会出错,解决办法是指定安装位置make install DESTDIR=/usr/local.
4.安装php
编译gd库,这个在搭建discuz论坛时需用到
(1)安装libpng
wget http://bbs.oslet.net/software/webserver/libpng-1.5.4.tar.gz
tar zxvf libpng-1.5.4.tar.gz
cd libpng-1.5.4
./configure
make
make install
(2)安装freetype
wget http://bbs.oslet.net/software/webserver/freetype-2.4.6.tar.gz
tar zxvf freetype-2.4.6.tar.gz
cd freetype-2.4.6
./configure --prefix=/usr/local/freetype
make
make install
(3)安装jpeg
wget http://bbs.oslet.net/software/webserver/jpegsrc.v8c.tar.gz
tar zxvf jpegsrc.v8c-tar.gz
cd jpeg-8c
./configure --prefix=/usr/local/jpeg
make
make install
(4) 安装libxml2
wget http://bbs.oslet.net/software/we ... ources-2.7.8.tar.gz
tar zxvf libxml2-2.7.8.tar.gz
cd libxml2-2.7.8
./configure --prefix=/usr/local/libxml2
make
make install
(5)安装GD
wget http://bbs.oslet.net/software/we ... gd-GD_2_0_33.tar.gz
tar zxvf pierrejoye-gd-libgd-GD_2_0_33.tar.gz
cd pierrejoye-gd-libgd-GD_2_0_33
./configure --prefix=/usr/local/gd --with-png=/usr/local --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/jpeg
make
make install
1.memcached需用到libevent这个库
wget http://bbs.oslet.net/software/we ... .0.12-stable.tar.gz
tar zxvf libevent-2.0.12-stable.tar.gz
cd libevent-2.0.12-stable
./confiugre --prefix=/usr
make && make install
2.安装memcached
wget http://bbs.oslet.net/software/webserver/memcached-1.4.6.tar.gz
tar zxvf memcached-1.4.6.tar.gz
cd memcached-1.4.6
./configure --with-libevent=/usr
make && make install
在make install这步时出错了,竟不能安装,查看了错误原因,原来是/usr/local/man目录中已存在一个man1,于是改名man2,再次make install成功.
3.安装 php memcache扩展
wget http://bbs.oslet.net/software/webserver/memcache-3.0.6.tgz
tar xvf memcache-3.0.6.tgz
cd memcache-3.0.6
/usr/local/php/bin/phpize
./configure --enable-memcache --with-php-conf=/usr/local/php/bin/php-config --with-zlib-dir=/usr
make
make test
make install
安装完成后,提示
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626