centos6.6部署lnmp
来源:互联网 发布:知道mac地址能干什么 编辑:程序博客网 时间:2024/06/05 16:56
安装nginx(yum安装)
[root@erhui2 opt]# vim /etc/yum.repos.d/nginx.repo [nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/$releasever/$basearch/gpgcheck=0enabled=1[root@erhui2 opt]# yum -y install nginx
修改配置文件中的php信息
[root@erhui2 conf.d]# vim /etc/nginx/conf.d/default.conf ... location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
安装php(5.6版本)
安装php
[root@erhui2 opt]# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm[root@erhui2 opt]# yum install php56w php56w-opcache [root@erhui2 opt]# yum install php56w-mysql php56w-devel php56w-fpm -y[root@erhui2 opt]# php --versionPHP 5.6.30 (cli) (built: Jan 19 2017 22:50:24)
配置php
修改php.ini的889行
[root@erhui2 conf.d]# vim /etc/php.ini date.timezone = RPC
修改php-fpm配置文件
[root@erhui2 conf.d]# vim /etc/php-fpm.d/www.conf user = nginxgroup = nginx
重启php
[root@erhui2 conf.d]# /etc/init.d/php-fpm restart
安装mysql5.7
下载mysql5.7的源码包
mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar
[root@erhui2 local]# yum remove mysql-libs mysql-devel mysql mysql-server compat-mysql51[root@erhui2 local]# tar xvf mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar[root@erhui2 local]# yum install libnuma* perl-JSON.noarch perl-Time-HiRes libaio gcc c++ -y[root@erhui2 local]# rpm -ivh mysql-community-*
初始化mysql安装目录至
/home/mysql
[root@erhui2 local]# mysql_install_db --datadir=/home/mysql
给mysql目录授权
chown -R mysql:mysql /home/mysql
修改mysql配置文件
[root@erhui2 local]# vim /etc/my.cnf[mysqld]datadir=/home/mysqlsocket=/var/lib/mysql/mysql.sockmax_connections=2000wait_timeout=288000group_concat_max_len = 200000sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONserver-id = 21log-bin=mysql-binsymbolic-links=0log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pid#skip-grant-tables=1
mysql初始密码存放文件
[root@erhui2 local]# cat ~/.mysql_secret # Password set for user 'root@localhost' at 2017-06-23 20:29:06 qw=ay-eraEk0
启动mysql
[root@erhui2 local]# /etc/init.d/mysqld start
测试
[root@erhui2 conf.d]# cat /usr/share/nginx/html/a.php <?php phpinfo();?>
通过访问,已经生效
阅读全文
0 0
- centos6.6部署lnmp
- CentOS6.6搭建LNMP环境
- CentOS6.6搭建LNMP环境
- Centos6.6+LNMP+PostgreSQL9.4+Symfony2
- 基于CentOS6.6搭建LNMP服务器环境
- LNMP部署
- centos6 搭建lnmp
- CentOS6.5搭建LNMP
- CentOS6.5搭建LNMP
- CentOS6.5搭建LNMP
- CentOS6.5搭建LNMP
- CentOS6.5搭建LNMP
- CentOS6搭建LNMP
- CentOS6.5搭建LNMP
- CentOS6.5搭建LNMP
- CentOS6.5搭建LNMP
- CentOS6.5搭建LNMP
- CentOS6.5搭建LNMP
- 引用路径--绝对路径和相对路径
- Entity Framework的查询与操作
- C_逻辑题: 常胜将军
- Expression表达式树一些运用
- 设计模式之二:iterator
- centos6.6部署lnmp
- .net core mvc中使用ef
- ButterKnife安装及点击无响应时的配置
- 未知错误(一)
- 九度 题目1352:和为S的两个数字
- Vue.js+Layer表格数据绑定与实现更新
- Vue.js 表格查询与更新
- jqGrid 帮助文档
- spring boot(8)-mybatis三种动态sql