码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu16.4 lnmp 环境搭建

时间:2017-04-29 17:35:20      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:closed   nload   防火墙   can   ast   use   share   string   files   

使用dpkg命令查看自己需要的软件是否安装 dpkg -l | grep zlib    ;    which nginx

查看端口  netstat -tunpl | grep 6379

 

 

wget http://nginx.org/download/nginx-1.12.0.tar.gz
tar -zxvf nginx-1.12.0.tar.gz

cd nginx-1.12.0

./configure

sudo make && sudo make install

sudo /usr/local/nginx/sbin/nginx [-c  /usr/local/nginx/conf/nginx.conf] 配置文件 不写会自动加载安装目录下的配置

 

技术分享
./configure: error: the HTTP rewrite module requires the PCRE library.

sudo apt-get install libpcre3 libpcre3-dev 

./configure: error: the HTTP gzip module requires the zlib library.

sudo apt-get install zlib1g-dev

 

Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/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"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"
可能遇到的问题 和 配置信息

 

 

wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
tar zxvf php-5.6.30.tar.gz
cd php-5.6.30/

./configure --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-mysql --with-mysqli --with-pdo-mysql --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --with-curl --with-zlib --enable-zip --disable-fileinfo --enable-opcache --with-gd --with-jpeg-dir --with-png-dir

 

sudo apt-get install libxml2-dev

sudo apt-get install libssl-dev
sudo apt-get install libmcrypt-dev

sudo make && sudo make install

技术分享
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20131226/
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/php/man/man1/
Installing PHP FPM binary:        /usr/local/sbin/
Installing PHP FPM config:        /usr/local/etc/
Installing PHP FPM man page:      /usr/local/php/man/man8/
Installing PHP FPM status page:   /usr/local/php/php/fpm/
Installing PHP CGI binary:        /usr/local/bin/
Installing PHP CGI man page:      /usr/local/php/man/man1/
Installing build environment:     /usr/local/lib/php/build/
Installing header files:           /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/lib/php/
路径信息

 /usr/local/etc$ sudo cp php-fpm.conf.default php-fpm.conf

配置 php-fpm.conf

 pid = run/php-fpm.pid //这个必去将前面的;注释去掉(一开始没去掉结果出502错误)

配置 nginx.conf
location ~ .*\.(php|php5)?$

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME   /var/www/$fastcgi_script_name;  (后面部分为根目录+脚本路径)
}

 

 wget http://download.redis.io/releases/redis-3.2.8.tar.gz
 tar zxvf redis-3.2.8.tar.gz
 cd redis-3.2.8/

sudo make

cd src/
make install PREFIX=/usr/local/redis

 可执行文件 在/usr/local/redis/bin  配置文件copy到了 /usr/local/redis/etc

修改 redis.conf

daemonize yes 后台运行

 

wget https://pecl.php.net/get/redis-3.1.2.tgz
 tar zxvf redis-3.1.2.tgz
cd redis-3.1.2/

sudo /usr/local/bin/phpize

Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.    sudo apt-get install autoconf

 

./configure --with-php-config=/usr/local/bin/php-config

make && make install
extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/redis.so  // 配置文件中添加完整路径

 

 防火墙 http://blog.163.com/crazy20070501@126/blog/static/128659465201361791541665/

ubuntu16.4 lnmp 环境搭建

标签:closed   nload   防火墙   can   ast   use   share   string   files   

原文地址:http://www.cnblogs.com/cgjcgs/p/6780951.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!