Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dirk Dankhoff
ISPConfig 3
Commits
2a6eaceb
Commit
2a6eaceb
authored
Jun 22, 2010
by
tbrehm
Browse files
Fixed some awstats problems.
parent
58c2101b
Changes
6
Hide whitespace changes
Inline
Side-by-side
install/tpl/server.ini.master
View file @
2a6eaceb
...
...
@@ -49,7 +49,7 @@ htaccess_allow_override=All
awstats_conf_dir=/etc/awstats
awstats_data_dir=/var/lib/awstats
awstats_pl=/usr/lib/cgi-bin/awstats.pl
awstats_
updateall
_pl=/usr/share/
doc/
awstats/
example
s/awstats_
updateall
.pl
awstats_
buildstaticpages
_pl=/usr/share/awstats/
tool
s/awstats_
buildstaticpages
.pl
[dns]
bind_user=root
...
...
interface/web/admin/form/server_config.tform.php
View file @
2a6eaceb
...
...
@@ -463,7 +463,7 @@ $form["tabs"]['web'] = array (
'width'
=>
'40'
,
'maxlength'
=>
'255'
),
'awstats_
updateall
_pl'
=>
array
(
'awstats_
buildstaticpages
_pl'
=>
array
(
'datatype'
=>
'VARCHAR'
,
'formtype'
=>
'TEXT'
,
'default'
=>
''
,
...
...
interface/web/admin/lib/lang/en_server_config.lng
View file @
2a6eaceb
...
...
@@ -68,5 +68,5 @@ $wb["htaccess_allow_override_error_empty"] = '.htaccess AllowOverride is empty.'
$wb
[
"awstats_conf_dir_txt"
]
=
'awstats conf folder'
;
$wb
[
"awstats_data_dir_txt"
]
=
'awstats data folder'
;
$wb
[
"awstats_pl_txt"
]
=
'awstats.pl script'
;
$wb
[
"awstats_
updateall
_pl_txt"
]
=
'awstats_
updateal
l script'
;
$wb
[
"awstats_
buildstaticpages
_pl_txt"
]
=
'awstats_
buildstaticpages.p
l script'
;
?>
\ No newline at end of file
interface/web/admin/templates/server_config_web_edit.htm
View file @
2a6eaceb
...
...
@@ -74,8 +74,8 @@
<input
name=
"awstats_pl"
id=
"awstats_pl"
value=
"{tmpl_var name='awstats_pl'}"
size=
"40"
maxlength=
"255"
type=
"text"
class=
"textInput"
/>
</div>
<div
class=
"ctrlHolder"
>
<label
for=
"awstats_
updateall
_pl"
>
{tmpl_var name='awstats_
updateall
_pl_txt'}
</label>
<input
name=
"awstats_
updateall
_pl"
id=
"awstats_
updateall
_pl"
value=
"{tmpl_var name='awstats_
updateall
_pl'}"
size=
"40"
maxlength=
"255"
type=
"text"
class=
"textInput"
/>
<label
for=
"awstats_
buildstaticpages
_pl"
>
{tmpl_var name='awstats_
buildstaticpages
_pl_txt'}
</label>
<input
name=
"awstats_
buildstaticpages
_pl"
id=
"awstats_
buildstaticpages
_pl"
value=
"{tmpl_var name='awstats_
buildstaticpages
_pl'}"
size=
"40"
maxlength=
"255"
type=
"text"
class=
"textInput"
/>
</div>
</fieldset>
...
...
server/cron_daily.php
View file @
2a6eaceb
...
...
@@ -168,19 +168,20 @@ foreach($records as $rec) {
$domain
=
escapeshellcmd
(
$rec
[
"domain"
]);
$statsdir
=
escapeshellcmd
(
$rec
[
"document_root"
]
.
'/web/stats'
);
$awstats_pl
=
$web_config
[
'awstats_pl'
];
$awstats_
updateall
_pl
=
$web_config
[
'awstats_
updateall
_pl'
];
$awstats_
buildstaticpages
_pl
=
$web_config
[
'awstats_
buildstaticpages
_pl'
];
if
(
!@
is_dir
(
$statsdir
))
mkdir
(
$statsdir
);
// awstats_buildstaticpages.pl -update -config=mydomain.com -lang=en -dir=/var/www/domain.com/web/stats -awstatsprog=/path/to/awstats.pl
$command
=
"
$awstats_
updateall
_pl
-update -config='
$domain
' -lang=en -dir='
$statsdir
' -awstatsprog='
$awstats_pl
'"
;
$command
=
"
$awstats_
buildstaticpages
_pl
-update -config='
$domain
' -lang=en -dir='
$statsdir
' -awstatsprog='
$awstats_pl
'"
;
if
(
$awstats_pl
!=
''
&&
$awstats_
updateall
_pl
!=
''
&&
fileowner
(
$awstats_pl
)
==
0
&&
fileowner
(
$awstats_
updateall
_pl
)
==
0
)
{
if
(
$awstats_pl
!=
''
&&
$awstats_
buildstaticpages
_pl
!=
''
&&
fileowner
(
$awstats_pl
)
==
0
&&
fileowner
(
$awstats_
buildstaticpages
_pl
)
==
0
)
{
exec
(
$command
);
rename
(
$rec
[
"document_root"
]
.
'/web/stats/awstats.'
.
$domain
.
'.html'
,
$rec
[
"document_root"
]
.
'/web/stats/index.html'
);
$app
->
log
(
"Created awstats statistics with command:
$command
"
,
LOGLEVEL_DEBUG
);
}
else
{
$app
->
log
(
"No awstats statistics created. Either
$awstats_pl
or
$awstats_
updateall
_pl
is not owned by root user."
,
LOGLEVEL_WARN
);
$app
->
log
(
"No awstats statistics created. Either
$awstats_pl
or
$awstats_
buildstaticpages
_pl
is not owned by root user."
,
LOGLEVEL_WARN
);
}
}
...
...
server/plugins-available/apache2_plugin.inc.php
View file @
2a6eaceb
...
...
@@ -1211,16 +1211,18 @@ class apache2_plugin {
private
function
awstats_update
(
$data
,
$web_config
)
{
global
$app
;
$awstats_conf_dir
=
$web_config
[
'awstats_conf_dir'
];
if
(
!@
is_file
(
$awstats_conf_dir
.
"/awstats."
.
$data
[
"new"
][
"domain"
]
.
".conf"
)
||
(
$data
[
"old"
][
"domain"
]
!=
''
&&
$data
[
"new"
][
"domain"
]
!=
$data
[
"old"
][
"domain"
]))
{
if
(
@
is_file
(
$awstats_conf_dir
.
"/awstats."
.
$data
[
"old"
][
"domain"
]
.
".conf"
)
)
{
unlink
(
$awstats_conf_dir
.
"/awstats."
.
$data
[
"old"
][
"domain"
]
.
".conf"
);
}
$content
=
''
;
$content
.
=
"Include
'
"
.
$awstats_conf_dir
.
"/awstats.conf
'
\n
"
;
$content
.
=
"LogFile=
'
/var/log/ispconfig/httpd/"
.
$data
[
"new"
][
"domain"
]
.
"/access.log
'
\n
"
;
$content
.
=
"SiteDomain=
'
"
.
$data
[
"new"
][
"domain"
]
.
"
'
\n
"
;
$content
.
=
"HostAliases=
'
www."
.
$data
[
"new"
][
"domain"
]
.
" localhost 127.0.0.1
'
\n
"
;
$content
.
=
"Include
\"
"
.
$awstats_conf_dir
.
"/awstats.conf
\"
\n
"
;
$content
.
=
"LogFile=
\"
/var/log/ispconfig/httpd/"
.
$data
[
"new"
][
"domain"
]
.
"/access.log
\"
\n
"
;
$content
.
=
"SiteDomain=
\"
"
.
$data
[
"new"
][
"domain"
]
.
"
\"
\n
"
;
$content
.
=
"HostAliases=
\"
www."
.
$data
[
"new"
][
"domain"
]
.
" localhost 127.0.0.1
\"
\n
"
;
file_put_contents
(
$awstats_conf_dir
.
'/awstats.'
.
$data
[
"new"
][
"domain"
]
.
'.conf'
,
$content
);
$app
->
log
(
"Created awstats config file: "
.
$awstats_conf_dir
.
'/awstats.'
.
$data
[
"new"
][
"domain"
]
.
'.conf'
,
LOGLEVEL_DEBUG
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment