Gentoo Linux部署LNMP

一、安装nginx

1.gentoo-chxf ~ # emerge -av nginx


提示配置文件需更新

2.gentoo-chxf ~ # etc-update

3.gentoo-chxf ~ # emerge -av nginx


4.查看并启动nginx

gentoo-chxf ~ # systemctl status nginx

gentoo-chxf ~ # systemctl start nginx

gentoo-chxf ~ # systemctl enable nginx

二、安装mariadb

1.gentoo-chxf /etc/nginx # emerge -av mariadb

2.gentoo-chxf /etc/mysql # emerge --config =dev-db/mariadb-10.6.17

3.查看并启动mariadb

gentoo-chxf /etc/mysql # systemctl status mysqld

gentoo-chxf /etc/mysql # systemctl start mysqld

gentoo-chxf /etc/mysql # systemctl enable mysqld

4.可登录数据库

三、安装php

1.#emerge -av php

发现少了一些扩展

2.补充php扩展

(1)#cd /etc/portage/package.use

(2)#vim php

dev-lang/php iconv mbstring curl openssl tokenizer soap ctype zip zlib gd simplexml spl pcre dom xml xmlreader intl json hash fileinfo sodium exif memory_limit file_uploads opcache mysqli pdo fpm sockets bcmath

(3)#etc-update

3.emerge -av dev-lang/php

(1)gentoo-chxf /etc/portage/package.use # emerge -av dev-lang/php

提示更新配置文件

编译安装(过程截图)



(2)gentoo-chxf /etc/portage/package.use # emerge --config =mail-mta/nullmailer-2.2-r2

4.查看并启动php

gentoo-chxf /usr/lib/systemd/system # systemctl status [email protected]

gentoo-chxf /usr/lib/systemd/system # systemctl start [email protected]

gentoo-chxf /usr/lib/systemd/system # systemctl enable [email protected]

四、部署LNMP

1.查看nginx、mariadb、php运行情况

2.部署lnmp

思路:

(1)php连接mariadb:安装已自动完成;

(2)php->php-fpm.sock;

#vim www.conf

重启php-fpm

gentoo-chxf /etc/php/fpm-php8.2/fpm.d # systemctl restart [email protected]

(3)nginx->php-fpm.sock


重启nginx

gentoo-chxf /etc/php/fpm-php8.2/fpm.d # systemctl restart nginx

3.用phpinfo.php来检测部署

部署完成,可访问:

相关推荐
☆凡尘清心☆6 天前
LNMP环境中php7.2升级到php7.4
linux·nginx·centos·lnmp
☆凡尘清心☆6 天前
CentOS 7 环境中部署 LNMP(Linux + Nginx + MySQL 5.7 + PHP)
linux·nginx·centos·lnmp
Think Spatial 空间思维12 天前
【SSL部署与优化】OCSP Stapling配置指南:减少证书验证延迟
网络·网络协议·https·部署·ssl·优化
小草cys16 天前
EXO分布式部署deepseek r1
分布式·部署·推理·deepseek
Think Spatial 空间思维18 天前
【SSL部署与优化】HTTP/2与HTTPS的协同效应
安全·http·https·部署·ssl·优化
问道飞鱼20 天前
【大数据知识】今天聊聊Clickhouse部署方案
大数据·clickhouse·部署
Think Spatial 空间思维22 天前
【SSL部署与优化】如何为网站启用HTTPS:从Let‘s Encrypt免费证书到Nginx配置
nginx·https·证书·部署·ssl·配置·优化
Violet_Stray1 个月前
【Ollama】docker离线部署Ollama+deepseek
docker·部署·ollama·deepseek
不确定性确定你我2 个月前
使用 kind 创建 K8s 集群并部署 StarRocks 的完整指南
starrocks·云原生·kubernetes·部署·kind