apachectl 在两个位置造成困难

Nat*_*ord 1 mac apache-http-server macos

我正在 mac OS-X (10.8.3) 上设置开发环境。

我的apachectl似乎是指/opt/usr/sbin/apachectl

$ sudo apachectl start
$ ps aux | grep httpd | grep -v grep
_www             898   0.0  0.0  2436168    704   ??  S    11:46AM   0:00.00 /usr/sbin/httpd -D FOREGROUND
root             897   0.0  0.1  2436168   4308   ??  Ss   11:46AM   0:00.18 /usr/sbin/httpd -D FOREGROUND
Run Code Online (Sandbox Code Playgroud)

但是,apachectlin/opt/local/apache2/bin/apachectl似乎正在为我的本地机器驱动(正确配置的)网络服务器。

$ sudo /opt/local/apache2/bin/apachectl start
$ ps aux | grep httpd | grep -v grep
_www             916   0.0  0.0  2455992    688   ??  S    11:47AM   0:00.00 /opt/local/apache2/bin/httpd -k start
_www             915   0.0  0.0  2455992    688   ??  S    11:47AM   0:00.00 /opt/local/apache2/bin/httpd -k start
Run Code Online (Sandbox Code Playgroud)

我安装了 MAMP,然后才意识到我不想要它并删除它。据我所知apachectl,没有别名:

$ alias
alias ll='ls -la'
$
Run Code Online (Sandbox Code Playgroud)

所以我不确定,除了删除apachectlin 之外/usr/sbin/,如何更正这个 - 并且只有一个新的别名。这似乎是一个非常不干净的解决方案。任何人都可以提供有关如何重新连接我的 mac 使其不再有此问题的指示吗?或者甚至验证所apachectl指向的内容(或如何更改)?谢谢!

Nat*_*n C 5

是否whereis apachectl给出任何输出?那会告诉你它指向哪里。如果您在两个位置拥有它,那么其中一个很可能是另一个的符号链接。您可以验证这ls -l一点,如果有,它会指出一个符号链接。