安裝依賴包php
yum -y yum -y install gcc openssl-devel pcre-devel zlib-develmysql
#建立用戶沒有可交互的shellnginx
useradd -s /sbin/nologin nginxsql
#源碼安裝nginXshell
tar xf /lnmp_soft.tar.gz數據庫
cd lnmp_soft/ide
tar xf nginx-1.12.2.tar.gzphp-fpm
cd nginx-1.12.2/server
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_modulessl
make && make install
#安裝數據庫的包
yum -y install mariadb mariadb-server mariadb-devel
yum -y install php php-mysql
yum -y install lnmp_soft/php-fpm-5.4.16-42.el7.x86_64.rpm
#啓動相關服務
systemctl start mariadb
systemctl enable mariad
systemctl start php-fpm
systemctl enable php-fpm
#關閉httpd服務,以避免佔用80端口
systemctl stop httpd
#啓動nginX服務
ln -s /usr/local/nginx/sbin/nginx /sbin/
nginx
ss -antpu | grep nginx