saviorLv 2017-09-22 09:54:09 2381次浏览 0条评论 1 0 0

title: centos7-Lnmp
date: 2017-08-04 09:13:21
tags: [aliYun,Lnmp]

categories: Linux

线上环境centos 7.2 x64

更新yum源

yum update

安装nginx

>因为centos 不支持 yum安装 nginx,需要先添加 nginx 的yum 源。

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

>安装nginx

yum install nginx

安装mysql

>更新MySQL地址

rpm -ivh  http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

>安装

yum install mysql-community-server

>安装完毕后,在 /var/log/mysqld.log 文件中会自动生成一个随机的密码,我们需要先取得这个随机密码,以用于登录 MySQL 服务端

grep "password" /var/log/mysqld.log

OR

mysql    #直接登陆mysql

>打印如下内容:

A temporary password is generated for root@localhost: hilX0U!9i3_6

>我们复制 root@localhost: 后面的随机字符串,这个字符串就是 MySQL 在安装完成后为我们随机生成的密码;

登录到 MySQL 服务端并更新用户 root 的密码

mysql -u root -philX0U!9i3_6

>打印出 MySQL 的版本即表明已登录;
设置用户 root 可以在任意 IP 下被访问:

grant all privileges on *.* to root@"%" identified by "新密码";

>刷新权限使之生效:

flush privileges;

安装PHP

>安装php的yum源

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

>安装php5.5

 yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64

>安装php5.6

 yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64

>安装php7

 yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64

>安装php-fpm

 yum install php55w-fpm 
 yum install php56w-fpm 
 yum install php70w-fpm
    没有找到数据。
您需要登录后才可以评论。登录 | 立即注册