如何建立公司企业网站,中国风网站怎么配色,企业电话查询黄页,北京互联网公司排行榜目录
一、Nginx是什么
二、Ubuntu 系统下安装 Nginx
1、安装包下载
2、上传服务器并解压缩
3、依赖配置安装
4、生成编译脚本
5、编译
6、开始安装
7、设置为随机自启动
7.1、创建 nginx.service 文件#xff0c;将以下内容粘贴到文件中
7.2、将 nginx.service…
目录
一、Nginx是什么
二、Ubuntu 系统下安装 Nginx
1、安装包下载
2、上传服务器并解压缩
3、依赖配置安装
4、生成编译脚本
5、编译
6、开始安装
7、设置为随机自启动
7.1、创建 nginx.service 文件将以下内容粘贴到文件中
7.2、将 nginx.service 放入 /etc/systemd/system/ 下,并授权
7.3、配置重新加载
7.4、开启Nginx随机自启服务
7.5、 启动Nginx
7.6、查看服务状态 一、Nginx是什么
是一个高性能的 HTTP 和反向代理 web 服务器同时也提供了 IMAP/POP3/SMTP 服务。是一款轻量级的 Web 服务器/反向代理服务器及电子邮件IMAP/POP3代理服务器在BSD-like 协议下发行。其特点是占有内存少并发能力强。
二、Ubuntu 系统下安装 Nginx
1、安装包下载
地址https://nginx.org/download/
2、上传服务器并解压缩 tar -zxvf nginx-1.16.1.tar.gz 3、依赖配置安装 sudo apt install gcc make libpcre3-dev zlib1g-dev openssl libssl-dev 4、生成编译脚本 ./configure --prefix/usr/local/nginx --with-http_ssl_module 5、编译 make 编译完成 6、开始安装 make install 查看是否安装成功 7、设置为随机自启动
7.1、创建 nginx.service 文件将以下内容粘贴到文件中
Descriptionnginx - high performance web server
Afternetwork.target remote-fs.target nss-lookup.target
[Service]
Typeforking
ExecStart/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload/usr/local/nginx/sbin/nginx -s reload
ExecStop/usr/local/nginx/sbin/nginx -s stop
[Install]
WantedBymulti-user.target7.2、将 nginx.service 放入 /etc/systemd/system/ 下,并授权 chmod 777 nginx.service 7.3、配置重新加载 systemctl daemon-reload 7.4、开启Nginx随机自启服务 systemctl enable nginx.service 7.5、 启动Nginx systemctl start nginx.service 7.6、查看服务状态 systemctl status nginx.service ⚠️⚠️⚠️若发现以下错误这是因为 80 端口已经被其他进行占用导致 Nginx 无法绑定到 80 端口上可尝试查询端口占用进程并终止该进程。