SitePoint Sponsor

User Tag List

Results 1 to 21 of 21
  1. #1
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Please Help! client denied by server configuration: problem

    I have had someone tell me that they can't seem to click-thru from my site to another using a clickthru.php script to count the clicks on the link.

    I have had a look at my error logs and all I can see is alot of the following:

    File does not exist:/_________ /______/______/_______/products/403.shtml
    [Fri Mar 25 09:54:58 2005] [error] [client 63.127.62.9] client denied by server configuration: /________/______/______/_______/products/imagesize.php

    I know that some quite a few people are not having problems, but by looking at the error logs, I now also know that there is quite a few people that are have problems and I really need to fix this asap.

    The only problem is that I have tried everything that I can think of. I just can't seem to fix it. I have have changing the file permissions on every file within the directory to 744. I have then changed the permissions on the directory and also the clickthru.php script to 755. But it is still causing problems.

    My error file is still bringing up alot of 403 errors.

    I just have run out of ideas.

    I have .htaccess in that same directory as the clickthru.php script and I can't see that the .htaccess is causing the problem as all it has in it is the url rewrite rules and also a little bit of text so that an index.php file can be changed so that it looks like a index.html file.

    I just hope someone can help me as I really don't know what to do anymore.

    I have now been working on trying to fix this all night. I have now been up for over 24 hours and I am even working into Good Friday just to try and fix it.

    I hope someone can help or give me some suggestions to what the cause may be.

    Thanks All!

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It probably is in the .htaccess (or your httpd vhost if you have one, but i doubt it).
    Can you post the .htaccess ?

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply.

    Heres my file:

    DirectoryIndex index.php
    RewriteEngine On
    RewriteRule ^pdir/([0-9]+)/(.*)/(.*)/(.*)/([0-9]+).html pdir.php?cat=$1&pmin=$2&pmax=$3&ord=$5&page=$6
    RewriteRule ^pdiraz/([0-9]+)/(.*)/(.*)/(.*)/(.*)/([0-9]+).html pdiraz.php?cat=$1&pmin=$2&pmax=$3&alpha=$4&ord=$6&page=$7

    I would also like to mention that this part of my site where the error is happening is on a sub domain.

  4. #4
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have any Order/Deny type rules in your httpd.conf for this vhost (or globally) ?

  5. #5
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Parry Sound, ON
    Posts
    725
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    John, I think you need to post your clickthru script or give us a URL where we can test this.

    However, you might also fix this by prepending slashes:
    RewriteEngine On
    RewriteRule ^pdir/([0-9]+)/(.*)/(.*)/(.*)/([0-9]+).html /pdir.php?cat=$1&pmin=$2&pmax=$3&ord=$5&page=$6
    RewriteRule ^pdiraz/([0-9]+)/(.*)/(.*)/(.*)/(.*)/([0-9]+).html /pdiraz.php?cat=$1&pmin=$2&pmax=$3&alpha=$4&ord=$6&page=$7

    Just a guess though.

  6. #6
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have now done the extra slashes. I will see in about 2 - 5 minutes time if that has worked but I really don't think that will do anything as their not the pages that are causing the error, but they are the pages that has the clickthru.php script obtained within them for the links to external sites.

    Heres a clickthru link:

    http://products.simplysearch4it.com/...p?linkid=16570

    Here's the script:

    PHP Code:
    <?
    if (isset($linkid)){
    $update mysql_query("UPDATE products_search SET prodhits = prodhits + 1 WHERE prodid='$linkid'");

    // Select the requested id on the database..
    $result mysql_query("SELECT productsurl FROM products_search WHERE prodid='$linkid'");

    // Retrieve the data(url) of url field.
    $row mysql_fetch_array($result);
    $url $row[productsurl];

    // Redirect to the url and close the database.
    header("Location: $url");
    }
    mysql_close();
    ?>
    I hope you can help.

    Thanks!

  7. #7
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Where about's can I find this file?

    Quote Originally Posted by markl999
    Do you have any Order/Deny type rules in your httpd.conf for this vhost (or globally) ?

  8. #8
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, things still is not looking good as I have just had about another 50 errors inputed into my error logs, which were all done by [client 24.160.129.190]

    I hope there is some sort of solution to the problem.

  9. #9
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    header("Location: $url");
    Some clients don't like relative redirections so just to be safe try:
    PHP Code:
    header("Location: http://".$_SERVER['HTTP_HOST'].'/'.$url);
    exit; 
    //be sure to add this line 

  10. #10
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just hope that this works markl999 as my site is now near that time of day again where it's hitting its peak amounts of traffic for the day.

    Unfortunately I am now receiving on average about 300 log error messages every 5 - 10 minutes and they are nearly all for the products clickthru part.

    I realised that the clickthru script is producing a 403 error message and I had not had a 403 error page in the sub domain so I have now done that an that should now nearly half my error messages that are being produced from this part of my site. But the main thing that I need to do is to try and get the main cause of the problem fix.

    It really doesn't look good, but now I will try what you mentioned with the click.php script.

    Thanks!

  11. #11
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunately your modification of my script didn't work as it is now redirecting to: http://products.simplysearch4it.com/...ctID=453332863

    Instead of just going to: http://www.shareasale.com/m-pr.cfm?m...ctID=453332863

  12. #12
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, i didn't realize $url was an external url, i thought it was local. Remove my suggested change

  13. #13
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Parry Sound, ON
    Posts
    725
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's extremely weird. It's intermittent. Sometimes it'll work and sometimes it won't. And once it fails, your whole site seems to go down.

    For some reason I don't have LiveHTTPHeaders installed here at home. I'm going to install that and see if I can track this down. In the meantime, is there any auto_prepend script or anything else that runs when click.php is called?

  14. #14
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I have just sorted the error as I have done something and I have not received any more error messages for the particular error for about 10 minutes now.

    I have changed the cmod to 777, what a security risk, but then if it works, I guess I have to work on making it more secure.

  15. #15
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Parry Sound, ON
    Posts
    725
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That doesn't make sense. Why would it work sometimes and not others?

  16. #16
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, No, No and more No's

    I have just refreshed my error log and I have had a load more just come in.

    I am now thinking that there is something wrong with the another script of mine. This script actually displays merchants images on my site and also produces a thumbnail of it and saves it to my server. When a page loads again then and calls the same image, the image is then loaded from my server instead of the merchants so that it can save them bandwidth and also speed up the image loading process for my site.

    The script is as follows:

    I have cmod it to 777, but errors are still coming in.

    PHP Code:
    <?php
    $imagepath 
    "$_GET[image]";
    $dirname "$_GET[mer]";
    if(!
    is_dir("./images/$dirname")) { mkdir("./images/$dirname"); }
    chmod("./images/$dirname"0777);
    $imageexplode end(explode('/'$imagepath));
    $imagen explode('.'$imageexplode);
    $imagey $imagen[0];
    $ext $imagen[1];
    if (
    file_exists("./images/$dirname/$imagey.jpeg")) {
    include(
    "./images/$dirname/$imagey.jpeg");
    exit;
    }
    $width 94;
    $height 94;
    list(
    $widtho$heighto$type) = getimagesize($imagepath);
    if(
    $type == 1){
            
    $image imagecreatefromgif($imagepath);
        
    $exten 'image/gif';
    }else if(
    $type == 2){
            
    $image imagecreatefromjpeg($imagepath);
        
    $exten 'image/jpeg';
    }else if(
    $type == 3){
            
    $image imagecreatefrompng($imagepath);
        
    $exten 'image/png';
    }else if(
    $ext == jpeg){
            
    $image imagecreatefromjpeg($imagepath);
        
    $exten 'image/jpeg';
    }else if(
    $type == 15){
            
    $image imagecreatefromWBMP($imagepath);
        
    $exten 'image/WBMP';
    }
    header("Content-type: $exten");

    if (
    $widtho 70){
    if (
    $width && ($widtho $heighto)) {
       
    $width = ($height $heighto) * $widtho;
    } else {
       
    $height = ($width $widtho) * $heighto;
    }
    $imagedone imagecreatetruecolor($width$height);
    imagefill($imagedone000xFFFFFF);
    imagecopyresampled($imagedone$image0000$width$height$widtho$heighto);
       
    $make "./images/$dirname/$imagey.jpeg";
       
    imagejpeg($imagedone$make75);
       
    imagejpeg($imagedone''75);
       
    ImageDestroy($imagedone);
       
    ImageDestroy($image);
       return 
    $make;
    exit;
    }else if (
    $heighto 70){
    if (
    $width && ($widtho $heighto)) {
       
    $width = ($height $heighto) * $widtho;
    } else {
       
    $height = ($width $widtho) * $heighto;
    }
    $imagedone imagecreatetruecolor($width$height);
    imagefill($imagedone000xFFFFFF);
    imagecopyresampled($imagedone$image0000$width$height$widtho$heighto);
       
    $make "./images/$dirname/$imagey.jpeg";
       
    imagejpeg($imagedone$make75);
       
    imagejpeg($imagedone''75);
       
    ImageDestroy($imagedone);
       
    ImageDestroy($image);
       return 
    $make;
    exit;
    }
    ?>
    The above script is in the same directory as my previous script.

  17. #17
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by HardCoded
    That doesn't make sense. Why would it work sometimes and not others?
    I wish I knew the answer to that question.

    The person who informed me about the problem also mentioned that it works sometimes and then it don't other times.

    I have tried it from here, but I just can't see any problem what so ever untill I have a look at my error logs. That's the only time I can see that something is not quite right.

    The only thing that the click.php script does is increase my hits in mysql by 1 and also redirects to the merchants site.

    I also have another script that is kind of like an auto script and that script is the one mentioned above where it displays merchants images and then saves them if they are not already in my server. Once saved they are then displayed instead of the merchants images to save them bandwidth and to cut down the time for my pages to load.

    I just wish the problem that is occurring was also happening down my end as I could then see more into why this is happening.

    What sort of problems are you having when you say that it's working sometimes and then sometimes it's not?

    Are you receiving the 403 error page?

  18. #18
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Parry Sound, ON
    Posts
    725
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your scripts are fine.

    I think it has to do with your host. They have mod_bwlimited installed. It's possible you've hit some kind of host-imposed limits. Here's a log of a bad transaction:
    Quote Originally Posted by LiveHTTPHeaders
    GET /click.php?linkid=209173 HTTP/1.1
    Host: products.simplysearch4it.com
    User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Referer: http://products.simplysearch4it.com/...dom/asc/1.html

    HTTP/1.x 403 Forbidden
    Date: Fri, 25 Mar 2005 17:05:55 GMT
    Server: Apache/1.3.33 (Unix) mod_gzip/1.3.26.1a mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.10 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a
    Keep-Alive: timeout=15, max=92
    Connection: Keep-Alive
    Transfer-Encoding: chunked
    Content-Type: text/html
    Pretty straight up. No redirects or cookies or anything, just a forbidden on a file which is clearly not forbidden.

    Talk to your host.

  19. #19
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have just looked at my error logs again and the main to problems that I am receiving is errors at my click.php page and also my imageresize.php page.

    These are shown as follows:

    client denied by server configuration: /_____/_____/______/______/products/click.php
    [Fri Mar 25 12:05:48 2005] [error] [client 69.158.175.177] client denied by server configuration: /_____/_____/______/______/products/imagesize.php

    I hope the problem can be resolved soon. I have practically run out of ideas.

  20. #20
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK!

    Thanks and how you managed to get all that information I really don't know, but thanks.

    I will now talk to my host.

  21. #21
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Parry Sound, ON
    Posts
    725
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •