• ubuntu16.4 lnmp 环境搭建


    使用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;  (后面部分为根目录+脚本路径)
    }

     http://www.cnblogs.com/argb/p/3604340.html

     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 后台运行

    问题: http://www.redicecn.com/html/Linux/20131125/468.html 

    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  // 配置文件中添加完整路径

    Caused by: PDOException :   http://blog.csdn.net/zqtsx/article/details/41845511

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

    kill -HUP  "cat /usr/local/nginx/logs/nginx.pid"

    kill -USR2 "cat /usr/local/var/run/php-fpm.pid"

     /var/run/mysqld/mysqld.sock

  • 相关阅读:
    CLR 对比 JVM
    unity drawcall测试
    UGUI 分页渐变居中效果
    几个ADB常用命令
    jQuery分步步骤
    jquery toast插件
    jQuery数字滚动(模拟网站人气、访问量递增)原创
    jQuery实用工具集
    scrollReveal.js – 页面滚动显示动画JS
    jquery轻量级数字动画插件jquery.countup.js
  • 原文地址:https://www.cnblogs.com/cgjcgs/p/6780951.html
Copyright © 2020-2023  润新知