在Ubuntu上实现LNMP(Linux, Nginx, MySQL, PHP)的自动化部署,可以通过多种工具和方法来完成。以下是几种常见的方法:
#!/bin/bash
sudo apt update
sudo apt install nginx mysql-server php-fpm php-mysql -y
sudo systemctl enable nginx
sudo systemctl enable mysql
sudo systemctl enable php7.x-fpm
---
- name: Deploy LNMP
hosts: ubuntu
become: yes
tasks:
- name: Install Nginx
apt:
name: nginx
state: present
- name: Install MySQL
apt:
name: mysql-server
state: present
- name: Install PHP and extensions
apt:
name: php7.x-fpm php7.x-mysql
state: present
```[未提供链接]
通过上述方法,你可以根据具体需求选择最适合的自动化部署工具或方法,实现Ubuntu上的LNMP环境快速搭建。