mac os x下nginx开机自启动
2015-10-27 13:43
656 查看
来自:http://hushicai.com/2013/09/21/mac-os-x-xia-nginx-kai-ji-zi-qi-dong.html
按照apple developer官网所说的,用户的开机自启动任务一般都需要在以下目录建立一个plist文件:
/Library/LaunchDaemons/
/Library/LaunchAgents/
~/Library/LaunchAgents/我们在
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>nginx</string>
<key>Program</key>
<string>/usr/local/nginx/sbin/nginx</string>
<key>KeepAlive</key>
<true/>
<key>NetworkState</key>
<true/>
<key>LaunchOnlyOnce</key>
<true/>
</dict>
</plist>加载:
launchctl load /Library/LaunchDaemons/nginx.plist成功!
按照apple developer官网所说的,用户的开机自启动任务一般都需要在以下目录建立一个plist文件:
/Library/LaunchDaemons/
/Library/LaunchAgents/
~/Library/LaunchAgents/我们在
/Library/LaunchDaemons下新建一个
nginx.plist文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>nginx</string>
<key>Program</key>
<string>/usr/local/nginx/sbin/nginx</string>
<key>KeepAlive</key>
<true/>
<key>NetworkState</key>
<true/>
<key>LaunchOnlyOnce</key>
<true/>
</dict>
</plist>加载:
launchctl load /Library/LaunchDaemons/nginx.plist成功!
相关文章推荐
- 使用nginx负载平衡
- centos下配置nginx支持php
- CentOS 7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14
- Nginx_修改Web服务器头信息(Header)里的Server值[转]
- Mac OS X 下编译安装 Nginx
- CentOS 7 用户怎样安装 LNMP(Nginx+PHP+MySQL)
- nginx禁止访问.git文件的设置教程(nginx过滤.git文件夹)
- nginx重写规则报nginx: [emerg] directive "rewrite" is not terminated by ";"
- 安装nginx和启动命令
- 启动php-fpm和nginx
- keepalived实现nginx的高可用(双主模型)
- nginx+php
- 安装nginx实录
- nginx平滑升级
- Nginx安装部署
- nginx+nginx-rtmp-module+ffmpeg搭建流媒体服务器
- nginx rewrite模块探究与实验
- nginx之负载均衡
- Nginx日志分割配置
- 新版 nginx内置变量 大全解释