惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 找不到Object

57.基于springboot+vue的宠物领养平台 达梦数据库导出表结构到excel中 vware中centos虚拟机系统和宿主使用同一局域网 Excel中利用vba代码导出图片时以某一单元格内容重命名 vware中ubuntu虚拟机系统和宿主使用同一局域网 mysql查询近几天sql centos7离线安装docker liunx虚拟机VMware增加磁盘空间后,挂载磁盘 liunx服务器22端口开启 centos 7 NTP离线安装部署 nginx常用配置说明 centos7通过docker安装mysql centos7下安装docker VMware 虚拟机下CentOS 7连接网络 在JSP中使用el函数标签获取默认值(男女性别选项) ssm登录与退出 MVC(Model -View-Controller)实例应用模式 MVC模式 设计模式浅谈
centos7安装nginx
找不到Object · 2021-06-03 · via 博客园 - 找不到Object

一、下载linux的安装包  https://nginx.org/en/download.html

二、解压 tar -zxvf nginx-1.12.0.tar.gz

三、下载依赖的库文件

    1  yum install pcre

    2  yum install pcre-devel

    3   yum install zlib

    4 yum install zlib-devel

四、进行configure配置

    cd /work/nginx-1.20.1   && ./configure --prefix=/work/nginx

五、编译安装(  cd 到解压好的nginx-1.20.1,这个目录下安装编译) make && make install

六、启动Nginx

    执行完5步骤后,cd 到/work/nginx目录下。执行ls,可以看到四个目录

    conf----配置文件  html----网页文件  logs-----日志文件  sbin------主要二进制程序

     启动命令:  /usr/local/ngnix/sbin/nginx    (无参数) 启动    (-s  stop)关闭    (-s reload)重启


七、查看

查看是否成功     ps -ef | grep nginx 

失败的可能       80端口被占用了。    netstat -ano | grep 80

八、设置开机启动  cd /lib/systemd/system/

创建文件

vim nginx.service

内容为:

[Unit]
Description=nginx service
After=network.target

[Service]
Type=forking
ExecStart=/work/nginx/sbin/nginx
ExecReload=/work/nginx/sbin/nginx -s reload
ExecStop=/work/nginx/sbin/nginx -s quit
PrivateTmp=true

[Install]
WantedBy=multi-user.target

内容解释:

[Unit]:服务的说明
Description:描述服务
After:描述服务类别
[Service]服务运行参数的设置
Type=forking是后台运行的形式
ExecStart为服务的具体运行命令
ExecReload为重启命令
ExecStop为停止命令
PrivateTmp=True表示给服务分配独立的临时空间
注意:[Service]的启动、重启、停止命令全部要求使用绝对路径

八、加入开机自启动   systemctl enable nginx   取消开机启动  systemctl disable nginx

# systemctl start nginx.service  启动nginx服务
# systemctl stop nginx.service  停止服务
# systemctl restart nginx.service  重新启动服务
# systemctl list-units --type=service 查看所有已启动的服务
# systemctl status nginx.service 查看服务当前状态
# systemctl enable nginx.service 设置开机自启动
# systemctl disable nginx.service 停止开机自启动