ubuntu12.04下搭建LNMP + memcahce + memcahced +复述+ mongodb扩展

  

一。安装MySQL

 cd/数据/软
  sudo wget http://downloads.mysql.com/archives/mysql - 5.0/- mysql 5.0.45.tar.gz
  sudo焦油zxvf mysql-5.0.45.tar.gz
  cd mysql-5.0.45/sudo apt-get安装libncurses5-dev(如果没有需要安装)
  sudo apt-get安装建设重要(如果没有需要安装gcc)
  sudo ./configure——prefix=/usr/地方/mysql——enable-assembler with-extra-charsets=复杂——enable-thread-safe-client with-big-tables——with-embedded-server——enable-local-infile——使用插件=innobase
  sudo做,,使安装清洁
  cd/usr/local/mysql
  cp。。/分享/mysql/my-medium.cnf。/my . cnf中所做/bin/mysql_install_db
  cp/分享/mysql/mysql。服务器/etc/init.d/mysql
  chmod + x/etc/init.d/mysql
  #/etc/init。d/mysql开始及/etc/init.d/mysql停止运行和结束mysql服务。
  #注意:如遇到下面问题:
  #启动MySQL/etc/init。d/mysql: 159行:杀:(21755)——没有这样的过程解决办法
  # vim/etc/init.d/mysql
  #找到类似这样一行(我这里是304行):
  # $ bindir/mysqld_safe——datadir=$ datadir pid文件=server_pid_file other_args美元在/dev/null 2祝辞,1,
  #改为(加上参数,用户=根):
  # $ bindir/mysqld_safe——用户=根datadir=$ datadir——pid文件=server_pid_file other_args美元在/dev/null 2祝辞,1,
  #即可启动成功! ! !
  #/usr/地方/mysql/bin/mysql -uroot - p进入mysql ! ! 

,

,

二。安装Nginx

 cd/数据/软
  wget http://nginx.org/download/nginx-0.8.37.tar.gz
  焦油zxvf nginx-0.8.37.tar.gz
  cd nginx-0.8.37
  apt-get安装libpcre3-dev(如果需要)
  apt-get安装openssl(如果需要)
  apt-get安装libssl-dev(如果需要)
  sudo ./configure——prefix=/usr/地方/nginx——with-http_stub_status_module
  sudo做,,制作安装
  cp nginx。sh/etc/init.d/nginx
  #/etc/init。d/nginx启动(停止)http://127.0.0.1测试

,

三。安装PHP

 cd/数据/软
  wget http://cn2.php.net/distributions/php-5.3.23.tar.gz
  焦油zxvf php-5.3.23.tar.gz
  cd php-5.3.23
  apt-get安装libxml2-dev
  apt-get安装libjpeg-dev
  apt-get安装libpng-dev
  apt-get安装libfreetype6-dev
  ./configure——prefix=/usr/地方/php——with-config-file-path=/usr/地方/php——enable-mbstring enable-ftp——与gd with-jpeg-dir=/usr/包括——with-png-dir=/usr/包括使用mysql=mysqlnd——with-mysqli=mysqlnd with-pdo-mysql=mysqlnd——pear enable-sockets——with-freetype-dir=/usr/包括enable-gd-native-ttf——with-zlib with-libxml-dir=/usr/包括——with-xmlrpc enable-zip——enable-fpm enable-fpm——启用xml enable-sockets——与gd with-zlib——with-iconv enable-zip——enable-soap enable-pcntl——enable-cli
  使,,制作安装
  cp/sapi/fpm摆在。php-fpm/etc/init.d/php-fpm
  chmod + x/etc/init.d/php-fpm
  cd/usr/local/php/etc
  mv php-fpm.conf.default php-fpm.conf
  vim php-fpm.conf
  #去掉25行前的分号pid=/php-fpm.pid运行
  131和132 #修改第行的用户和组为当前用户(安装系统时设置的帐户名)简简
  #去掉161166171176行前面的分号保存并退出。
  # cp代码包里的php.ini.development到/usr/local/php php . ini
  #/etc/init。d/php-fpm开始与/etc/init.d/php-fpm停止(启动和停止)

四。配置nginx支持PHP

 mkdri/数据/根
  vi/usr/local/nginx/conf/nginx.conf
  43 #修改,44行
  #根/数据/根;
  #指数指数。html索引。htm index . php。
  #修改63行
  # ~ \位置。php $ {
  fastcgi_pass 127.0.0.1:9001;
  fastcgi_index index . php。
  fastcgi_param SCRIPT_FILENAME document_root fastcgi_script_name美元;
  包括fastcgi_params;
  }
  #/etc/init。d/nginx重载(http://127.0.0.1测试)

五。安装memcached

 cd/数据/软
  wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
  焦油zxvf memcached-1.4.15.tar.gz
  cd memcached-1.4.15
  apt-get安装libevent-dev
  ./configure——prefix=/usr/地方/memcached
  使,,制作安装/usr/local/memcached/bin/memcached 50根- l - p 11211 - u - d - m 127.0.0.1 

六。安装mongodb

 cd/数据/软
  wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.0.8.tgz
  焦油zxvf mongodb-linux-x86_64-2.0.8.tgz
  mv mongodb-linux-x86_64-2.0.8/usr/local/mongodb
  mkdir - p/数据/db/mongodb/数据
  mkdir - p/数据/db/mongodb/日志
  cd/usr/local/mongodb//bin/mongod——dbpath=/数据/db/mongodb logpath=/数据/数据/?db/mongodb/日志/日志。日志——logappend端口=27017——叉——源=127.0.0.1 

ubuntu12.04下搭建LNMP + memcahce + memcahced +复述+ mongodb扩展