1. 程式人生 > >centos7配置環境LNMP

centos7配置環境LNMP

mct xhprof 用戶組 blog arc mysql start 環境 install

#yum安裝epel-release第三方軟件包
yum install epel-release
#要驗證EPEL倉庫是否建立成功
yum repolist

  

#安裝php5.6.31
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm 

yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-fpm php-redis php-gd

#設置時區
vim /etc/php.ini
#date.timezone = "Asia/Shanghai"

#設置php-fpm運行用戶組
vim /etc/php-fpm.d/www.conf
#user = nginx
#group = nginx
#listen = 127.0.0.1:9000 	前面;去掉
#listen.owner = nobody		前面;去掉
#listen.group = nobody		前面;去掉
#listen.mode = 0660			前面;去掉

  

#安裝nginx
yum list nginx
yum install nginx

#啟動nginx
systemctl start  nginx.service
systemctl status nginx.service

#啟動php-fpm
systemctl start  php-fpm.service
systemctl status php-fpm.service

  

#安裝mysql5.7.20
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm 

#安裝mysql源
yum localinstall mysql57-community-release-el7-8.noarch.rpm
#安裝mysql server
yum install mysql-community-server

#啟動mysqld
systemctl start mysqld
systemctl status mysqld

#查看臨時密碼
grep ‘A temporary password‘ /var/log/mysqld.log

#登錄設置root新密碼
alter user ‘root‘@‘localhost‘ identified by ‘Abc#123!‘;

#查看mysql版本
->status;

#新建用戶
create user huirong identified by ‘huirongAbc#123‘;

  

#安裝redis3.2.10
yum list redis
yum install redis

#啟動redis
systemctl start redis.service
systemctl status redis.service

#查看redis版本
redis-cli 
->info

  

#yum安裝lrzsz
yum list lrzsz
yum install lrzsz 
#rz上傳 sz下載

  

centos7配置環境LNMP