error creating stats dir
Hello,
this script it's perfect. i never have problem with it.
But i reinstall my server and reinstall this plugin and now when user clic on "Install AwStats on this domain*"
the stats dir in domain directory not created.
i check /usr/local/directadmin/plugins/awstats/user/index.html and i see nothing about this rep. So i have add this:
after:
Hello,
this script it's perfect. i never have problem with it.
But i reinstall my server and reinstall this plugin and now when user clic on "Install AwStats on this domain*"
the stats dir in domain directory not created.
i check /usr/local/directadmin/plugins/awstats/user/index.html and i see nothing about this rep. So i have add this:
$location2=$_SERVER["HOME"]."/domains/$domains[$awdomain]/stats";
echo "Checking if there is already something installed..<BR>";
if (file_exists($location2)) echo "AwStats Directory already exists on domain<BR>";
else {
echo "Creating AwStats dir on domain<BR>";
mkdir($location2);
echo "Setting Directory Permissions";
chgrp($location2,$_SERVER['USER']);
}
after:
it's work, but i don't now if it's the good solution or if i must do something else.$location=$_SERVER["HOME"]."/domains/$domains[$awdomain]/public_html/awstats";
echo "Checking if there is already something installed..<BR>";
if (file_exists($location)) echo "AwStats Directory already exists on domain<BR>";
else {
echo "Creating AwStats dir on domain<BR>";
mkdir($location);
echo "Setting Directory Permissions";
chgrp($location,$_SERVER['USER']);
}