1.配置本地yum源
[root@localhost ~]# cat /etc/yum.repos.d/ce.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
2.修改主机名,命令如下:
[root@localhost ~]# hostnamectl set-hostname lnmp
[root@localhost ~]# hostnamectl
Static hostname: lnmp
Icon name: computer-vm
Chassis: vm
Machine ID: 6902afbaf7884f7a929aafbe53f804a7
Boot ID: b6210edf586a408a95645b10685da07d
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-327.el7.x86_64
Architecture: x86-64
3.将提供的lnmp1.6-full.tar.gz软件包,上传到虚拟机的/root目录下,并解压,命令如下:
[root@lnmp ~]# ls
anaconda-ks.cfg lnmp1.7-full.tar.gz
[root@lnmp ~]# tar -zxvf lnmp1.7-full.tar.gz
4.解压完毕后,进入lnmp1.6-full目录,执行安装脚本
[root@lnmp ~]# cd lnmp1.7-full
[root@lnmp lnmp1.7-full]# ./install.sh
5.选择对应版本,默认回车
+------------------------------------------------------------------------+
| LNMP V1.7 for CentOS Linux Server, Written by Licess |
+------------------------------------------------------------------------+
| For more information please visit https://lnmp.org |
+------------------------------------------------------------------------+
| lnmp status manage: lnmp {start|stop|reload|restart|kill|status} |
+------------------------------------------------------------------------+
| phpMyAdmin: http://IP/phpmyadmin/ |
| phpinfo: http://IP/phpinfo.php |
| Prober: http://IP/p.php |
+------------------------------------------------------------------------+
| Add VirtualHost: lnmp vhost add |
+------------------------------------------------------------------------+
| Default directory: /home/wwwroot/default |
+------------------------------------------------------------------------+
| MySQL/MariaDB root password: 000000 |
+------------------------------------------------------------------------+
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
nginx (pid 110600) is running...
php-fpm is runing!
SUCCESS! MySQL running (111147)
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 50 *:3306 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 128 :::22 :::*
Install lnmp takes 28 minutes.
Install lnmp V1.7 completed! enjoy it.
6.如上,安装完成
使用浏览器,输入虚拟机IP为192.168.200.10,查看界面
安装完毕首页
关于安装LNMP环境,已使用脚本进行一键部署