1
A
回答
2
最有可能是因为你不在具有命令的用户环境。
例如,如果您是root用户,则可以使用su -
,然后尝试httpd -v
。
否则,请使用完整路径。在我的情况是这样的:
/usr/sbin/httpd -v
这可能是您的系统上不同的地方,但这是特定文件的位置,即使我的安装位置为:/etc/httpd/
0
的httpd
位置可可以看出这样的:
只要输入您的终端:
# whereis httpd
,你应该看到类似的东西
# whereis httpd
httpd: /usr/sbin/httpd /etc/httpd
这将是你的路径到apache程序。
如果你不是管理员或不是sudoer组的成员,这个程序的输出是有限的。
您将无法读取,检查,配置大多数配置文件。所有通过ssh访问共享主机帐户的人都会遇到这种情况。只有一些基本的数据可用。任何需要root访问权限会给你的错误:
#/usr/sbin/httpd -V
/usr/sbin/httpd: line 63: ulimit: open files: cannot modify limit: Operation not permitted
/usr/sbin/httpd: line 64: ulimit: open files: cannot modify limit: Operation not permitted
/usr/sbin/httpd: line 65: ulimit: open files: cannot modify limit: Operation not permitted
或类似的:
# /usr/sbin/httpd -S
/usr/sbin/httpd: line 63: ulimit: open files: cannot modify limit: Operation not permitted
/usr/sbin/httpd: line 64: ulimit: open files: cannot modify limit: Operation not permitted
/usr/sbin/httpd: line 65: ulimit: open files: cannot modify limit: Operation not permitted
httpd: Could not open configuration file /usr/local/apache/conf/httpd.conf: Permission denied
附:
BTW,Apache documentation不建议直接调用httpd
程序,而改用apachectl
相关问题
- 1. 检查失败的新版本
- 2. 检查OpenSSL版本> = 0.9.8a ...失败打开ssl apache http-server Mac OS X El Capitan
- 3. Apache Ranger检查安装的版本
- 4. 在Apache中配置版本检查
- 5. 如何覆盖npm安装版本检查失败?
- 6. Cordova在CLI上构建iOS版本失败的codesign检查
- 7. 问题安装eclim for Eclipse(版本检查失败)macOS
- 8. 检查iPhone设备版本在设备上失败
- 9. 检查putIfAbsent失败
- 10. os.path.isdir检查失败
- 11. 在Apache配置中检测Apache版本?
- 12. 在脚本中检查SSH失败
- 13. 如何检查脚本是否失败
- 14. Install4J版本解包失败
- 15. maven版本:执行失败
- 16. 发布版本:transformClassesAndResourcesWithProguardForRelease失败
- 17. Git版本1.9.3推失败
- 18. Apache Cordova Visual Studio 2015 Remotebuild iOS版本> Http 404:安装失败:检查您的供应配置文件
- 19. Breakpad进程检查失败
- 20. 运行时检查失败
- 21. UIDragInteractionDelegate检查将失败
- 22. 检查var_dump条件失败
- 23. WCF身份检查失败
- 24. 检查UITableView canMoveRowAtIndexPath失败
- 25. 与失败的检查
- 26. 超类检查respondsToSelector失败
- 27. npm更新检查失败
- 28. 铬扩展检查失败
- 29. 检查是否runSequence失败
- 30. cmake find_path/find_library失败检查