没有合适的资源?快使用搜索试试~ 我知道了~
首页ubuntu 20.04上搭建LNMP环境的方法步骤
ubuntu 20.04上搭建LNMP环境的方法步骤
1.7k 浏览量
更新于2023-05-28
评论 1
收藏 552KB PDF 举报
主要介绍了ubuntu 20.04上搭建LNMP环境的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
资源详情
资源评论
资源推荐

ubuntu 20.04上搭建上搭建LNMP环境的方法步骤环境的方法步骤
主要介绍了ubuntu 20.04上搭建LNMP环境的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学
习学习吧
简单说明简单说明
由于之前是用Centos7搭建的,后来使用ubuntu 20.04的系统做为个人开发环境,所以想在ubuntu上也搭建一下环境,和Centos有一些小区别所以记录一下仅供学习。
安装前准备安装前准备
下载软件:
php:7.3.18
nginx:1.18.0
mariadb:10.5.4
解压文件:解压文件:
tar zxf php-7.3.18.tar.gz
tar zxf mariadb-10.5.4.tar.gz
tar zxf nginx-1.18.0.tar.gz
安装安装Nginx
sudo groupadd -r nginx && sudo useradd -r -g nginx -s /sbin/nologin -d /usr/local/nginx nginx
sudo apt install -y libpcre3-dev zlib1g-dev
cd /home/allen/下载/nginx-1.18.0
./configure --user=nginx --group=nginx
make -j 4 && sudo make install
sudo /usr/local/nginx/sbin/nginx -t
#nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
#nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
sudo mv /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.back
sudo vim /usr/local/nginx/conf/nginx.conf
user nginx;
worker_processes 4;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
log_format main '$remote_addr || $remote_user || $time_local || $request || $status || $body_bytes_sent || $http_referer || $http_user_agent || $http_x_forwarded_for';
include /data/www/*/*.conf;
}
sudo chown -R nginx:nginx /usr/local/nginx
sudo vim /lib/systemd/system/nginx.service
[Unit]
Description=nginx
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
sudo systemctl enable nginx
#Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /lib/systemd/system/nginx.service.
reboot
重启后看看有没有启动成功



















weixin_38685876
- 粉丝: 4
- 资源: 927
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
安全验证
文档复制为VIP权益,开通VIP直接复制

评论0