阿里云 CentOS7.2 php7,php-fpm, nginx , mysql5.7 搭建

  1. Mysql5.7 安装

    1. http://dev.mysql.com/downloads/repo/yum/ 进入官方,下载yum包

      1. wget http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
    2. 安装包

      1. sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
    3. 安装mysql

      1. sudo yum install mysql-server
    4. 启动mysql(默认获取登录密码)

      1. service mysqld start
    5. 获取默认登录密码

      1. grep "password" /var/log/mysqld.log
    6. 设置密码

      1. #1,登录  mysql -uroot -p密码
      2. #mysql5.7 默认增了密码强度规则 
      3. 0 or LOW Length
      4. 1 or MEDIUM Length; numeric, lowercase/uppercase, and special characters
      5. 2 or STRONG Length; numeric, lowercase/uppercase, and special characters; dictionary file
      6. #2,设置验证级别 set global validate_password_policy=0;
      7. #3,设置密码 set password = password('xxxxx');
    7. 设置远程访问

      1. #1:创建登录用户,主机可选%:表示IP可访问,host 本机访问
      2. create user '登录用户名'@'主机' identified by '密码';
      3. #2 授权
      4. GRANT ALL PRIVILEGES ON dbname.* to '登录用户名'@'主机';
      5. #移除授权
      6. revoke ALL  ON *.* from '登录用户名'@'主机';
  2. PHP / PHP-FPM 安装

    1. 增加php7源

      1. rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
      2. rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    2. 安装php7

      1. yum install php70w php70w-opcache php70w-mysql ......(缺啥补啥)
      2. #可选插件
      3. php70w
      4. php70w-bcmath
      5. php70w-cli
      6. php70w-common
      7. php70w-dba
      8. php70w-devel
      9. php70w-embedded
      10. php70w-enchant
      11. php70w-fpm
      12. php70w-gd
      13. php70w-imap
      14. php70w-interbase
      15. php70w-intl
      16. php70w-ldap
      17. php70w-mbstring
      18. php70w-mcrypt
      19. php70w-mysql
      20. php70w-mysqlnd
      21. php70w-odbc
      22. php70w-opcache
      23. php70w-pdo
      24. php70w-pdo_dblib
      25. php70w-pear
      26. php70w-pecl-apcu
      27. php70w-pecl-imagick
      28. php70w-pecl-xdebug
      29. php70w-pgsql
      30. php70w-phpdbg
      31. php70w-process
      32. php70w-pspell
      33. php70w-recode
      34. php70w-snmp
      35. php70w-soap
      36. php70w-tidy
      37. php70w-xml
      38. php70w-xmlrp
    3. 安装php-fpm

      1. yum install php70w-fpm
    4. 查看是否自动启动

      1. systemctl list-unit-files | grep php-fpm
      2. systemctl enable php-fpm #如果状态为disable,则执行
    5. 配置php-fpm

      1. listen.backlog =65536
      2. request_slowlog_timeout = 10
    6. 对了,安装了插件需要重启一下php-fpm

      1. #停掉
      2. service php-fpm stop;
      3. #启动
      4. service php-fpm start;
      5. #查看状态
      6. service php-fpm status
  3. Nginx 安装

    1. yum 安装

      1. #centos 源中已包含了nginx
      2. yum install nginx;
      3. #检查版本
      4. nginx -v
      5. nginx version: nginx/1.10.2
    2. 配置 vim /etc/nginx/nginx.conf

    3. 配置项目

    4. OK,启动PHP-FPM NGINX Mysql

      1. service php-fpm start;
      2. service nginx start;
      3. service mysqld start;
  4. 参数文章

    1.   http://www.jianshu.com/p/6ca528d050f1

    2.   http://www.cnblogs.com/ivictor/p/5142809.html

    3.   http://liaoen.blog.51cto.com/2253541/819081

    4.   http://www.blogjava.net/Alpha/archive/2016/08/10/431515.html

  5. --破编辑器,复印过来的代码都走样了,逼得我截图上传..xxxx

本文链接:http://www.hihubs.com/article/256

关键字:阿里云 CentOS7.2 php7,php-fpm, nginx , mysql5.7 搭建

若无特别注明,文章皆为Hubs'm原创,转载请注明出处...O(∩_∩)O