Internal 500 Error when Accessing Stats

Discussion in 'Developers' Forum' started by astewart, Nov 17, 2008.

  1. astewart

    astewart ISPConfig Developer ISPConfig Developer

    I am getting an Internal Server 500 Error when trying to access the webalizer stats for all my domains.

    I am prompted for a password when I go to: http://www.domain.com/stats, after that it takes me to the error.

    I follows the instructions when installing ISPCONFIG which included the installation of webalizer.

    Everything else is working fine, except this :(

    Anyone have any ideas?
    Should the stats folder belong to www-data or the specific user name and group?
     
  2. astewart

    astewart ISPConfig Developer ISPConfig Developer

    .htaccess file

    I found out that I had an old .htaccess file from when I migrated the web directory over. I simply removed it and now I have access to the stats.

    One question though: Now anyone can access the stats without authentication. Is there suppose to be an .htaccess file or not?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    The .htaccess authentication is recreated nightly during the next webalizer run.
     
  4. astewart

    astewart ISPConfig Developer ISPConfig Developer

    Thanks Til, thats what I was thinking too but it appears that the webalizer job (/etc/cron.daily/) does not create the .htaccess file. It does update the Stats but thats about it.

    Does anyone have a sample of .htaccess file that is used to authenticate users to there own Stats?

    Thanks
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Please do not mix up the webalizer cronjob in of the linux system with the one used by ispconfig. The ispconfig webalizer cronjob creates it, not the one in /etc/cron.daily/. All ispconfif cronjobs are in the root crontab.
     
  6. astewart

    astewart ISPConfig Developer ISPConfig Developer


    I just noticed that ispconfig has a cron_daily.sh located in '/usr/local/ispconfig/server/'. This kicks off the cron_daily.php which is also in the same location.

    I have verified the Webalizer section and there is no mention of the creation of the .htaccess file:

    Code:
    #######################################################################################################
    // Create webalizer statistics
    #######################################################################################################
    
    
    $sql = "SELECT domain_id, domain, document_root FROM web_domain WHERE server_id = ".$conf["server_id"];
    $records = $app->db->queryAllRecords($sql);
    foreach($records as $rec) {
            $yesterday = date("mdY",time() - 86400);
            $logfile = escapeshellcmd($rec["document_root"].'/log/'.$yesterday.'-access.log');
            if(@is_file($logfile)) {
                    $domain = escapeshellcmd($rec["domain"]);
                    $statsdir = escapeshellcmd($rec["document_root"].'/web/stats');
                    $webalizer = '/usr/bin/webalizer';
                    $webalizer_conf = '/etc/webalizer/webalizer.conf';
                    if(!@is_dir($statsdir)) mkdir($statsdir);
                    exec("$webalizer -c $webalizer_conf -n $domain -s $domain -r $domain -q -T -o $statsdir $logfile");
            }
    }
    
    The /etc/webalizer/webalizer.conf file didn't see to have any helpful information either.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    about which ispconfig version are you talking?
     
  8. astewart

    astewart ISPConfig Developer ISPConfig Developer

    I'm running the latest ISPConfig 3.x SVN Repository version
     
  9. astewart

    astewart ISPConfig Developer ISPConfig Developer

    Here is an example of the .htaccess for Webalizer from an ispconfig 2 installation:

    Code:
    AuthType Basic
    AuthName "Members Only"
    AuthUserFile /var/www/web12/.htpasswd
    <limit GET PUT POST>
    require valid-user
    </limit>
    
    With ispconfig 3, there seems to be no .htpasswd, so I'm wondering how I can link this to the specified users for that domain?

    Thanks
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Ahh ok, that explains my confusion. ISPConfig 3 does not has a password protection for the statistics yet.
     
  11. astewart

    astewart ISPConfig Developer ISPConfig Developer

    Alright, that makes much more sense now, lol

    I should of mentioned what version i was currently running.

    Thanks Till
     

Share This Page