• lnmp源码安装


    安装lnmp之前

    1 创建用户/2 > groupadd www, useradd -g www www -M -s /sbin/nologin
    3 安装c编译器
    4 > yum -y install gcc

    nginx-1.14.1

     1 下载
     2   地址:http://nginx.org/en/download.html 
     3 解压 
     4 > tar -xf nginx-1.14.1.tar.gz 
     5 > cd nginx  // 进入到niginx目录
     6 配置环境参数(有可能会报错,报错信息会显示出缺少哪个库,然后你yum安装就行,例:yum -y install pcre-devel 7 > ./configure --prefix=/usr/local/nginx --user=www --group=www 
     8 编译/安装 9 > make && make install
    10 nginx操作
    11 > sbin/nginx //开启 12 > pkill nginx //关闭

     php-7.2.12

     1 下载地址:http://php.net/downloads.php
     2 解压 tar -jxf mirror
     3 安装一些库(这些库基本上可以满足下面检测环境步骤所需要得,如果不够得话,可以yum安装)
     4 yum -y install gcc-devel libxml2-devel openssl-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel
     5 
     6 检测当前linux环境
     7 ./configure 
     8 --prefix=/usr/local/php7
     9 --enable-fpm 
    10 --with-fpm-user=www 
    11 --with-fpm-group=www 
    12 --with-config-file-path=/usr/local/php7/etc   
    13 --disable-ipv6   
    14 --with-openssl 
    15 --with-libxml-dir   
    16 --with-zlib  
    17 --with-curl  
    18 --with-gd  
    19 --with-jpeg-dir  
    20 --with-png-dir  
    21 --with-freetype-dir  
    22 --with-gettext  
    23 --enable-mbstring  
    24 --with-mysqli  
    25 --with-pdo-mysql 
    26 --enable-embedded-mysqli  
    27 --with-pcre-dir  
    28 --enable-mysqlnd,  出现 Thank you for using PHP ,说明当前环境满足安装需要了
    29 
    30 开始编译安装 
    31 make && make install
    32 sbin/php-fpm 开启       
    33 pkill php-fpm 关闭

    mysql-8.0.13

     1 下载地址:https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-8.0.13.tar.gz
     2 解压 tar -xf ******.tar.gz
     3 安装库文件(部分文件,如果不够,再yum安装) 
     4 yum -y install gcc ncurses-devel gcc-c++ cmake
     5 yum install openssl-devel openssl
     6 检测环境(类似 .configure) cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql8 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/src/mysql-8.0.13/boost/
     7 开始编译/安装 make && make install
     8 groupadd mysql;useradd -g mysql mysql -M -s /sbin/nologin
     9 初始化数据库 ./bin/mysqld --initialize --user=mysql --datadir=/usr/local/mysql8/data --basedir=/usr/local/mysql8/
    10 A temporary password is generated for root@localhost:这里是数据库初始密码,先保存下来,下面会用到;
    11 cp /usr/local/mysql8/support-files/mysql.server /etc/init.d/mysql
    12 service mysql start /stop/restart
    13 用mysql客户端连接mysql服务器,命令:mysql -uroot -p ,会提示command Not found,将mysql/bin路径加到path里面,我这里是将mysql/bin加入的是用户环境配置文件---~/.bash_profile,查看下面图1,你也可以加入系统环境配置文件--/etc/profile
    14 现在开始mysql -uroot -p,这里的密码是初始密码,
    15 创建允许远程链接,这里不建议直接用root;所以需要创建一个新的用户;创建步骤如下:
    16 create user 'user001'@'192.168.1.110' identified by '123456';
    17 grant all on *.* to 'user001'@'192.168.1.110';

     1 mysql安装和使用过程中遇到的问题,(其中解决办法只是作为参考,有可能不能解决你的问题):
     2 1.Cannot find appropriate system libraries for WITH_SSL=system.
     3     解决办法:yum install openssl-devel openssl
     4 2.The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid
     5     解决办法:
     6             删除 /etc/my.cnf (删除之前做好备份)
     7 3.Starting MySQL.2019-04-11T07:14:54.424714Z mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists.
     8  ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).   
     9      解决办法:创建/var/lib/mysql
    10          cd /var/lib;
    11          mkdir mysql
    12          chown 744 mysql
    13          chown mysql mysql/       
    14 4.Can't connect to local MySQL server through socket '/tmp/mysql.sock       
    15     解决办法: 添加图2中红框的内容 ,其实就是和上面的socket路径一样
    16 5.ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
    17     解决办法:alter user 'root'@'localhost' identified by 'root';    
    18 6.Reading table information for completion of table and column names,You can turn off this feature to get a quicker startup with -A    
    19     这其实也不算一个问题,但是也是可以消除此信息的,在登录的时候加上这个选项--mysql -uroot -A -p    这样就行了。
    20 7.Authentication plugin 'caching_sha2_password' cannot be loaded
    21         ALTER USER user001@192.168.1.110 IDENTIFIED WITH mysql_native_password BY '123456'

      如果以上解决办法都不能解决你的问题,建议重新安装(请在虚拟机上面测试,完成一个问题做一个快照,这样节省时间);

    图1

    图2

  • 相关阅读:
    680C. Bear and Prime 100 数学
    Codeforces 681C. Heap Operations 优先队列
    Codeforces C. NP-Hard Problem 搜索
    Codeforces 689C. Mike and Chocolate Thieves 二分
    Codeforces 689B. Mike and Shortcuts SPFA/搜索
    Codeforces Round #223 (Div. 2) E. Sereja and Brackets 线段树区间合并
    Educational Codeforces Round 1 E. Chocolate Bar dp
    Testing Round #12 A,B,C 讨论,贪心,树状数组优化dp
    Educational Codeforces Round 2 E. Lomsat gelral 启发式合并map
    hdu 3706 Second My Problem First 单调队列
  • 原文地址:https://www.cnblogs.com/baikaishui-liang/p/10155534.html
Copyright © 2020-2023  润新知