LNMP(Linux、Nginx、MySQL、PHP)安装部署
16lz
2021-03-23
LNMP是Linux、Nginx、MySQL、PHP的缩写,是指在Linux环境下由Nginx、MySQL、PHP构建的Web后台运行环境,是一种流行先进、便捷轻便、高性能的一后台环境。
我们今天介绍如何在支持yum源安装的系统上部署LNMP环境。
Nginx安装和启动
安装
yum install nginx
启动和停止
service nginx startservice nginx stop#或者systemctl start nginxsystemctl stop nginx
目录位置
运行文件: /usr/sbin/nginx
配置文件目录: /etc/nginx
日志文件目录: /var/nginx
MySQL安装
参见文档:
https://blog.51cto.com/livestreaming/2128571
PHP安装
参见文档:
https://blog.51cto.com/livestreaming/2092166
https://blog.51cto.com/livestreaming/2092162
Nginx配置支持PHP
以下配置打epoll、sendfile,可以多更好的并发和静态文件响应性能。
#使用deamon用户运行,注意对应目录的读写权限设置。user daemon; #开启四个进程worker_processes 4;worker_rlimit_nofile 5120;events { use epoll; worker_connections 5000;}http { include mime.types; #default_type application/octet-stream; access_log off; #文件缓存优化 open_file_cache max=2000 inactive=60s; open_file_cache_valid 60s; open_file_cache_min_uses 2; open_file_cache_errors on; output_buffers 2 32k; client_max_body_size 1m; keepalive_timeout 65; server { listen 80; server_name localhost; charset utf-8; sendfile on; root /var/www/; index index.php index.html index.htm; error_page 500 502 503 504 404 403 /error.html; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }}
您的赞赏是最大的鼓励!
赞赏
0人进行了赞赏支持
更多相关文章
- Centos7 安装mysql-8.0.22
- 处理恢复[honestandhope@qq.com].makop勒索病毒makop文件方案
- Nginx架构详解:nginx 的安装和配置
- 跟我自学linux第一天面试作业题
- 高效、易用、功能强大的 api 管理平台
- 强大的开源企业级数据库监控利器Lepus
- 学习第三周
- 虚拟机安装Linux复盘
- Linux下源码安装mysql5.7.33