配置基本环境:
vi /etc/profile, 添加alias ll='ls -al'; source /etc/profile
mkdir -p /home/download
mkdir -p /home/server
mkdir -p /home/workspace
1. 安装Nginx
cd /home/download;
wget http://nginx.org/download/nginx-1.0.5.tar.gz
tar zxvf nginx-1.0.5.tar.gz;
cd /home/download/nginx-1.0.5;
./configure --prefix=/home/server/nginx-1.0.5;
make;
make install;
ln -s /home/server/nginx-1.0.5/ /home/nginx
cd /home/nginx;
vi /etc/profile, 添加alias ngx='/home/nginx/sbin/nginx', source /etc/profile
此时即可使用ngx -t 和ngx -s reload启动和重新加载nginx, 利用pkill nginx停止nginx
注:如果出现./configure: error: the HTTP rewrite module requires the PCRE library.则执行下列脚本:
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.12.tar.gz
tar -zvxf pcre-8.12.tar.gz ; cd pcre-8.12
./configure
make; make install
如果要安装purge模块
cd /home/download
wget http://labs.frickle.com/files/ngx_cache_purge-1.3.tar.gz
tar zxvf ngx_cache_purge-1.3.tar.gz
./configure --prefix=/home/server/nginx-1.0.5 --add-module=/home/download/ngx_cache_purge-1.3 --with-http_stub_status_module
2. 安装PHP
cd /home/download;
wget http://cn.php.net/distributions/php-5.3.6.tar.gz
tar zxvf php-5.3.6.tar.gz;
cd php-5.3.6; ./configure --prefix=/home/server/php-5.3.6 --enable-fpm --enable-mbstring
make;
make install;
ln -s /home/server/php-5.3.6/ /home/server/php; cd /home/server/php;
cd etc; cp php-fpm.conf.default php-fpm.conf
vi php-fpm.conf, 修改pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. 简单点取消注释即可
启动php: /home/server/php/sbin/php-fpm
vi /etc/profile; 添加alias rsphp='pkill php-fpm; /home/server/php/sbin/php-fpm'
source /etc/profile
3. 安装PHP eaccelerator
cd /home/download;
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
tar jxvf eaccelerator-0.9.6.1.tar.bz2; cd eaccelerator-0.9.6.1;
/home/server/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/home/server/php/bin/php-config
make; make install
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
vi /home/server/php/lib/php.ini (如果没有,cp /home/download/php-5.3.6/php.ini-production /home/server/php/lib/php.ini)
添加:
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.log_file = "/tmp/eaccelerator/eaccelerator.log"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
重启php, php -v 查看eaccelerator是否安装成功
4. 安装mongodb, http://www.mongodb.org/downloads 查看最新版
cd /home/download;
wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgz
tar zxvf mongodb-linux-i686-1.8.2.tgz;
mv /home/download/mongodb-linux-i686-1.8.2 /home/server/mongodb-1.8.2; cd /home/server/mongodb-1.8.2;
启动mongodb后台进程:
mkdir -p /home/mongodata/;
/home/server/mongodb-1.8.2/bin/mongod --port=27017 --dbpath=/home/mongodata --logpath=/home/mongodata/mongodb.log &
5. 安装MongoDB的PHP驱动
sudo pecl install mongo (/home/server/php/bin/pecl install mongo)
vi /home/server/php/lib/php.ini; 添加extension=mongo.so,重启php即可
注:如果出现phpize: command not found,则执行
apt-get install php5-dev
6. 安装resin
cd /home/download;
wget http://www.caucho.com/download/resin-3.1.9.tar.gz
tar zxvf resin-3.1.9.tar.gz
cd resin-3.1.9
./configure --prefix=/home/resin
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com