ngnix随笔一
nginx安装及启动
1.用yum源安装,首先配置yum源 在“/etc/yum.repo.d/”下创建yum源文件
例如:cd /etc/yum.repo.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
2.查看yum源包
yum info nginx 查看nginx安装包源信息版本等
yum install nginx 安装yum源安装包
安装完成后用"nginx -h" 查看nginx应用的命令
[root@ ~]# nginx -h
nginx version: nginx/1.16.
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives] Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-T : test configuration, dump it and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /etc/nginx/)
-c filename : set configuration file (default: /etc/nginx/nginx.conf)
-g directives : set global directives out of configuration file
3.用"nginx"命令启动nginx服务
启动服务后用命令ss -ntlp查看端口和服务的情况
[root@ ~]# ss -ntlp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN *: *:* users:(("rpcbind",pid=,fd=))
LISTEN 0 128 *:80 *:* users:(("nginx",pid=6044,fd=6),("nginx",pid=6043,fd=6),("nginx",pid=5797,fd=6))
LISTEN 192.168.122.1: *:* users:(("dnsmasq",pid=,fd=))
LISTEN *: *:* users:(("sshd",pid=,fd=))
LISTEN 127.0.0.1: *:* users:(("cupsd",pid=,fd=))
LISTEN 127.0.0.1: *:* users:(("sshd",pid=,fd=))
LISTEN ::: :::* users:(("rpcbind",pid=,fd=))
LISTEN ::: :::* users:(("sshd",pid=,fd=))
LISTEN ::: :::* users:(("cupsd",pid=,fd=))
LISTEN ::: :::* users:(("sshd",pid=,fd=))
4.再开通防火墙和80端口即可
firewall-cmd --zone=public --add-port=/tcp --permanent
firewall-cmd --reload
5用其他主机访问IP地址即可
ngnix随笔一的更多相关文章
- ngnix随笔二
ngnix配置文件 1.rpm -ql nginx /etc/logrotate.d/nginx /etc/nginx /etc/nginx/conf.d /etc/nginx/conf.d/defa ...
- ngnix随笔四
1.alias path 例1. =>http://www.a.com/bbs/ root /data/vhosts/; location /bbs/{ alias /data/a.com/; ...
- ngnix随笔三
1.location模块 在server中也可以嵌套location 例 server{ listen 80; server_name www.a.com; root /data/vhosts/; ...
- AI人工智能系列随笔
初探 AI人工智能系列随笔:syntaxnet 初探(1)
- 【置顶】CoreCLR系列随笔
CoreCLR配置系列 在Windows上编译和调试CoreCLR GC探索系列 C++随笔:.NET CoreCLR之GC探索(1) C++随笔:.NET CoreCLR之GC探索(2) C++随笔 ...
- C++随笔:.NET CoreCLR之GC探索(4)
今天继续来 带大家讲解CoreCLR之GC,首先我们继续看这个GCSample,这篇文章是上一篇文章的继续,如果有不清楚的,还请翻到我写的上一篇随笔.下面我们继续: // Initialize fre ...
- C++随笔:从Hello World 探秘CoreCLR的内部(1)
紧接着上次的问题,上次的问题其实很简单,就是HelloWorld.exe运行失败,而本文的目的,就是成功调试HelloWorld这个控制台应用程序. 通过我的寻找,其实是一个名为TryRun的文件出了 ...
- ASP.NET MVC 系列随笔汇总[未完待续……]
ASP.NET MVC 系列随笔汇总[未完待续……] 为了方便大家浏览所以整理一下,有的系列篇幅中不是很全面以后会慢慢的补全的. 学前篇之: ASP.NET MVC学前篇之扩展方法.链式编程 ASP. ...
- 使用Beautiful Soup编写一个爬虫 系列随笔汇总
这几篇博文只是为了记录学习Beautiful Soup的过程,不仅方便自己以后查看,也许能帮到同样在学习这个技术的朋友.通过学习Beautiful Soup基础知识 完成了一个简单的爬虫服务:从all ...
随机推荐
- 代码,绘画,设计常用的颜色名称-16进制HEX编码-RGB编码 对照一览表
排列方式,英文名称的字典序 颜色名 HEX16进制编码 RGB编码 AliceBlue F0F8FF 240,248,255 AntiqueWhite FAEBD7 250,235,215 Aqua ...
- Codeforce-CodeCraft-20 (Div. 2)-A. Grade Allocation
n students are taking an exam. The highest possible score at this exam is m. Let ai be the score of ...
- 数组输出黑科技----fwrite()
fwrite(const void*buffer,size_t size,size_t count,FILE*stream); (1)buffer:是一个指针,对fwrite来说,是要输出数据的地址. ...
- 图论--最短路--Floyd(含路径输出)
#include<bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f #define maxn 1005 int D[ma ...
- muduo网络库源码学习————Exception类
Exception类是为异常捕获而设计,可以获得异常的信息以及栈的回溯信息 (原来的代码没有demangle成员函数,输出的格式比较难看,加了demangle成员函数,利用demangle成员函数可以 ...
- JVM之类加载器、加载过程及双亲委派机制
JVM 的生命周期 虚拟机的启动 Java 虚拟机的启动是通过引导类加载器(bootstrap class loader)创建一个初始类(initial class)来完成的,这个类是由虚拟机的具体实 ...
- K - Painful Bases 状压dp
Painful Bases LightOJ - 1021 这个题目一开始看,感觉有点像数位dp,但是因为是最多有16进制,因为限制了每一个数字都不同最多就有16个数. 所以可以用状压dp,看网上题解是 ...
- 记一次sqoop安装后测试的问题
运行命令: sqoop import --connect "jdbc:mysql://x.x.x.x:3306/intelligent_qa_bms?useUnicode=true& ...
- [hdu5164]ac自动机
中文题目:http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=563&pid=1003 首先贴一下bc的题解 ...
- PAT数列排序
19考研结束了 .. 还有11天PAT甲 题目链接:http://lx.lanqiao.cn/problem.page?gpid=T52 题目大意:训练排序 解题思路: 方法一: 直接用C++里的so ...