Print
Parent Category: Tutorials
Hits: 60331

 

Here is a nice tutorial fo those that are using ISPConfig and wish to use webalizer or have custom logs

First you need to make a backup of /root/ispconfig.

Then you can add in /root/ispconfig/scripts/lib/config.lib.php the WEB_CUSTOM_LOG section:

 

$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");

 

After that you can customize the vhost template in /root/ispconfig/isp/conf/vhost.conf.master:

 

<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>

For troubleshooting watch the logs:

/home/admispconfig/ispconfig/ispconfig.log

You can also disable httpd sintax checks:

/home/admispconfig/ispconfig/lib/config.inc.php:

$go_info["server"]["httpd_check"] = 1;

Note:

We use Hosting and VPS Hosting, from: www.star-host.org

We like and trust them.

Good prices, high security.