Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 12th March 2009, 02:31
bwragg bwragg is offline
Member
 
Join Date: Jul 2006
Posts: 58
Thanks: 7
Thanked 3 Times in 2 Posts
Default Apache Directive errors

Hi,

I've had a problem quite a few times with clients setting Apache Directives and wondered if anyone had a solution. What happens is a client can accidently make an error in an apache directive, save the changes and then ISPConfig tries to save it. When I check the ISPconfig log it does a check on the conf which fails so it automatically rolls back to the last working conf settings.

This is fantastic as apache keeps running, except the user doesn't know they have made a mistake and neither do I. I've even had it happen that days later changes I make aren't being saved, I check the logs and find that someone set a bad directive on another site days ago.

So I was just wondering if anyone knows a way to notify them or me that their is an error which a change they have just made?

Thanks,

bwragg
Reply With Quote
Sponsored Links
  #2  
Old 12th March 2009, 11:15
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,438
Thanks: 813
Thanked 5,209 Times in 4,085 Posts
Default

Take a look at the apache directive field, if a user enters there something wrong the apache directives get commented out to notice the user.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 16th March 2009, 06:09
bwragg bwragg is offline
Member
 
Join Date: Jul 2006
Posts: 58
Thanks: 7
Thanked 3 Times in 2 Posts
Default

thanks till. That woluld be great but I just checked this with the problem that the user had the other day. They entered a redirect but accidently had a new line after the directory like this:

Code:
Redirect 301 /email <new line here>
http://www.theirsite.com/their_directory
instead of

Code:
Redirect 301 /email http://www.theirsite.com/their_directory
the ispconfig log reports this when the above is saved:

Quote:
16.03.2009 - 16:03:48 => WARN - /root/ispconfig/scripts/lib/config.lib.php, Line 2604: WARNING: could not httpd -t &> /dev/null
16.03.2009 - 16:03:48 => WARN - /root/ispconfig/scripts/lib/config.lib.php, Line 2616: httpd syntax seems to contain errors, reloading with old configuration
16.03.2009 - 16:03:48 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 2617: mv -f /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf_16-03-09_16-03-48
16.03.2009 - 16:03:48 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 2618: mv -f /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf~ /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf
But when I go back into the directives box in the control panel it has the original setting uncommented. Any ideas?
Reply With Quote
  #4  
Old 16th March 2009, 13:59
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

Quote:
Originally Posted by bwragg View Post
thanks till. That woluld be great but I just checked this with the problem that the user had the other day. They entered a redirect but accidently had a new line after the directory like this:

Code:
Redirect 301 /email <new line here>
http://www.theirsite.com/their_directory
instead of

Code:
Redirect 301 /email http://www.theirsite.com/their_directory
What does
Code:
httpd -t
show?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 19th March 2009, 05:29
bwragg bwragg is offline
Member
 
Join Date: Jul 2006
Posts: 58
Thanks: 7
Thanked 3 Times in 2 Posts
Default

It says
Quote:
"Syntax OK"
.

When I add a dodgy directive it still says the same (because it rolls back to the last working configuration)
Reply With Quote
  #6  
Old 19th March 2009, 09:15
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,438
Thanks: 813
Thanked 5,209 Times in 4,085 Posts
Default

You have to check the file with the date appended and not the one that was rolled back. Run:

mv /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf.bak
mv /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf_16-03-09_16-03-48 /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf

httpd -t

mv /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf.bak /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 24th March 2009, 21:48
bwragg bwragg is offline
Member
 
Join Date: Jul 2006
Posts: 58
Thanks: 7
Thanked 3 Times in 2 Posts
Default

Sorry Till, I thought Falko may have been checking I didn't have some other problem in the file.

When I do this as expected it complains about the directive I set in error:

Code:
Syntax error on line 27 of /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf_25-03-09_07-46-27:
URL to redirect to is missing
Still its not #'ing out the lines in the directives box.
Reply With Quote
  #8  
Old 25th March 2009, 14:24
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

Can you post line 27 of /etc/httpd/conf/vhost/Vhosts_ispconfig.conf_25-03-09_07-46-27?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 12th May 2009, 08:16
bwragg bwragg is offline
Member
 
Join Date: Jul 2006
Posts: 58
Thanks: 7
Thanked 3 Times in 2 Posts
Default

Sorry for the delay. Line 27 is the line I've already posted:

Quote:
Line 27: Redirect 301 /email <new line here>
Line 28: http://www.theirsite.com/their_directory
Reply With Quote
  #10  
Old 13th May 2009, 11:54
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
 
Default

I guess the correct line should be
Code:
Redirect 301 /email http://www.theirsite.com/their_directory
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Proftpd + MySQL virtual users, can't connect geekman HOWTO-Related Questions 28 27th September 2010 18:03
FTP cannot open remote folder!?! andysm849 Server Operation 23 16th October 2008 23:34
add web site serr57 Installation/Configuration 18 13th April 2008 11:40
CENTOS 5 Ping Problem gAnDo Server Operation 11 28th March 2008 20:58
Can't start apache Musty Server Operation 12 9th March 2008 13:58


All times are GMT +2. The time now is 14:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.