我有一个配置有许多虚拟主机的 Apache 服务器,并且希望能够像这样使用 grep 过滤它们。
# httpd -S | grep "myStr"
.. 但是,这种方法不起作用 - 我仍然看到列出了我的所有虚拟主机。有什么想法我可以实际做到这一点吗?
这是 httpd -S 的输出示例
[root@224136 config]# httpd -S
VirtualHost configuration:
184.22.xxx.33:80 is a NameVirtualHost
default server default (/etc/httpd/conf/kloxo/default.conf:4)
port 80 namevhost default (/etc/httpd/conf/kloxo/default.conf:4)
port 80 namevhost webmail (/etc/httpd/conf/kloxo/webmail.conf:6)
port 80 namevhost xxxxxx.com (/home/httpd/xxxxxx.com/conf/kloxo.xxxxxxx.com:4)
port 80 namevhost twptest.xxxxxx.com (/home/httpd/twptest.xxxxxx.com/conf/kloxo.twptest.xxxxxx.com:4)
port 80 namevhost yyyyyyy.com (/home/httpd/yyyyyy.com/conf/kloxo.yyyyyyy.com:4)
port 80 namevhost zzzzzzzz.com (/home/httpd/zzzzzzz.com/conf/kloxo.zzzzzzzz.com:4)
port 80 namevhost expenses.zzzzzzzz.com (/home/httpd/expenses.zzzzzzz.com/conf/kloxo.expenses.zzzzzzz.com:4)
port 80 namevhost aaaaaaaa.cz (/home/httpd/aaaaaaaaaaaa.cz/conf/kloxo.aaaaaaaaaaa.cz:4)
port 80 namevhost aaaaaaaaaaa.cz (/home/httpd/aaaaaaaaaaaaa.cz/conf/kloxo.aaaaaaaaaa.cz:142)