1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

install on iis7

Discussion in 'BF2Statistics discussion' started by modderhut, Jun 16, 2009.

  1. modderhut

    modderhut New Member

    Hi,

    I took on the challege to install bf statistics on windows server 2008 with IIS 7. I've installed PHP using fastcgi and created a *.aspx mapping to the same fast-cgi exe as php uses.
    I keep getting the YOUR NOT AUTHORIZED when I go to localhost/asp The php info file works like it should.

    anyone a pointer in the right direction for me?

    thanks,
     
  2. Thinner

    Thinner New Member

    Hi and Welcome,

    please have a look at the readme again.

    7. With a Web Browser, browse to: http://localhost/ASP/
    Note: If you are browsing from a remote machine, please change the value of $admin_hosts
    in /ASP/_config.php to include your IP address.

    If this doesn't solve your problem, please post content of $admin_hosts in /ASP/_config.php and describe your network. Perhaps you should add your whole subnet e.g. '192.168.32.0/24'

    Only if you are browsing from your server you can open h**p://localhost/ASP/
    If you are browsing from a client you need to open h**p://your-server-ip/ASP/ or h**p://your-server-hostname/ASP/


    bye
    Thinner
     
  3. modderhut

    modderhut New Member

    Hi Thinner,

    Thanks for your quick reply.

    off course stupidity from my side is an absolute option ;) I believe I have followed the readme to the letter;
    $admin_hosts = array('127.0.0.1','192.168.1.0/24');

    this is all runnung on 1 machine, with IP 192.168.1.101, and I'm also doing all testing from that machine.

    when I change the error message in _config.php I see the change in localhost/ASP so indeed it's stopping me because of the auth check ... still not able to figure out why..

    Thanks.
     
  4. Thinner

    Thinner New Member

    Hi,

    i'm sorry, but i don't know your skills.

    Please note that i don't know anything about IIS7 and W2k8, so i can only guess.

    auth-check is taken in index.php

    Code:
    if (!checkIpAuth($cfg->get('admin_hosts'))) {
    die("ERROR: You are NOT Authorised to access this Page!");
    }
    function checkIpAuth is in /includes/utils.php

    Code:
    function checkIpAuth($chkhosts) {
    if(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR']!="") {
    $ip_s = $_SERVER['REMOTE_ADDR'];
    }
    
    echo $ip_s;  // add this
    
    if ($ip_s != "" && isIPInNetArray($ip_s,$chkhosts)){
    return 1;	// Authorised HOST IP
    } else {
    return 0;	// UnAuthorised HOST IP
    }
    }
    I would add the echo $ip_s; to make sure $_SERVER['REMOTE_ADDR'] works as aspected.
    If you see your ip on /localhost/ASP i would go on to functions isIPInNetArray/isIPInNet and add some "echo" to narrow down the problem.

    In the meanwhile i will search for my W2k8 install-cd. ;-)

    [EDIT]
    cd found, but having troubles with dvd-drive, can't install

    bye
    Thinner
     
  5. Leon_tbk

    Leon_tbk Member

    Do not forget this bug: http://www.bf2statistics.com/e107_plugins/forum/forum_viewtopic.php?5021
     
  6. modderhut

    modderhut New Member

    Hi,

    SOLVED

    thanks you so mutch for pointing me in the right direction, the echo was somthing that helpded a lot, stupid I didn't think of that. It showed me ::1 (the IPv6 localhost IP) as you can't disble IPv6 in srv2008 I have edited the $admin_hosts as follwes.
    $admin_hosts = array('::1','127.0.0.1','192.168.1.0/24');

    also had to change the php.ini to prevent the php displaying index errors;
    error_reporting = E_ALL
    to
    error_reporting = E_USER_NOTICE


    Thanks again, I'll no go on a bump into the next challenge!
     
  7. modderhut

    modderhut New Member

    thanks, appreciated!