Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Some of my apache configs are failing like this (because of a bug in control panel, but I need a workaround till this gonna be fixed):

/etc/init.d/httpd start
Starting httpd: Syntax error on line 30 of /home/apache/conf/domains/mydomain.conf:
RUidGid takes two arguments, Minimal uid or gid file/dir, else set[ug]id to default (User,Group)

I would like to write a script that will automatically remove such configs, but when I type /etc/init.d/httpd start >> error.log nothing is written to file. The same happens when I try to grep a line from /etc/init.d/httpd start | grep Syntax.

share|improve this question


/etc/init.d/httpd start 2>&1 >>error.log

It redirects also STDERR to STDOUT.

share|improve this answer
No, it still writes only [FAILED] to log file – Spacedust Mar 13 '12 at 12:34
Got it ! It should be: /etc/init.d/httpd start 2> error.log – Spacedust Mar 13 '12 at 12:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.