5
MAC 自运维
source link: https://www.jansora.com/notebook/2
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
查看端口占用进程 lsof -i tcp:8080
lsof -i tcp:8080
查看端口占用并杀死进程
kill -9 `lsof -i tcp:8080`
刷新 DNS
sudo killall -HUP mDNSResponder
mongodb
启动 MongoDB mongod --config /usr/local/etc/mongod.conf
mysql
jansora@Jansora-MacbookPro ~ % mysql.server
Usage: mysql.server {start|stop|restart|reload|force-reload|status} [ MySQL server options ]
jansora@Jansora-MacbookPro ~ % mysql.server start
Starting MySQL
SUCCESS!
jansora@Jansora-MacbookPro ~ % mysql.server status
SUCCESS! MySQL running (1839)
redis
jansora@Jansora-MacbookPro ~ % brew install redis
To have launchd start redis now and restart at login:
brew services start redis
Or, if you don't want/need a background service you can just run:
redis-server /usr/local/etc/redis.conf
nginx
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /usr/local/etc/nginx/servers/.
To have launchd start nginx now and restart at login:
brew services start nginx
Or, if you don't want/need a background service you can just run:
nginx
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK