0

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)
                                                           [FAILED]

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.

Spacedust
  • 558
  • 5
  • 12
  • 28

1 Answers1

1

Try

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

It redirects also STDERR to STDOUT.

Janne Pikkarainen
  • 31,454
  • 4
  • 56
  • 78