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 php-fpm@8.2.service

gentoo-chxf /usr/lib/systemd/system # systemctl start php-fpm@8.2.service

gentoo-chxf /usr/lib/systemd/system # systemctl enable php-fpm@8.2.service

四、部署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 php-fpm@8.2.service

(3)nginx->php-fpm.sock


重启nginx

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

3.用phpinfo.php来检测部署

部署完成,可访问:

相关推荐
养肥胖虎1 天前
Docker学习笔记:后端、数据库和反向代理怎么一起跑起来
后端·nginx·docker·postgresql·go·部署
江上清风山间明月6 天前
Nginx基于域名区分的多网站部署
运维·nginx·部署·php·多个网站
=蜗牛=9 天前
Docker 简单部署 ClickHouse 超详细图文步骤
clickhouse·docker·容器·部署·图文
小北的AI科技分享11 天前
API管理工具怎么选?这篇讲透核心要点
部署·应用·集成
m0_6316533115 天前
阿里云单机双网终极部署与运维白皮书:Nginx + PM2 + Prisma 踩坑实战
运维·nginx·阿里云·部署
x_lrong20 天前
昇腾Ascend环境微调部署Qwen3(LlamaFactory+vLLM-Ascend)
微调·部署·昇腾·ascend·llamafactory·qwen3·vllm-ascend
筱顾大牛1 个月前
使用docker部署到服务器
docker·部署
色空大师1 个月前
【Linux-安装nginx】
linux·运维·前端·nginx·部署
bingyan03711 个月前
openclaw-基于ubuntu24安装部署
ubuntu·部署·openclaw
bingyan03711 个月前
itop3-基于rockylinux8的itsm工具安装部署
部署·itsm·itop·rockylinux8