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来检测部署

部署完成,可访问:

相关推荐
筱顾大牛5 天前
使用docker部署到服务器
docker·部署
色空大师9 天前
【Linux-安装nginx】
linux·运维·前端·nginx·部署
bingyan037112 天前
openclaw-基于ubuntu24安装部署
ubuntu·部署·openclaw
bingyan037113 天前
itop3-基于rockylinux8的itsm工具安装部署
部署·itsm·itop·rockylinux8
色空大师15 天前
【java打包方式详解】
java·开发语言·部署·打包·启动脚本·jar包分离
羊小猪~~18 天前
LLM--大模型快速展示(Gradio)
人工智能·python·大模型·llm·部署·gradio·ai算法
comedate19 天前
[OpenClaw] OpenWebUI 的部署指南
部署·openwebui·openclaw
维度攻城狮1 个月前
Docker 部署 Dify,快速私有化搭建专属知识库问答
人工智能·docker·部署·dify·知识问答
快乐得小萝卜1 个月前
Lss-bev系列-2-部署插件IndexPut
ai·部署·bev·lss
cooldream20091 个月前
Windows11中 WSL2全方位安装与实战指南
linux·部署·wsl