Grepping through the results of apachectl -S

Posted by CamelBlues on Server Fault See other posts from Server Fault or by CamelBlues
Published on 2012-03-23T14:32:58Z Indexed on 2012/03/23 17:31 UTC
Read the original article Hit count: 160

Filed under:
|
|

I have a server with about 300 virtual hosts. When I want to make sure a specific httpd.conf file is loaded into the Virual Host config and the syntax is correct, I run apachectl -S. The problem is, though, I get a ton of output.

I've tried apacectl -S | grep 'foo' and apachectl -S > foo.txt to try and make this data a little bit more manageable, but the output of the command is not conducive to grepping or shoving into a text file.

When I try apachectl -S | grep 'foo', it simply returns the entire output of apachectl -S.

When I try apachectl -S > foo.txt, foo.txt is an empty file.

This may have something to do with how the server is configured, because I am able to successfully grep on my local machine.

Any suggestions?

© Server Fault or respective owner

Related posts about apache2

Related posts about httpd