安装Nginx
更新homebrew
$ brew update
查看nginx信息
$ brew search nginx
安装nginx
$ brew install nginx
对应的配置文件地址在/etc/nginx/nginx.conf
配置文件
nginx默认使用8080端口,如果发现端口被占用了,可以杀掉使用使用改端口的进程。
当然,也可以修改配置文件(/etc/nginx/nginx.conf)中指定的端口值:
http {
server {
listen 8181;
server_name localhost;
#charset koi8-r;
.....
}
}
Nginx 操作
启动
以指定配置文件路径的方式启动
$ nginx -c /etc/nginx/nginx.conf
##重启
$ nginx -s reload
##关闭
$ nginx -s stop
查看 nginx 是否已经启动
$ ps -ef|grep nginx
Reference
- MAC下安装nginx - https://segmentfault.com/a/1190000016020328
FEATURED TAGS
algorithm
algorithmproblem
architecturalpattern
architecture
aws
c#
cachesystem
codis
compile
concurrentcontrol
database
dataformat
datastructure
debug
design
designpattern
distributedsystem
django
docker
domain
engineering
freebsd
git
golang
grafana
hackintosh
hadoop
hardware
hexo
http
hugo
ios
iot
java
javaee
javascript
kafka
kubernetes
linux
linuxcommand
linuxio
lock
macos
markdown
microservices
mysql
nas
network
networkprogramming
nginx
node.js
npm
oop
openwrt
operatingsystem
padavan
performance
programming
prometheus
protobuf
python
redis
router
security
shell
software testing
spring
sql
systemdesign
truenas
ubuntu
vmware
vpn
windows
wmware
wordpress
xml
zookeeper