Apache Directive errors

Discussion in 'General' started by bwragg, Mar 12, 2009.

  1. bwragg

    bwragg New Member

    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
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    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.
     
  3. bwragg

    bwragg New Member

    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 [I]<new line here>[/I]
    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:

    But when I go back into the directives box in the control panel it has the original setting uncommented. Any ideas?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    What does
    Code:
    httpd -t
    show?
     
  5. bwragg

    bwragg New Member

    It says
    .

    When I add a dodgy directive it still says the same (because it rolls back to the last working configuration)
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    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
     
  7. bwragg

    bwragg New Member

    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.
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Can you post line 27 of /etc/httpd/conf/vhost/Vhosts_ispconfig.conf_25-03-09_07-46-27?
     
  9. bwragg

    bwragg New Member

  10. falko

    falko Super Moderator Howtoforge Staff

    I guess the correct line should be
    Code:
    Redirect 301 /email http://www.theirsite.com/their_directory
     
  11. bwragg

    bwragg New Member

    Yes thats right, but my problem isn't the directive its how ispconfig deals with it. As I mentioned in my first post:

    Till said that

    But ispconfig never comments the lines out. Is this happening to any other users?

    Thanks,

    bwragg
     
    Last edited: May 19, 2009
  12. bwragg

    bwragg New Member

    Is anyone else having this problem?

    Thanks,

    bwragg
     
  13. falko

    falko Super Moderator Howtoforge Staff

    I've never had this problem... :confused:
     

Share This Page