1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Every Time I deny an IP I get an internal server error. What's Wrong?

Discussion in 'Site & Server Administration' started by Skinny, Feb 20, 2006.

  1. #1
    Okay, I've been getting comment spam on my blog.

    So, I have tried to ban the IPs. The thing is that when I do my whole site goes crazy and it only displays a page that says an internal server error has occured.

    If I replace the .htaccess file everything is okay.

    Here is the error from the log:
    SEMrush
    What's wrong here? I have gotten these errors only when I modify my .htacess file.

    Now I'm not too worried about the comment spam as every comment is moderated, but what is the problem here.

    Skinny
     
    Skinny, Feb 20, 2006 IP
    SEMrush
  2. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It would be helpful to know how you are trying to block the IP to figure out what went wrong.
     
    tflight, Feb 20, 2006 IP
  3. Skinny

    Skinny Peon

    Messages:
    1,865
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Oh,

    sorry. I know little about server side of things. I go into Cpanel and hit IP Deny Manager.

    Then I just paste in the IP and hit Deny (I think that's the button).

    It then denies it, but it creates an error and my site becomes inaccesible.

    Skinny
     
    Skinny, Feb 20, 2006 IP
  4. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I don't use cpanel, but you mentioned that replacing the .htaccess file fixes the problem. Can you post what your .htaccess file looks like when it is "broken"?
     
    tflight, Feb 20, 2006 IP
  5. Skinny

    Skinny Peon

    Messages:
    1,865
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Here it is

     
    Skinny, Feb 20, 2006 IP
  6. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Okay, I see a problem on the very last line of that file. You have two items there, the first is "php_flag register_globals off" and the second is "deny from 203.177.64.155". The second part is probably what is causing the problem.

    Move "deny from 203.177.64.155" which is at the very bottom of the file to directly under the last set of similar instructions.... to the line below "deny from 72.14.194.25". Then the end of your .htaccess would look like this:

     
    tflight, Feb 20, 2006 IP
    Skinny likes this.
  7. Skinny

    Skinny Peon

    Messages:
    1,865
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thank you Tflight. I never looked at the file. I guess the IP Deny manager was adding the deny line at the end of the file to bunch it with the list already made.

    I threw in that other code and didn't realize that.

    Thanks again.

    Skinny
     
    Skinny, Feb 20, 2006 IP
  8. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Great, glad it is solved. That is one of the reasons I don't use cpanel. :)
     
    tflight, Feb 20, 2006 IP