NGINX冲泡install命令未找到 [英] NGINX brew install command not found

查看:190
本文介绍了NGINX冲泡install命令未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$ brew install nginx

和获取:

==> Downloading http://nginx.org/download/nginx-1.2.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/nginx-1.2.2.tar.gz
==> Patching
patching file conf/nginx.conf
==> ./configure --prefix=/usr/local/Cellar/nginx/1.2.2 --with-http_ssl_module --with-pcre         --with-ipv6 --with-cc-opt=-I/usr/local/include --with-ld-opt=-L/usr/local/lib --conf
==> make
==> make install
==> Caveats
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.

If you want to host pages on your local machine to the public, you should 
change that to localhost:80, and run `sudo nginx`. You'll need to turn off
any other web servers running port 80, of course.

You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/nginx/1.2.2/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist

Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http's default of 80.)
Warning: /usr/local/sbin is not in your PATH
You can amend this by altering your ~/.bashrc file 

我有这在我的〜/ .bashrc文件:

I have this in my ~/.bashrc file:

 export PATH=$PATH:/usr/local/sbin

当我运行nginx的-v或sudo nginx的-t我得到这样的:

When I run nginx -v or sudo nginx -t i get this:

-bash: nginx: command not found

我已没有安装正确nginx的?

have I not installed nginx properly?

推荐答案

运行回声$ PATH,并在/ usr / local / sbin中出现?
如果不:
试试你的采购〜/ .bashrc文件,看看它出现:源的〜/ .bashrc

run echo $PATH, does /usr/local/sbin appear? if not: Try sourcing your ~/.bashrc file and see if it appears: source ~/.bashrc

再次运行回声$ PATH。它应该apear。

run echo $PATH again. It should apear.

这篇关于NGINX冲泡install命令未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆