web.log and webalizer

Discussion in 'Installation/Configuration' started by Lobanak, Sep 11, 2005.

  1. Lobanak

    Lobanak New Member

    Hi all!

    First I must say ISPconfig is very good. I like it very much.

    But now I have one problem with webalizer and the stats.

    /root/ispconfig/scripts/shell/webalizer.php (started by cron) is searching for the file web.log in the log directory of the webs. But this file is not generated. There is only the file error.log. In /etc/apache2/vhosts/Vhosts_ispconfig.conf there is no entry for the CustomLog in the virtualhosts.

    I searched a bit and have noticed, that the entries are missing in /root/ispconfig/isp/conf/vhost.conf.master and /root/ispconfig/scripts/lib/config.lib.php.

    I think this should be corrected in the next release, so that webalizer is working. I use V.2.0.8.

    I don't know if the following is right, but I think this could be the solution (not tested). If this is right, please tell here.

    in /root/ispconfig/scripts/lib/config.lib.php the WEB_CUSTOM_LOG
    Code:
    $mod->tpl->assign( array( SERVERNAME => $servername.$web_port,
                            IP => $web["web_ip"].$web_port,
                            DOCUMENTROOT => $document_root,
                            SERVERALIAS => $serveralias,
                            DIRECTORYINDEX => $directory_index,
                            CGI => $cgi,
    			WEB_CUSTOM_LOG => $mod->system->server_conf["server_path_httpd_root"]."/web".$web["doc_id"]."/log/web.log combined",
                            WEB_ERROR_LOG => $mod->system->server_conf["server_path_httpd_root"]."/web".$web["doc_id"]."/log/error.log",
                            SERVERADMIN => "webmaster@".$web["web_domain"],
                            PHP => $php,
                            SSI => $ssi,
                            WAP => $wap,
                            ERRORALIAS => $error_alias,
                            ERROR => $error,
                            WEB => "web".$web["doc_id"],
                            HTTPD_INCLUDE => $web_httpd_include,
                            SUEXEC => $suexec,
                            REWRITE_RULE => $rewrite_rule,
                            FRONTPAGE => $frontpage,
                            SSL => $ssl,
                            HTTPD_ROOT => $mod->system->server_conf["server_path_httpd_root"]));
        $mod->tpl->parse(VHOST,".vhost");
      }
      } else {
      $mod->tpl->assign( array( SERVERNAME => "",
                            IP => "",
                            DOCUMENTROOT => "",
                            SERVERALIAS => "",
                            DIRECTORYINDEX => "",
                            CGI => "",
    			WEB_CUSTOM_LOG => "",
                            WEB_ERROR_LOG => "",
                            SERVERADMIN => "",
                            PHP => "",
                            SSI => "",
                            WAP => "",
                            ERRORALIAS => "",
                            ERROR => "",
                            WEB => "",
                            HTTPD_INCLUDE => "",
                            SUEXEC => "",
                            REWRITE_RULE => "",
                            FRONTPAGE => "",
                            SSL => "",
                            HTTPD_ROOT => ""));
        $mod->tpl->parse(VHOST,".vhost");
    in /root/ispconfig/isp/conf/vhost.conf.master the CustomLog
    Code:
    <VirtualHost {IP}>
    {HTTPD_INCLUDE}
    {SUEXEC}
    ServerName {SERVERNAME}
    ServerAdmin {SERVERADMIN}
    DocumentRoot {DOCUMENTROOT}
    {SERVERALIAS}
    {DIRECTORYINDEX}
    {CGI}
    CustomLog {WEB_CUSTOM_LOG}
    ErrorLog {WEB_ERROR_LOG}
    {PHP}
    {SSI}
    {WAP}
    {ERRORALIAS}
    {ERROR}
    AliasMatch ^/~([^/]+)(/(.*))? {HTTPD_ROOT}/{WEB}/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? {HTTPD_ROOT}/{WEB}/user/$1/web/$3
    {REWRITE_RULE}
    {FRONTPAGE}
    </VirtualHost>
    Greets

    Lobanak
     
    Last edited: Sep 11, 2005
  2. till

    till Super Moderator

    Hi,

    it is correct that there are no custom log entries in the vhosts. This would slowdown ISPConfig and will limit the number of websites you can host. In your solution, systems with apache 1.3.x and more that 150 websites will get unstable.

    ISPConfig uses another approach for logging that is much more scalable.

    There is a custom logfile written to the directory

    /var/log/httpd

    that contains the access logdata for all websites. This logfile is splitted nightly by a cronjob and the splitted logs are appended to the web.log files in the log directorys of the websites before the webalizer script is run.
     
  3. Lobanak

    Lobanak New Member

    Thx for the fast answer.

    I think the problem then was, that cron was not running.

    But what script do the splitting? I want to run it manually now.

    Greets

    Lobanak
     
  4. till

    till Super Moderator

    The script is:

    /root/ispconfig/scripts/shell/logs.php

    I recommend not run the script manually. It splits only the logfile of last day. If you run the script after 12 AM, the script will split todays logfiles.
     
  5. falko

    falko Super Moderator

    web.log should be a symlink to the actual file. The symlink does not exist either?
     

Share This Page