可能很多人覺得搭建lamp環境很麻煩,需要一個一個包安裝,今天來分享一下lamp/lnmp/lnmpa一鍵包
1.更新軟體清單
sudo apt-get update
2.下載下傳一鍵包
wget http://mirrors.linuxeye.com/lnmp-full.tar.gz
root@iZwz92sq8e1hle3inkc5jkZ:~# wget http://mirrors.linuxeye.com/lnmp-full.tar.gz
--2020-11-05 11:18:03-- http://mirrors.linuxeye.com/lnmp-full.tar.gz
Resolving mirrors.linuxeye.com (mirrors.linuxeye.com)... 1.81.5.176, 240e:bf:b800:
1900:5c96:6aff:fe34:9c41, 240e:bf:b800:1900:c826:31ff:fe15:c8bf, ...
Connecting to mirrors.linuxeye.com (mirrors.linuxeye.com)|1.81.5.176|:80... connec
ted.
HTTP request sent, awaiting response... 200 OK
Length: 327299956 (312M) [application/octet-stream]
Saving to: ‘lnmp-full.tar.gz’
lnmp-full.tar.gz 89%[=================> ] 280.00M 9.06MB/s eta 5s
3.解壓一鍵包
tar xzf lnmp-full.tar.gz
4.進入目錄
cd lnmp
5.執行安裝腳本
sudo ./install.sh
6.接下來按照自己的需求選擇就好,這裡僅供參考
#######################################################################
# OneinStack for CentOS/RedHat 6+ Debian 8+ and Ubuntu 14+ #
# For more information please visit https://oneinstack.com #
#######################################################################
Please input SSH port(Default: 22): 22
Do you want to enable iptables? [y/n]: y
Do you want to install Web server? [y/n]: y
Please select Nginx server:
1. Install Nginx
2. Install Tengine
3. Install OpenResty
4. Do not install
Please input a number:(Default 1 press Enter) 1
Please select Apache server:
1. Install Apache-2.4
2. Install Apache-2.2
3. Do not install
Please input a number:(Default 3 press Enter) 1
Please select Apache2.4 mode:
3. Do not install
Please input a number:(Default 3 press Enter) 1
Please select Apache2.4 mode:
1. php-fpm
2. mod_php
Please input a number:(Default 1 press Enter) 1
3. worker
Please input a number:(Default 1 press Enter) 1
Do you want to install Database? [y/n]: y
Please select a version of the Database:
1. Install MySQL-8.0
2. Install MySQL-5.7
3. Install MySQL-5.6
4. Install MySQL-5.5
5. Install MariaDB-10.5
6. Install MariaDB-10.4
7. Install MariaDB-10.3
8. Install MariaDB-5.5
9. Install Percona-8.0
10. Install Percona-5.7
11. Install Percona-5.6
12. Install Percona-5.5
13. Install AliSQL-5.6
14. Install PostgreSQL
15. Install MongoDB
Please input a number:(Default 2 press Enter) 2
Please input the root password of MySQL(default: KBh3NIzS): 123456
Please choose installation of the database:
1. Install database from binary package.
2. Install database from source package.
Please input a number:(Default 1 press Enter) 1
Do you want to install PHP? [y/n]: y
1. Install database from binary package.
2. Install database from source package.
Please input a number:(Default 1 press Enter) 1
Do you want to install PHP? [y/n]: y
Please select a version of the PHP:
1. Install php-5.3
2. Install php-5.4
3. Install php-5.5
4. Install php-5.6
5. Install php-7.0
6. Install php-7.1
7. Install php-7.2
8. Install php-7.3
9. Install php-7.4
Please input a number:(Default 7 press Enter) 5
Do you want to install opcode cache of the PHP? [y/n]: y
Please select a opcode cache of the PHP:
1. Install Zend OPcache
3. Install APCU
Please input a number:(Default 1 press Enter) y
input error! Please only input number 1,3
Please select a opcode cache of the PHP:
1. Install Zend OPcache
3. Install APCU
Please input a number:(Default 1 press Enter) 1
Please select PHP extensions:
0. Do not install
1. Install zendguardloader(PHP<=5.6)
2. Install ioncube
3. Install sourceguardian(PHP<=7.2)
4. Install imagick
5. Install gmagick
6. Install fileinfo
7. Install imap
8. Install ldap
9. Install phalcon(PHP>=5.5)
10. Install yaf(PHP>=7.0)
11. Install redis
12. Install memcached
13. Install memcache
14. Install mongodb
15. Install swoole
16. Install xdebug(PHP>=5.5)
Please input numbers:(Default '4 11 12' press Enter) 3
Do you want to install Pure-FTPd? [y/n]: y
Do you want to install phpMyAdmin? [y/n]: y
Do you want to install redis-server? [y/n]: n
Do you want to install memcached-server? [y/n]: n
Do you want to install HHVM? [y/n]: n
7.選擇完成之後就等待安裝,安裝時間有點常,耐心等待一下,安裝完成之後輸入y重新開機伺服器即可