推荐下teddysun的LCMP一键脚本,建站so easy !
发表于 : 2024年 12月 26日 20:53
teddysun的LCMP一键安装脚本估计有些人还不知道,这里介绍下:LCMP ,也就是Linux + Caddy2 + MariaDB + PHP,一键梭哈,一般两三分就搞定了。由于是caddy2,建站的时候SSL证书完全不用理会,完全自动帮你搞定,这一点是最方便的。
系统支持:
Enterprise Linux 8 (CentOS Stream 8, RHEL 8, Rocky Linux 8, AlmaLinux 8, Oracle Linux 8)
Enterprise Linux 9 (CentOS Stream 9, RHEL 9, Rocky Linux 9, AlmaLinux 9, Oracle Linux 9)
Debian 11
Debian 12
Ubuntu 20.04
Ubuntu 22.04
Ubuntu 24.04
配置要求:
硬盘: 5 GiB
内存: 512 MiB
连网
正确的存储库
root权限
软件支持:
Caddy 2 ※ Caddy packages provided by Teddysun Repository
MariaDB 10.11, 11.4 ※ MariaDB packages provided by MariaDB Repository
PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 ※ PHP rpm packages provided by Remi Repository, deb packages provided by deb.sury.org
架构支持:
x86_64 (amd64)
aarch64 (arm64)
安装:
Enterprise Linux 8 / 9
Debian 11+ / Ubuntu 20.04+
升级:
Enterprise Linux 8 / 9
Debian 11+ / Ubuntu 20.04+
卸载:
Enterprise Linux 8 / 9
Debian 11+ / Ubuntu 20.04+
相关配置路径:
Caddy Location Path
Web root location /data/www/default
Main Configuration File /etc/caddy/Caddyfile
Sites Configuration Folder /etc/caddy/conf.d/
MariaDB Location Path
Data Location /var/lib/mysql
my.cnf File (rpm) /etc/my.cnf
my.cnf File (deb) /etc/mysql/my.cnf
PHP Location Path
php-fpm File (rpm) /etc/php-fpm.d/www.conf
php-fpm File (deb) /etc/php/${php_ver}/fpm/pool.d/www.conf
php.ini File (rpm) /etc/php.ini
php.ini File (deb) /etc/php/${php_ver}/fpm/php.ini
相关管理命令:
Process Command
Caddy systemctl [start|stop|status|restart] caddy
MariaDB systemctl [start|stop|status|restart] mariadb
PHP (rpm) systemctl [start|stop|status|restart] php-fpm
PHP (deb) systemctl [start|stop|status|restart] php${php_ver}-fpm
LCMP命令:
Command Description
lcmp start Start all of LCMP services
lcmp stop Stop all of LCMP services
lcmp restart Restart all of LCMP services
lcmp status Check all of LCMP services status
lcmp version Print all of LCMP software version
lcmp vhost add Create a new Caddy virtual host
lcmp vhost list List all of Caddy virtual hosts
lcmp vhost del Delete a Caddy virtual host
lcmp db add Create a MariaDB database and a user with same name
lcmp db list List all of MariaDB databases
lcmp db del Delete a MariaDB database and a user with same name
lcmp db edit Update a MariaDB database username's password
相关问题提交:
https://github.com/teddysun/lcmp/issues 或者 i@teddysun.com
https://github.com/teddysun/lcmp
https://teddysun.com/700.html
系统支持:
Enterprise Linux 8 (CentOS Stream 8, RHEL 8, Rocky Linux 8, AlmaLinux 8, Oracle Linux 8)
Enterprise Linux 9 (CentOS Stream 9, RHEL 9, Rocky Linux 9, AlmaLinux 9, Oracle Linux 9)
Debian 11
Debian 12
Ubuntu 20.04
Ubuntu 22.04
Ubuntu 24.04
配置要求:
硬盘: 5 GiB
内存: 512 MiB
连网
正确的存储库
root权限
软件支持:
Caddy 2 ※ Caddy packages provided by Teddysun Repository
MariaDB 10.11, 11.4 ※ MariaDB packages provided by MariaDB Repository
PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 ※ PHP rpm packages provided by Remi Repository, deb packages provided by deb.sury.org
架构支持:
x86_64 (amd64)
aarch64 (arm64)
安装:
Enterprise Linux 8 / 9
代码: 全选
yum -y install wget git
git clone https://github.com/teddysun/lcmp.git
cd lcmp
chmod 755 *.sh
./lcmp.sh 2>&1 | tee lcmp.log
代码: 全选
apt-get -y install wget git
git clone https://github.com/teddysun/lcmp.git
cd lcmp
chmod 755 *.sh
./lcmp.sh 2>&1 | tee lcmp.log
升级:
Enterprise Linux 8 / 9
代码: 全选
yum update -y caddy
yum update -y MariaDB-*
yum update -y php-*
# Change PHP directory's group for Caddy again if you upgraded PHP version
chown root:caddy /var/lib/php/{session,wsdlcache,opcache}
Debian 11+ / Ubuntu 20.04+
代码: 全选
apt-get install --only-upgrade -y caddy
apt-get install --only-upgrade -y mariadb-*
# for example: php_ver=[7.4|8.0|8.1|8.2|8.3|8.4]
php_ver="8.2"
apt-get install --only-upgrade -y php${php_ver}-*
卸载:
Enterprise Linux 8 / 9
代码: 全选
yum remove -y caddy
yum remove -y MariaDB-*
yum remove -y php-*
代码: 全选
apt-get remove -y caddy
apt-get remove -y mariadb-*
# for example: php_ver=[7.4|8.0|8.1|8.2|8.3|8.4]
php_ver="8.2"
apt-get remove -y php${php_ver}-*
Caddy Location Path
Web root location /data/www/default
Main Configuration File /etc/caddy/Caddyfile
Sites Configuration Folder /etc/caddy/conf.d/
MariaDB Location Path
Data Location /var/lib/mysql
my.cnf File (rpm) /etc/my.cnf
my.cnf File (deb) /etc/mysql/my.cnf
PHP Location Path
php-fpm File (rpm) /etc/php-fpm.d/www.conf
php-fpm File (deb) /etc/php/${php_ver}/fpm/pool.d/www.conf
php.ini File (rpm) /etc/php.ini
php.ini File (deb) /etc/php/${php_ver}/fpm/php.ini
相关管理命令:
Process Command
Caddy systemctl [start|stop|status|restart] caddy
MariaDB systemctl [start|stop|status|restart] mariadb
PHP (rpm) systemctl [start|stop|status|restart] php-fpm
PHP (deb) systemctl [start|stop|status|restart] php${php_ver}-fpm
LCMP命令:
Command Description
lcmp start Start all of LCMP services
lcmp stop Stop all of LCMP services
lcmp restart Restart all of LCMP services
lcmp status Check all of LCMP services status
lcmp version Print all of LCMP software version
lcmp vhost add Create a new Caddy virtual host
lcmp vhost list List all of Caddy virtual hosts
lcmp vhost del Delete a Caddy virtual host
lcmp db add Create a MariaDB database and a user with same name
lcmp db list List all of MariaDB databases
lcmp db del Delete a MariaDB database and a user with same name
lcmp db edit Update a MariaDB database username's password
相关问题提交:
https://github.com/teddysun/lcmp/issues 或者 i@teddysun.com
https://github.com/teddysun/lcmp
https://teddysun.com/700.html