简单的LNMP环境配置
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,LNMP环境: L:linux N:nginx M:mysql P:phpLinux系统就没什么好说的了。这里是centos 7.6nginx安装yum -y install epel-rel
千家信息网最后更新 2025年12月02日简单的LNMP环境配置
LNMP环境:
L:linux
N:nginx
M:mysql
P:php
Linux系统就没什么好说的了。这里是centos 7.6
nginx安装
yum -y install epel-releaseyum -y install nginxPHP安装
yum -y install php php-fpm php-curl php-intl php-mcrypt php-mysql php-mbstring php-xml php-dom php-gd gd用redis为mysql做缓存时,添加下列 php-cli php-common php-pdo php-devel php-xmlrpc php-bcmath php-dba php-enchantnginx +PHP 环境配置
(nginx + php-fpm +fastcgi)
vim /etv/nginx/nginx.conf
location ~\.php$ { root /webroot/farm; fastcgi_pass 127.0.0.1:9000; #与php-fpm通信的方式 fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;通信方式:nginx和php-fpm的通信方式有两种,一种是socket形式,一种是tcp形式。配置两种方式都可以,但是必须保证nginx配置的监听方式,和php-fpm.conf配置的监听方式保持一致性!推荐使用TCP方式也就是方式1,可以跨服务器。 php配置:/etc/php-fpm.conf或者/etc/php-fpm.d/xx.conf方式1:php-fpm.conf: listen = 127.0.0.1:9000nginx.conf: fastcgi_pass 127.0.0.1:9000;方式2:php-fpm.conf: listen = /tmp/php-fpm.socknginx.conf: fastcgi_pass unix:/tmp/php-fpm.sock;其中php-fpm.sock是一个文件,由php-fpm生成,类型是srw-rw----.vim /etv/php.ini
#short_open_tag = off 改为如下:short_open_tag = on #打开短标签上面配置完成就可以在nginx上部署php项目了。
安装mysql
[root@newrain ~]# wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm[root@newrain ~]# rpm -ivh mysql80-community-release-el7-3.noarch.rpm [root@newrain ~]# vim /etc/yum.repos.d/mysql-community.repo [mysql57-community]name=MySQL 5.7 Community Serverbaseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/enabled=1 将0改为1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql[mysql80-community]name=MySQL 8.0 Community Serverbaseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/enabled=0 将1改为0gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql[root@newrain ~]# yum -y install mysql-server mysql启动&开机启动
[root@newrain ~]# systemctl start nginx[root@newrain ~]# systemctl start mysqld [root@newrain ~]# systemctl start php-fpm[root@newrain ~]# systemctl enable nginx[root@newrain ~]# systemctl enable mysqld[root@newrain ~]# systemctl enable php-fpm
方式
配置
通信
环境
形式
监听
好说
一致
没什么
一致性
也就是
成就
文件
服务器
标签
类型
系统
缓存
项目
保证
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
网络安全监控安装规范
黑暗逃生没有服务器选择
互联网未来金融科技怎么走
数据库三大关系运算
互联网科技类公众号排行榜
数据库文件目录
x86服务器的raid卡通用吗
700亿的网络安全市场
我国网络安全四个威胁
大华平台服务器ip
王者服务器
电力系统网络安全标准体系
张店物流竞价报价软件开发服务
泰安软件开发外包公司
电脑只能在网络安全模式下没声音
超级支付互联网科技有限公司
企业里软件开发一般做什么
电子科技大学网络安全就业前景
win7能否安装数据库
ae里面无法获取动态链路服务器
软件开发平台 作用
甘州区网络安全
软件开发的方法与步骤
一个任务关联多个任务数据库
用户软件开发
国产串口通讯服务器生产
软件开发业务能力评价
手机网络安全问答
英雄联盟如何确定玩家服务器
查看数据库表索引的命令