编译安装LNMP太繁琐,不易部署和管理,通过系统源安装最很方便,Centos官方源软件包较少,需先安装EPEL源。
安装MysQL:
yum install mysql-server
/etc/init.d/mysqld start
chkconfig mysqld on
/usr/bin/mysqladmin -u root password 'newpasswd'
安装PHP:
yum install php-fpm php-cli php-mysqlnd php-pdo php-xml php-gd php-opcache
/etc/init.d/php-fpm start
chkconfig php-fpm on
安装Nginx:
yum install nginx
/etc/init.d/nginx start
chkconfig nginx on