|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: [URGENT] Apache dies because of incorrect configuration files [message #96672 is a reply to message #96607] |
Fri, 16 March 2012 05:47   |
Spacedust  Messages: 1233 Registered: October 2007 Location: Poland |
Senior Master |
|
|
Again today, my script fixes again !
Syntax error on line 30 of /home/apache/conf/domains/zino36.conf:
RUidGid takes two arguments, Minimal uid or gid file/dir, else set[ug]id to default (User,Group)
19:17 15 Mar 89.70.2.xx zino36 domain noclegi.xxx.pl update phpinfo
19:17 15 Mar 89.70.2.xx zino36 domain turystykaixxx.pl update phpinfo
19:17 15 Mar 89.70.2.xx zino36 domain noclegi.xxx.pl update phpinfo
[Updated on: Fri, 16 March 2012 05:48] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: [URGENT] Apache dies because of incorrect configuration files [message #97405 is a reply to message #96478] |
Thu, 05 April 2012 11:55   |
Spacedust  Messages: 1233 Registered: October 2007 Location: Poland |
Senior Master |
|
|
Is started to happen to me too !
Here's the code, replace mail@domain.com with your e-mail:
Save this as a webcheck.sh in /root and add to cron job:
* * * * * sh /root/webcheck.sh
#!/bin/bash
if /etc/init.d/httpd start 2> /tmp/webcheck.sh
cat /tmp/webcheck.sh | grep /home/apache
then
echo "WWW Server is having incorrect configuration !";
/bin/mail -s "Warning ! WWW Server is having incorrect configuration !" mail@domain.com < /tmp/webcheck.sh
echo fixing WWW server config...
sed -i '$d' /tmp/webcheck.sh;
sed -i 's/\(.\{24\}\)//' /tmp/webcheck.sh;
sed -i 's/\(.*\)./\1/' /tmp/webcheck.sh;
sed -i 's/of /rm -f /g' /tmp/webcheck.sh;
sh /tmp/webcheck.sh;
rm -f /tmp/webcheck.sh;
/etc/init.d/httpd start;
else
echo "WWW server is working ok!";
fi
[Updated on: Tue, 10 April 2012 15:52] Report message to a moderator
|
|
|
| Re: [URGENT] Apache dies because of incorrect configuration files [message #97410 is a reply to message #97403] |
Thu, 05 April 2012 16:37   |
|
shazar wrote on Thu, 05 April 2012 10:38Are you sure it doesn't work? If you did what I wrote before the 6.1.12 update, then the update would have overwritten your changes.
I am 100% sure, line is comented out and i have been trying all day to replicate but no luck, happend twice on two config files in 8h period.
Thanks spacedust i will sleep at night peacefull until this gets fixed....
|
|
|
| Re: [URGENT] Apache dies because of incorrect configuration files [message #97418 is a reply to message #97405] |
Fri, 06 April 2012 06:09   |
|
Spacedust wrote on Thu, 05 April 2012 11:55Is started to happen to me too !
Here's the code, replace mail@domain.com with your e-mail:
Save this as a webcheck.sh in /root and add to cron job:
* * * * * sh /root/webcheck.sh
#!/bin/bash
if /etc/init.d/httpd start 2> /tmp/webcheck.sh
cat /tmp/webcheck.sh | grep /home/apache
then
echo "WWW Server is having incorrect configuration !";
/bin/mail -s "Warning ! WWW Server is having incorrect configuration !" mail@domain.com < /tmp/webcheck.sh
echo fixing WWW server config...
sed -i '$d' /tmp/webcheck2.sh;
sed -i 's/\(.\{24\}\)//' /tmp/webcheck.sh;
sed -i 's/\(.*\)./\1/' /tmp/webcheck.sh;
sed -i 's/of /rm -f /g' /tmp/webcheck.sh;
sh /tmp/webcheck.sh;
rm -f /tmp/webcheck.sh;
/etc/init.d/httpd start;
else
echo "WWW server is working ok!";
fi
Can you explain a bit how this work, i am curious?
|
|
|
|
|
| Re: [URGENT] Apache dies because of incorrect configuration files [message #97520 is a reply to message #97462] |
Tue, 10 April 2012 15:52   |
Spacedust  Messages: 1233 Registered: October 2007 Location: Poland |
Senior Master |
|
|
Additional script, just in case server is having incorrect config, but it's not stopping. This is just causing new domains not to be shown. The following script will fix that problem:
#!/bin/bash
if /usr/sbin/httpd -t > /tmp/webcheck2.sh
cat /tmp/webcheck2.sh | grep /home/apache
then
echo "WWW Server is having incorrect configuration !";
/bin/mail -s "Warning ! WWW Server is having incorrect configuration !" mail@domain.com < /tmp/webcheck2.sh
echo fixing WWW server config...
sed -i '$d' /tmp/webcheck2.sh;
sed -i 's/\(.\{24\}\)//' /tmp/webcheck2.sh;
sed -i 's/\(.*\)./\1/' /tmp/webcheck2.sh;
sed -i 's/of /rm -f /g' /tmp/webcheck2.sh;
sh /tmp/webcheck2.sh;
rm -f /tmp/webcheck2.sh;
/etc/init.d/httpd restart;
else
echo "WWW server is working ok!";
fi
Also fixed small typo in the first script.
[Updated on: Tue, 10 April 2012 15:52] Report message to a moderator
|
|
|