安装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
algorithm-problem
architectural-pattern
architecture
aws
c#
cache-system
codis
concurrent-control
data-format
data-structure
database
debug
design
design-pattern
distributed-system
django
docker
engineering
engingeering
freebsd
git
golang
grafana
hackintosh
hardware
hexo
http
hugo
ios
iot
java
java-ee
javascript
kafka
kubernetes
linux
lock
macos
markdown
microservices
mysql
nas
network
network-programming
nginx
node.js
npm
oop
openwrt
operating-system
operating-systems
padavan
performance
programming
prometheus
protobuf
python
redis
router
security
shell
software-testing
spring
sql
truenas
ubuntu
vmware
vpn
windows
wmware
wordpress
zookeeper