本文整理汇总了PHP中unix::APACHE_SRC_GROUP方法的典型用法代码示例。如果您正苦于以下问题:PHP unix::APACHE_SRC_GROUP方法的具体用法?PHP unix::APACHE_SRC_GROUP怎么用?PHP unix::APACHE_SRC_GROUP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unix
的用法示例。
在下文中一共展示了unix::APACHE_SRC_GROUP方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
function build()
{
$unix = new unix();
$sock = new sockets();
$users = new usersMenus();
$APACHE_MODULES_PATH = $users->APACHE_MODULES_PATH;
if ($GLOBALS["OUTPUT"]) {
echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Apache modules in \"{$APACHE_MODULES_PATH}\"\n";
}
$ZarafaApachePort = $sock->GET_INFO("ZarafaApachePort");
$ZarafaApacheSSL = $sock->GET_INFO("ZarafaApacheSSL");
$LighttpdArticaDisableSSLv2 = $sock->GET_INFO("LighttpdArticaDisableSSLv2");
$ZarafaWebNTLM = $sock->GET_INFO("ZarafaWebNTLM");
$ZarafaApacheServerName = $sock->GET_INFO("ZarafaApacheServerName");
if (!is_numeric($ZarafaWebNTLM)) {
$ZarafaWebNTLM = 0;
}
if (!is_numeric($LighttpdArticaDisableSSLv2)) {
$LighttpdArticaDisableSSLv2 = 0;
}
if (!is_numeric($ZarafaApacheSSL)) {
$ZarafaApacheSSL = 0;
}
if (!is_numeric($ZarafaApachePort)) {
$ZarafaApachePort = 9010;
}
$ZarafaApachePHPFPMEnable = $sock->GET_INFO("ZarafaApachePHPFPMEnable");
if (!is_numeric($ZarafaApachePHPFPMEnable)) {
$ZarafaApachePHPFPMEnable = 0;
}
if ($ZarafaApacheServerName == null) {
$ZarafaApacheServerName = $unix->hostname_g();
}
if (!is_dir('/usr/share/php/mapi')) {
if (is_dir('/usr/local/share/php/mapi')) {
@mkdir("/usr/share/php", 0755, true);
shell_exec('/bin/ln -s /usr/local/share/php/mapi /usr/share/php/mapi');
}
}
$username = $unix->APACHE_SRC_ACCOUNT();
$group = $unix->APACHE_SRC_GROUP();
if ($GLOBALS["OUTPUT"]) {
echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} logs access: /var/log/apache-zarafa/access.log\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} logs error : /var/log/apache-zarafa/error.log\n";
}
@unlink("/var/log/apache-zarafa/access.log");
@unlink("/var/log/apache-zarafa/error.log");
@touch("/var/log/apache-zarafa/access.log");
@touch("/var/log/apache-zarafa/access.log");
@mkdir("/var/run/apache2", 0755, true);
@mkdir("/var/run/artica-apache", 0755, true);
@mkdir('/var/run/zarafa-web', 0755, true);
@mkdir('/var/log/apache-zarafa', 0755, true);
@mkdir('/var/lib/zarafa-webaccess/tmp', 0755, true);
$unix->chown_func($username, $group, "/var/log/apache-zarafa/access.log");
$unix->chown_func($username, $group, "/var/log/apache-zarafa/error.log");
$unix->chown_func($username, $group, "/var/run/apache2");
$unix->chown_func($username, $group, "/var/run/artica-apache");
$unix->chown_func($username, $group, "/var/run/zarafa-web");
$unix->chown_func($username, $group, "/var/log/apache-zarafa");
$unix->chown_func($username, $group, "/var/lib/zarafa-webaccess");
$unix->chmod_func(0777, "/var/lib/zarafa-webaccess/tmp");
$unix->chown_func($username, $group, "/usr/share/zarafa-webaccess/plugins/*");
if ($ZarafaApacheSSL == 1) {
if (is_file("{$APACHE_MODULES_PATH}/mod_ssl.so")) {
if (!is_file("/etc/ssl/certs/zarafa/apache.crt.nopass.cert")) {
shell_exec("/usr/share/artica-postfix/bin/artica-install --zarafa-apache-certificates");
}
$f[] = "LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so";
$f[] = "SSLEngine on";
$f[] = "SSLCertificateFile /etc/ssl/certs/zarafa/apache.crt.nopass.cert";
$f[] = "SSLCertificateKeyFile /etc/ssl/certs/zarafa/apache-ca.key.nopass.key";
if ($LighttpdArticaDisableSSLv2 == 1) {
$f[] = "SSLProtocol -ALL +SSLv3 +TLSv1";
$f[] = "SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM";
}
$f[] = "SSLRandomSeed connect builtin";
$f[] = "SSLRandomSeed startup file:/dev/urandom 256";
$f[] = "SSLRandomSeed connect file:/dev/urandom 256";
$f[] = "AddType application/x-x509-ca-cert .crt";
$f[] = "AddType application/x-pkcs7-crl .crl";
$f[] = "SSLPassPhraseDialog builtin";
$f[] = "SSLSessionCache shmcb:/var/run/apache2/ssl_scache-zarafa(512000)";
$f[] = "SSLSessionCacheTimeout 300";
$f[] = "SSLVerifyClient none";
$f[] = "ServerSignature Off";
}
}
$SET_MODULES = SET_MODULES();
$FreeWebPerformances = unserialize(base64_decode($sock->GET_INFO("ZarafaApachePerformances")));
if (!is_numeric($FreeWebPerformances["Timeout"])) {
$FreeWebPerformances["Timeout"] = 300;
}
if (!is_numeric($FreeWebPerformances["KeepAlive"])) {
$FreeWebPerformances["KeepAlive"] = 0;
}
if (!is_numeric($FreeWebPerformances["MaxKeepAliveRequests"])) {
$FreeWebPerformances["MaxKeepAliveRequests"] = 100;
//.........这里部分代码省略.........
示例2: extract_tgz
function extract_tgz($uuid)
{
$unix = new unix();
$workingdir = "/usr/share/artica-postfix/ressources/conf/meta/hosts/uploaded/{$uuid}";
if (is_file("{$workingdir}/status.tgz")) {
$tar = $unix->find_program("tar");
shell_exec("{$tar} -xf {$workingdir}/status.tgz -C {$workingdir}/");
@unlink("{$workingdir}/status.tgz");
}
$unix->chown_func($unix->APACHE_SRC_ACCOUNT(), $unix->APACHE_SRC_GROUP(), "{$workingdir}/*");
if (is_file("{$workingdir}/squid_admin_mysql.db")) {
$q = new mysql_meta();
if (!$q->TABLE_EXISTS("squid_admin_mysql")) {
$q->CheckTables();
}
$data = trim(@file_get_contents("{$workingdir}/squid_admin_mysql.db"));
if ($data != null) {
$q->QUERY_SQL(@file_get_contents("{$workingdir}/squid_admin_mysql.db"));
if (!$q->ok) {
meta_admin_mysql(0, "Failed to import {$workingdir}/squid_admin_mysql.db", $q->mysql_error, __FILE__, __LINE__);
} else {
@unlink("{$workingdir}/squid_admin_mysql.db");
}
} else {
@unlink("{$workingdir}/squid_admin_mysql.db");
}
} else {
if ($GLOBALS["VERBOSE"]) {
echo "{$workingdir}/squid_admin_mysql.db ( no such file )\n";
}
}
if (is_file("{$workingdir}/network_hosts.db")) {
__network_hosts($uuid, "{$workingdir}/network_hosts.db");
} else {
if ($GLOBALS["VERBOSE"]) {
echo "{$workingdir}/network_hosts.db ( no such file )\n";
}
}
global_status_ini($uuid);
}
示例3: apache_config
function apache_config()
{
$sock = new sockets();
$unix = new unix();
$EnablePHPFPM = 0;
$ipaddr = null;
@mkdir("/var/run/apache2", 0755, true);
@mkdir("/var/run/sarg-apache", 0755, true);
@mkdir("/var/log/apache2", 0755, true);
@mkdir(dirname($GLOBALS["APACHE_PID_PATH"]), 0755, true);
$APACHE_SRC_ACCOUNT = $unix->APACHE_SRC_ACCOUNT();
$APACHE_SRC_GROUP = $unix->APACHE_SRC_GROUP();
$APACHE_MODULES_PATH = $unix->APACHE_MODULES_PATH();
$SargOutputDir = $sock->GET_INFO("SargOutputDir");
if ($SargOutputDir == null) {
$SargOutputDir = "/var/www/html/squid-reports";
}
$SargWebPort = intval($sock->GET_INFO("SargWebPort"));
if ($SargWebPort == 0) {
$SargWebPort = rand(55600, 59000);
$sock->SET_INFO("SargWebPort", $SargWebPort);
}
if (is_link($SargOutputDir)) {
$SargOutputDir = @readlink($SargOutputDir);
}
@mkdir($SargOutputDir, 0755, true);
if (!is_file("{$SargOutputDir}/index.html")) {
$php = $unix->LOCATE_PHP5_BIN();
shell_exec("{$php} /usr/share/artica-postfix/exec.sarg.php --exec --force >/dev/null 2>&1 &");
}
if ($ipaddr == null) {
$ipaddr = "*";
}
$phpfpm = $unix->APACHE_LOCATE_PHP_FPM();
$php = $unix->LOCATE_PHP5_BIN();
$EnableArticaApachePHPFPM = $sock->GET_INFO("EnableArticaApachePHPFPM");
if (!is_numeric($EnableArticaApachePHPFPM)) {
$EnableArticaApachePHPFPM = 0;
}
if (!is_file($phpfpm)) {
$EnableArticaApachePHPFPM = 0;
}
$logfile = "/var/log/apache2/apache-sarg-access.log";
$ErrorLog = "/var/log/apache2/apache-sarg-error.log";
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, "/var/run/sarg-apache");
$apache_LOCATE_MIME_TYPES = $unix->apache_LOCATE_MIME_TYPES();
if ($EnableArticaApachePHPFPM == 1) {
if (!is_file("{$APACHE_MODULES_PATH}/mod_fastcgi.so")) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} mod_fastcgi.so is required to use PHP5-FPM\n";
}
$EnableArticaApachePHPFPM = 0;
}
}
if ($APACHE_SRC_ACCOUNT == null) {
$APACHE_SRC_ACCOUNT = "www-data";
$APACHE_SRC_GROUP = "www-data";
$unix->CreateUnixUser($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, "Apache username");
}
@unlink($ErrorLog);
@unlink($logfile);
if (!is_file("{$logfile}")) {
@touch("{$logfile}");
}
if (!is_file("{$ErrorLog}")) {
@touch("{$ErrorLog}");
}
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, $ErrorLog);
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, $logfile);
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, "/var/run/sarg-apache");
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, "/var/log/apache2");
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, dirname($GLOBALS["APACHE_PID_PATH"]));
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Run as {$APACHE_SRC_ACCOUNT}:{$APACHE_SRC_GROUP}\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} HTTP Port: {$ArticaSplashHotSpotPort} SSL Port: {$ArticaSplashHotSpotPortSSL}\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} PHP-FPM: {$EnablePHPFPM}\n";
}
$f[] = "LockFile /var/run/apache2/sarg-artica-accept.lock";
$f[] = "PidFile {$GLOBALS["APACHE_PID_PATH"]}";
$f[] = "AcceptMutex flock";
$f[] = "DocumentRoot {$SargOutputDir}";
$f[] = "DirectoryIndex index.html";
$f[] = "ErrorDocument 400 /index.html";
$f[] = "ErrorDocument 401 /index.html";
$f[] = "ErrorDocument 403 /index.html";
$f[] = "ErrorDocument 404 /index.html";
$f[] = "ErrorDocument 500 /index.html";
$f[] = "NameVirtualHost {$ipaddr}:{$SargWebPort}";
$f[] = "Listen {$ipaddr}:{$SargWebPort}";
$f[] = "<VirtualHost {$ipaddr}:{$SargWebPort}>";
$f[] = "\tServerName {$ipaddr}";
$f[] = "\tDocumentRoot {$SargOutputDir}";
$f[] = "</VirtualHost>";
$f[] = "<IfModule mpm_prefork_module>";
$f[] = "</IfModule>";
$f[] = "<IfModule mpm_worker_module>";
//.........这里部分代码省略.........
示例4: LoagRotateApache
function LoagRotateApache()
{
$sock = new sockets();
$unix = new unix();
$ApacheLogRotate = $sock->GET_INFO("ApacheLogRotate");
if (!is_numeric($ApacheLogRotate)) {
$ApacheLogRotate = 1;
}
if ($ApacheLogRotate == 0) {
return;
}
$gzip = $unix->find_program("gzip");
$ligneC = unserialize(base64_decode($sock->GET_INFO("ApacheLogRotateParams")));
if (!is_numeric($ligneC["RotateType"])) {
$ligneC["RotateType"] = 0;
}
if (!is_numeric($ligneC["MaxSize"])) {
$ligneC["MaxSize"] = 100;
}
if (!is_numeric($ligneC["RotateCount"])) {
$ligneC["RotateCount"] = 5;
}
$php5 = $unix->LOCATE_PHP5_BIN();
$q = new mysql();
$sql = "SELECT servername FROM freeweb";
$results = $q->QUERY_SQL($sql, 'artica_backup');
if (mysql_num_rows($results) == 0) {
return;
}
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
$servername = $ligne["servername"];
$f = array();
$f[] = "/var/log/apache2/{$servername}/*.log {";
$f[] = "\t{$ligneC["RotateFreq"]}";
$f[] = "\tsu " . $unix->APACHE_SRC_ACCOUNT() . " " . $unix->APACHE_SRC_GROUP();
$f[] = "\tmissingok";
if ($ligneC["MaxSize"] > 0) {
$f[] = "\tsize {$ligneC["MaxSize"]}M";
}
if ($ligneC["RotateCount"] > 0) {
$f[] = "\trotate {$ligneC["RotateCount"]}";
}
$f[] = "\tcompress";
$f[] = "\tsharedscripts";
$f[] = "\tcreate 640 root";
$f[] = "\tdateext";
$f[] = "\tcompressext .gz";
$f[] = "\tcompresscmd {$gzip}";
$f[] = "\tcompressoptions -9";
$f[] = "\textension -TASK-99999";
$f[] = "\tpostrotate";
$f[] = "{$php5} /usr/share/artica-postfix/exec.freeweb.php --reload";
$f[] = "endscript";
$f[] = "}\n";
@file_put_contents("/etc/logrotate.d/rotate-{$servername}", @implode("\n", $f));
}
}
示例5: apache_config
function apache_config()
{
$sock = new sockets();
$unix = new unix();
$EnablePHPFPM = 0;
$APACHE_SRC_ACCOUNT = $unix->APACHE_SRC_ACCOUNT();
$APACHE_SRC_GROUP = $unix->APACHE_SRC_GROUP();
if (preg_match("#APACHE_RUN_GROUP#", $APACHE_SRC_GROUP)) {
$APACHE_SRC_GROUP = "www-data";
}
$LogFilePath = "/var/log/artica-wifidog/access.log";
$directories[] = "/var/run/apache2";
$directories[] = "/var/run/artica-apache";
$directories[] = "/var/log/artica-wifidog";
$directories[] = "/home/artica/hotspot/sessions";
$directories[] = "/home/artica/hotspot/caches";
while (list($index, $maindir) = each($directories)) {
@mkdir($maindir, 0755, true);
@chown($maindir, $APACHE_SRC_ACCOUNT);
@chgrp($maindir, $APACHE_SRC_GROUP);
}
$ErrorLog = dirname($LogFilePath) . "/error.log";
if (!is_file($LogFilePath)) {
@touch($LogFilePath);
}
@chown($LogFilePath, $APACHE_SRC_ACCOUNT);
@chgrp($LogFilePath, $APACHE_SRC_GROUP);
if (!is_file($ErrorLog)) {
@touch($ErrorLog);
}
@chown($ErrorLog, $APACHE_SRC_ACCOUNT);
@chgrp($ErrorLog, $APACHE_SRC_GROUP);
$APACHE_MODULES_PATH = $unix->APACHE_MODULES_PATH();
$HotSpotMaxClients = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/HotSpotMaxClients"));
$HotSpotStartServers = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/HotSpotStartServers"));
$HotSpotForceDDOSDisable = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/HotSpotForceDDOSDisable"));
if ($HotSpotMaxClients == 0) {
$HotSpotMaxClients = 20;
}
if ($HotSpotStartServers == 0) {
$HotSpotStartServers = 5;
}
$EnableArticaHotSpot = $sock->GET_INFO("EnableArticaHotSpot");
$SquidHotSpotPort = $sock->GET_INFO("SquidHotSpotPort");
$ArticaHotSpotPort = $sock->GET_INFO("ArticaHotSpotPort");
$ArticaSSLHotSpotPort = $sock->GET_INFO("ArticaSSLHotSpotPort");
$ArticaSplashHotSpotPort = $sock->GET_INFO("ArticaSplashHotSpotPort");
$ArticaSplashHotSpotPortSSL = $sock->GET_INFO("ArticaSplashHotSpotPortSSL");
if (!is_numeric($ArticaHotSpotPort)) {
$ArticaHotSpotPort = 0;
}
if (!is_numeric($ArticaSplashHotSpotPort)) {
$ArticaSplashHotSpotPort = 16080;
}
if (!is_numeric($ArticaSplashHotSpotPortSSL)) {
$ArticaSplashHotSpotPortSSL = 16443;
}
$ArticaHotSpotInterface = $sock->GET_INFO("ArticaHotSpotInterface");
$HospotHTTPServerName = trim($sock->GET_INFO("HospotHTTPServerName"));
$HotSpotErrorRedirect = $sock->GET_INFO("HotSpotErrorRedirect");
if ($HotSpotErrorRedirect == null) {
$HotSpotErrorRedirect = "http://www.msftncsi.com";
}
$Params = unserialize($sock->GET_INFO("HotSpotEvasive"));
$ApacheEvasiveInstalled = intval($sock->GET_INFO("ApacheEvasiveInstalled"));
if (!is_numeric($Params["DOSEnable"])) {
$Params["DOSEnable"] = 1;
}
if (!is_numeric($Params["DOSHashTableSize"])) {
$Params["DOSHashTableSize"] = 1024;
}
if (!is_numeric($Params["DOSPageCount"])) {
$Params["DOSPageCount"] = 3;
}
if (!is_numeric($Params["DOSSiteCount"])) {
$Params["DOSSiteCount"] = 20;
}
if (!is_numeric($Params["DOSPageInterval"])) {
$Params["DOSPageInterval"] = 1;
}
if (!is_numeric($Params["DOSSiteInterval"])) {
$Params["DOSSiteInterval"] = 10;
}
if (!is_numeric($Params["DOSBlockingPeriod"])) {
$Params["DOSBlockingPeriod"] = 5;
}
$unix = new unix();
$NETWORK_ALL_INTERFACES = $unix->NETWORK_ALL_INTERFACES();
$ipaddr = $NETWORK_ALL_INTERFACES[$ArticaHotSpotInterface]["IPADDR"];
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} HotSpot run as {$ArticaHotSpotInterface} ( {$ipaddr} )\n";
}
if ($ipaddr == "0.0.0.0") {
$ipaddr = "*";
}
if ($ipaddr == null) {
$ipaddr = "*";
}
$GLOBALS["HOSTPOT_WEB_INTERFACE"] = $ipaddr;
$phpfpm = $unix->APACHE_LOCATE_PHP_FPM();
//.........这里部分代码省略.........
示例6: apache_firewall
function apache_firewall()
{
$q = new mysql();
$unix = new unix();
$APACHE_SRC_ACCOUNT = $unix->APACHE_SRC_ACCOUNT();
$APACHE_SRC_GROUP = $unix->APACHE_SRC_GROUP();
if ($q->COUNT_ROWS("iptables_webint", "artica_backup") == 0) {
return null;
}
$f[] = "Order Allow,Deny";
$ipClass = new IP();
$c = 0;
$results = $q->QUERY_SQL("SELECT * FROM iptables_webint", "artica_backup");
while ($ligne = mysql_fetch_assoc($results)) {
$pattern = $ligne["pattern"];
if (!$ipClass->isIPAddressOrRange($pattern)) {
continue;
}
$f[] = "\tAllow from {$pattern}";
$c++;
}
if (count($c) > 0) {
$f[] = "\tAllow from 127.0.0.1";
return @implode("\n", $f);
}
}
示例7: sessions_clean
function sessions_clean()
{
$unix = new unix();
$sock = new sockets();
$TimeFile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
$APACHE_SRC_ACCOUNT = $unix->APACHE_SRC_ACCOUNT();
$APACHE_SRC_GROUP = $unix->APACHE_SRC_GROUP();
$CleanPHPSessionTime = $sock->GET_INFO("CleanPHPSessionTime");
if (!is_numeric($CleanPHPSessionTime)) {
$CleanPHPSessionTime = 2880;
}
if ($unix->file_time_min($TimeFile) < 60) {
return;
}
@unlink($TimeFile);
@file_put_contents($TimeFile, time());
if ($CleanPHPSessionTime > 5) {
if (is_dir("/var/lib/php5")) {
foreach (glob("/var/lib/php5/*") as $filename) {
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, $filename);
$time = $unix->file_time_min($filename);
if ($time > 2880) {
$unix->_syslog("Clean: Remove PHP Session file " . basename($filename) . " {$time}Mn", basename(__FILE__));
@unlink($filename);
}
}
}
if (is_dir("/var/lib/php5-zarafa")) {
foreach (glob("/var/lib/php5-zarafa/*") as $filename) {
$time = $unix->file_time_min($filename);
if ($time > 2880) {
$unix->_syslog("Clean: Remove PHP Zarafa Session file " . basename($filename) . " {$time}Mn", basename(__FILE__));
@unlink($filename);
}
}
}
}
foreach (glob("/usr/share/artica-postfix/ressources/logs/jGrowl/*") as $filename) {
$time = $unix->file_time_min($filename);
if ($time > 360) {
@unlink($filename);
}
}
foreach (glob("/usr/share/artica-postfix/ressources/conf/*") as $filename) {
$time = $unix->file_time_min($filename);
if ($time > 360) {
@unlink($filename);
}
}
}
示例8: link_csv
function link_csv()
{
$aclid = $_GET["link-csv"];
$path = "/var/log/squid/access_acl_{$aclid}.csv";
$dest = "/usr/share/artica-postfix/ressources/logs/web/access_acl_{$aclid}.csv";
$unix = new unix();
$cp = $unix->find_program("cp");
@unlink($dest);
$apache = $unix->APACHE_SRC_ACCOUNT();
$cmd = "{$cp} -f {$path} {$dest}";
writelogs_framework("{$cmd}", __FUNCTION__, __FILE__, __LINE__);
shell_exec($cmd);
@chmod($path, 0777);
@chown($dest, $apache);
chgrp($dest, $unix->APACHE_SRC_GROUP());
}
示例9: copytocache
function copytocache()
{
$unix = new unix();
$path = $_GET["copytocache"];
if (!is_file($path)) {
echo "<articadatascgi>No such file</articadatascgi>";
writelogs("{$path} -> No such file");
return;
}
$basename = basename($path);
writelogs("COPY {$path} -> /usr/share/artica-postfix/ressources/logs/{$basename}");
if (is_file("/usr/share/artica-postfix/ressources/logs/{$basename}")) {
@unlink("/usr/share/artica-postfix/ressources/logs/{$basename}");
}
if (!copy($path, "/usr/share/artica-postfix/ressources/logs/{$basename}")) {
echo "<articadatascgi>Copy failed</articadatascgi>";
return;
}
$APACHE = $unix->APACHE_SRC_ACCOUNT();
$APACHE_GROUP = $unix->APACHE_SRC_GROUP();
$unix->chown_func($APACHE, $APACHE_GROUP, "/usr/share/artica-postfix/ressources/logs/{$basename}");
$unix->chmod_func(0755, "/usr/share/artica-postfix/ressources/logs/{$basename}");
}
示例10: install_PIWIK
function install_PIWIK($servername)
{
$sources = "/usr/share/piwik";
$unix = new unix();
$cp = $unix->find_program("cp");
$freeweb = new freeweb($servername);
if (!is_dir($sources)) {
writelogs("[{$servername}] {$sources} no such directory", __FUNCTION__, __FILE__, __LINE__);
return;
}
if (!is_dir($freeweb->WORKING_DIRECTORY)) {
writelogs("[{$servername}] {$freeweb->WORKING_DIRECTORY} no such directory", __FUNCTION__, __FILE__, __LINE__);
return;
}
include_once dirname(__FILE__) . "/ressources/class.piwik.inc";
$piwik = new piwik();
if ($piwik->checkWebsite($freeweb->WORKING_DIRECTORY)) {
return;
}
writelogs("[{$servername}] copy sources...", __FUNCTION__, __FILE__, __LINE__);
shell_exec("{$cp} -rf {$sources}/* {$freeweb->WORKING_DIRECTORY}/");
@unlink("{$freeweb->WORKING_DIRECTORY}/config/config.ini.php");
@mkdir('/usr/share/piwik/tmp/assets', 0777, true);
@mkdir('/usr/share/piwik/tmp/templates_c', 0777, true);
@mkdir('/usr/share/piwik/tmp/cache', 0777, true);
@mkdir('/usr/share/piwik/tmp/assets', 0777, true);
shell_exec('/bin/chmod 0777 /usr/share/piwik/tmp');
shell_exec('/bin/chmod 0777 /usr/share/piwik/tmp/templates_c/');
shell_exec('/bin/chmod 0777 /usr/share/piwik/tmp/cache/');
shell_exec('/bin/chmod 0777 /usr/share/piwik/tmp/assets/');
shell_exec('/bin/chmod a+w /usr/share/piwik/config');
$apacheusername = $unix->APACHE_SRC_ACCOUNT();
$apachegroup = $unix->APACHE_SRC_GROUP();
$freeweb->chown($freeweb->WORKING_DIRECTORY);
}
示例11: execute_mysql
function execute_mysql($OnlyID = 0)
{
$GLOBALS["INDEXED"] = 0;
$GLOBALS["SKIPPED"] = 0;
$GLOBALS["DIRS"] = array();
$unix = new unix();
$httrack = $unix->find_program("httrack");
if (!is_file($httrack)) {
apache_admin_mysql(0, "httrack no such binary", null, __FILE__, __LINE__, "webcopy");
return;
}
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
apache_admin_mysql(1, "Already instance executed", null, __FILE__, __LINE__, "webcopy");
return;
}
$ini = new Bs_IniHandler();
$sock = new sockets();
$datas = $sock->GET_INFO("ArticaProxySettings");
if (trim($datas) != null) {
$ini->loadString($datas);
if (!isset($ini->_params["PROXY"]["ArticaProxyServerEnabled"])) {
$ini->_params["PROXY"]["ArticaProxyServerEnabled"] = "no";
}
$ArticaProxyServerEnabled = $ini->_params["PROXY"]["ArticaProxyServerEnabled"];
$ArticaProxyServerName = $ini->_params["PROXY"]["ArticaProxyServerName"];
$ArticaProxyServerPort = $ini->_params["PROXY"]["ArticaProxyServerPort"];
$ArticaProxyServerUsername = trim($ini->_params["PROXY"]["ArticaProxyServerUsername"]);
$ArticaProxyServerUserPassword = $ini->_params["PROXY"]["ArticaProxyServerUserPassword"];
if ($ArticaProxyServerEnabled == 1) {
$ArticaProxyServerEnabled = "yes";
}
}
$PPRoxy = null;
$userPP = null;
if ($ArticaProxyServerEnabled == "yes") {
if ($ArticaProxyServerUsername != null) {
$userPP = "{$ArticaProxyServerUsername}:{$ArticaProxyServerUserPassword}@";
}
$PPRoxy = " --proxy {$userPP}@{$ArticaProxyServerName}:{$ArticaProxyServerPort}";
} else {
$squidbin = $unix->LOCATE_SQUID_BIN();
if (is_file($squidbin)) {
$SQUIDEnable = $sock->GET_INFO("SQUIDEnable");
if (!is_numeric($SQUIDEnable)) {
$SQUIDEnable = 1;
}
$SquidMgrListenPort = intval($sock->GET_INFO("SquidMgrListenPort"));
$PPRoxy = " --proxy 127.0.0.1:{$SquidMgrListenPort}";
}
}
$getmypid = getmypid();
@file_put_contents($pidfile, $getmypid);
$php = $unix->LOCATE_PHP5_BIN();
$APACHE_USERNAME = $unix->APACHE_SRC_ACCOUNT();
$APACHE_SRC_GROUP = $unix->APACHE_SRC_GROUP();
$q = new mysql();
$nice = EXEC_NICE();
$sql = "SELECT * FROM httrack_sites WHERE enabled=1";
$results = $q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
apache_admin_mysql(0, "Fatal: {$q->mysql_error}", null, __FILE__, __LINE__, "webcopy");
return;
}
$t1 = time();
$count = 0;
if ($OnlyID > 0) {
$ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT sitename FROM httrack_sites WHERE ID={$OnlyID}", "artica_backup"));
$log_exp = " only for [{$ligne2["sitename"]}] ";
}
apache_admin_mysql(2, "Starting executing WebCopy task {$log_exp} pid:{$getmypid}", null, __FILE__, __LINE__, "webcopy");
$dirsizeG = 0;
while ($ligne = mysql_fetch_assoc($results)) {
if ($OnlyID > 0) {
if ($ligne["ID"] != $OnlyID) {
continue;
}
}
$t = time();
$count++;
$workingdir = $ligne["workingdir"];
$sitename = $ligne["sitename"];
$minrate = $ligne["minrate"];
$maxfilesize = $ligne["maxfilesize"];
$maxsitesize = $ligne["maxsitesize"];
$size = $ligne["size"];
$sizeKB = $size / 1024;
$sizeMB = round($sizeKB / 1024, 2);
$maxworkingdir = intval($ligne["maxworkingdir"]);
if ($maxworkingdir == 0) {
$maxworkingdir = 20;
}
$maxsitesizeMB = $maxsitesize / 1000;
if ($maxsitesizeMB > $maxworkingdir) {
$maxsitesize = $maxworkingdir * 1000;
}
if ($sizeMB > $maxworkingdir) {
apache_admin_mysql(1, "Skip downloading content of {$sitename} Directory: {$sizeMB}MB reach limit of {$maxworkingdir}MB", null, __FILE__, __LINE__, "webcopy");
continue;
//.........这里部分代码省略.........
示例12: coova_web
function coova_web()
{
$ldap = new clladp();
$sock = new sockets();
$ChilliConf = unserialize(base64_decode($sock->GET_INFO("ChilliConf")));
if (!isset($ChilliConf["HS_UAMFREEWEB"])) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: FreeWeb Login page is not set...\n";
}
}
$f[] = "<?";
$f[] = "\t\$msecret = '{$ldap->ldap_password}'; //Change this to be the same as your chilli's configuration";
$f[] = "\t\$username = \$_POST['username'];";
$f[] = "\t\$password = \$_POST['password'];";
$f[] = "\t\$challenge = \$_POST['challenge'];";
$f[] = "\t\$redir\t = \$_POST['userurl'];";
$f[] = "\t\$server_ip = \$_POST['uamip'];";
$f[] = "\t\$port = \$_POST['uamport'];";
$f[] = "";
$f[] = " //--Add a remember me cookie---";
$f[] = " if( array_key_exists('remember',\$_POST)){";
$f[] = " \$Year = (2592000*12) + time();";
$f[] = " setcookie(\"hs[username]\", \$username, \$Year);";
$f[] = " setcookie('hs[password]', \$password, \$Year);";
$f[] = " }";
$f[] = "";
$f[] = " //--There is a bug that keeps the logout in a loop if userurl is http%3a%2f%2f1.0.0.0 ---/";
$f[] = " //--We need to remove this and replace it with something we want";
$f[] = " if (preg_match(\"/1\\.0\\.0\\.0/i\", \$redir)) {";
$f[] = "";
$f[] = " \$default_site = 'google.com';";
$f[] = " \$pattern = \"/1\\.0\\.0\\.0/i\";";
$f[] = " \$redir = preg_replace(\$pattern, \$default_site, \$redir);";
$f[] = " }";
$f[] = "";
$f[] = "\t\$enc_pwd = return_new_pwd(\$password,\$challenge,\$uamsecret);";
$f[] = "\t//\$dir\t\t= '/json/logon';";
$f[] = "\t\$dir\t\t= '/logon';";
$f[] = " \$target = \"http://\$server_ip\".':'.\$port.\$dir.\"?username=\$username&password=\$enc_pwd&userurl=\$redir\";";
$f[] = " // print(\$target);";
$f[] = "";
$f[] = "\theader(\"Location: \$target\");";
$f[] = "";
$f[] = "\t//Function to do the encryption thing of the password";
$f[] = "\tfunction return_new_pwd(\$pwd,\$challenge,\$uamsecret){";
$f[] = "\t \$hex_chal = pack('H32', \$challenge); //Hex the challenge";
$f[] = "\t \$newchal = pack('H*', md5(\$hex_chal.\$uamsecret)); //Add it to with \$uamsecret (shared between chilli an this script)";
$f[] = "\t \$response = md5(\"\" . \$pwd . \$newchal); //md5 the lot";
$f[] = "\t \$newpwd = pack('a32', \$pwd); //pack again";
$f[] = "\t \$password = implode ('', unpack('H32', (\$newpwd ^ \$newchal))); //unpack again";
$f[] = "\t return \$password;";
$f[] = " \t}";
$f[] = "";
$f[] = "?>";
$unix = new unix();
$cp = $unix->find_program("cp");
@mkdir("/var/www/coova_json", 0755, true);
if (!is_file("/var/www/coova_json/login.php")) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Installing Coova JSON...\n";
shell_exec("{$cp} -rf /var/www/c2/yfi_cake/setup/coova_json/* /var/www/coova_json/");
}
@file_put_contents("/var/www/coova_json/login.php", @implode("\n", $f));
@chmod("var/www/coova_json/login.php", 0755);
$unix->chown_func($unix->APACHE_SRC_ACCOUNT(), $unix->APACHE_SRC_GROUP(), "/var/www/coova_json/*");
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} `coova_json/login.php` done\n";
$f = explode("\n", @file_get_contents("/var/www/coova_json/js/custom.js"));
while (list($key, $line) = each($f)) {
if (preg_match("#\\s+p_url_use:.*?'#", $line)) {
echo "Starting......: " . date("H:i:s") . " [INIT]: Chilli: L.{$key} FreeWeb: {$ChilliConf["HS_UAMFREEWEB"]}\n";
$f[$key] = "\tp_url_use: 'http://{$ChilliConf["HS_UAMFREEWEB"]}/c2/yfi_cake/third_parties/json_usage_check?key=12345&username=', //This is the YFi Web service which will show the user's usage";
continue;
}
if (preg_match("#\\s+p_url_uam:.*?'#", $line)) {
echo "Starting......: " . date("H:i:s") . " [INIT]: Chilli: L.{$key} FreeWeb: {$ChilliConf["HS_UAMFREEWEB"]}\n";
$f[$key] = "\tp_url_uam: 'http://{$ChilliConf["HS_UAMFREEWEB"]}/mobile/uam.php?challenge=', //This us the web service which will return a uam encrypted hash using the challenge, password and UAM shared secret";
continue;
}
if (preg_match("#\\s+p_url_voucher_name:.*?'#", $line)) {
echo "Starting......: " . date("H:i:s") . " [INIT]: Chilli: L.{$key} FreeWeb: {$ChilliConf["HS_UAMFREEWEB"]}\n";
$f[$key] = "\tp_url_voucher_name: 'http://{$ChilliConf["HS_UAMFREEWEB"]}/c2/yfi_cake/third_parties/json_voucher_name?key=12345&password=',";
continue;
}
}
@file_put_contents("/var/www/coova_json/js/custom.js", @implode("\n", $f));
echo "Starting......: " . date("H:i:s") . " [INIT]: Chilli: `/custom.js` done\n";
$f = explode("\n", @file_get_contents("/var/www/coova_json/uam.php"));
while (list($key, $line) = each($f)) {
if (preg_match("#uamsecret.*?=#", $line)) {
$f[$key] = "\t\$uamsecret = '{$ldap->ldap_password}';";
continue;
}
}
@file_put_contents("/var/www/coova_json/uam.php", @implode("\n", $f));
echo "Starting......: " . date("H:i:s") . " [INIT]: Chilli: `/uam.php` done\n";
DefaultSplash($ChilliConf);
}
示例13: build
function build()
{
$unix = new unix();
$sock = new sockets();
$apache = $unix->APACHE_SRC_ACCOUNT();
$apachegrp = $unix->APACHE_SRC_GROUP();
$VSFTPDPort = intval($sock->GET_INFO("VSFTPDPort"));
if ($VSFTPDPort == 0) {
$VSFTPDPort = 21;
}
$VsFTPDPassive = $sock->GET_INFO("VsFTPDPassive");
$VsFTPDFileOpenMode = $sock->GET_INFO("VsFTPDFileOpenMode");
$VsFTPDLocalUmask = $sock->GET_INFO("VsFTPDLocalUmask");
$ProFTPDRootLogin = intval($sock->GET_INFO("ProFTPDRootLogin"));
if (!is_numeric($VsFTPDPassive)) {
$VsFTPDPassive = 1;
}
if ($VsFTPDFileOpenMode == null) {
$VsFTPDFileOpenMode = "0666";
}
if ($VsFTPDLocalUmask == null) {
$VsFTPDLocalUmask = "077";
}
if ($VsFTPDFileOpenMode == null) {
$VsFTPDFileOpenMode = "0666";
}
$VsFTPDLocalMaxRate = intval($sock->GET_INFO("VsFTPDLocalMaxRate"));
$f[] = "ServerName\t\t\"FTP server {$unix->hostname_g}()\"";
$f[] = "ServerType\t\tstandalone";
$f[] = "DefaultServer\t\ton";
$f[] = "Port\t\t\t\t{$VSFTPDPort}";
$f[] = "UseIPv6\t\t\toff";
$f[] = "Umask\t\t\t\t{$VsFTPDFileOpenMode} {$VsFTPDLocalUmask}";
$f[] = "PidFile\t\t\t/var/run/proftpd.pid";
$f[] = "MaxInstances\t\t30";
$f[] = "User\t\t\t\t{$apache}";
$f[] = "Group\t\t\t\t{$apachegrp}";
if ($ProFTPDRootLogin == 1) {
$f[] = "RootLogin\ton";
} else {
$f[] = "RootLogin\toff";
}
$f[] = "RequireValidShell\toff";
$f[] = "DefaultRoot \t\t~";
$f[] = "AllowOverwrite\ton";
$f[] = "IdentLookups \toff";
$f[] = "UseReverseDNS \toff";
$f[] = "LogFormat default \"%h %l %u %t \\\"%r\\\" %s %b\"";
$f[] = "LogFormat\t\t\tauth \"%v [%P] %h %t \\\"%r\\\" %s\"";
$f[] = "LogFormat\t\t\twrite \"%h %l %u %t \\\"%r\\\" %s %b\"";
$f[] = "SystemLog \t\t/var/log/proftpd.log";
$f[] = "TransferLog \t\t/var/log/xferlog";
$f[] = "LoadModule \t\tmod_quotatab.c";
$f[] = "LoadModule \t\tmod_quotatab_sql.c";
$f[] = "";
$f[] = "LoadModule \t\tmod_sql.c";
$f[] = "LoadModule \t\tmod_sql_mysql.c";
$f[] = "";
$f[] = "LoadModule \t\tmod_ldap.c";
$f[] = "";
$f[] = "AuthOrder\t\t\tAuthOrder mod_sql.c mod_ldap.c";
$f[] = "";
if ($VsFTPDPassive == 1) {
$pasv_min_port = intval($sock->GET_INFO("VsFTPDPassiveMinPort"));
$pasv_max_port = intval($sock->GET_INFO("VsFTPDPassiveMaxPort"));
if ($pasv_min_port == 0) {
$pasv_min_port = 40000;
}
if ($pasv_max_port == 0) {
$pasv_max_port = 40200;
}
$f[] = "PassivePorts {$pasv_min_port} {$pasv_max_port}";
$VsFTPDPassiveAddr = $sock->GET_INFO("VsFTPDPassiveAddr");
if ($VsFTPDPassiveAddr != null) {
$f[] = "MasqueradeAddress {$VsFTPDPassiveAddr}";
}
}
if ($VsFTPDLocalMaxRate > 0) {
if (strpos($VsFTPDLocalMaxRate, ".") == 0) {
$VsFTPDLocalMaxRate = "{$VsFTPDLocalMaxRate}.0";
}
$f[] = "TransferRate RETR {$VsFTPDLocalMaxRate}";
$f[] = "TransferRate STOR {$VsFTPDLocalMaxRate}";
}
$f[] = "";
$f[] = "# Bar use of SITE CHMOD by default";
$f[] = "<Limit SITE_CHMOD>";
$f[] = " DenyAll";
$f[] = "</Limit>";
$f[] = "";
$f[] = "# A basic anonymous configuration, no upload directories. If you do not";
$f[] = "# want anonymous users, simply delete this entire <Anonymous> section.";
$f[] = "<Anonymous ~ftp>";
$f[] = " User\t\t\t\tftp";
$f[] = " Group\t\t\t\tftp";
$f[] = "";
$f[] = " # We want clients to be able to login with \"anonymous\" as well as \"ftp\"";
$f[] = " UserAlias\t\t\tanonymous ftp";
$f[] = "";
$f[] = " # Limit the maximum number of anonymous logins";
//.........这里部分代码省略.........
示例14: apache_config
function apache_config()
{
$sock = new sockets();
$unix = new unix();
$EnablePHPFPM = 0;
@mkdir("/var/run/apache2", 0755, true);
@mkdir("/var/run/artica-apache", 0755, true);
@mkdir("/var/log/lighttpd", 0755, true);
$APACHE_SRC_ACCOUNT = $unix->APACHE_SRC_ACCOUNT();
$APACHE_SRC_GROUP = $unix->APACHE_SRC_GROUP();
$APACHE_MODULES_PATH = $unix->APACHE_MODULES_PATH();
$pydio_installed = false;
if (is_file(" /etc/php5/cli/conf.d/ming.ini")) {
@unlink(" /etc/php5/cli/conf.d/ming.ini");
}
@unlink("/var/log/lighttpd/apache-error.log");
@touch("/var/log/lighttpd/apache-error.log");
@chmod("/var/log/lighttpd/apache-error.log", 0755);
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, "/var/log/lighttpd/*");
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, "/usr/share/artica-postfix/ressources/logs/*");
if (is_dir("/usr/share/artica-postfix/pydio")) {
$pydio_installed = true;
}
$ArticaHttpsPort = 9000;
$NoLDAPInLighttpdd = 0;
$ArticaHttpUseSSL = 1;
$ArticaHttpsPort = $sock->GET_INFO("ArticaHttpsPort");
$ArticaHttpUseSSL = $sock->GET_INFO("ArticaHttpUseSSL");
if (!is_numeric($ArticaHttpUseSSL)) {
$ArticaHttpUseSSL = 1;
}
if (!is_numeric($ArticaHttpsPort)) {
$ArticaHttpsPort = "9000";
}
$LighttpdArticaListenIP = $sock->GET_INFO("LighttpdArticaListenIP");
$phpfpm = $unix->APACHE_LOCATE_PHP_FPM();
$php = $unix->LOCATE_PHP5_BIN();
$EnableArticaApachePHPFPM = $sock->GET_INFO("EnableArticaApachePHPFPM");
if (!is_numeric($EnableArticaApachePHPFPM)) {
$EnableArticaApachePHPFPM = 0;
}
if (!is_file($phpfpm)) {
$EnableArticaApachePHPFPM = 0;
}
$EnablePHPFPM = intval($sock->GET_INFO("EnablePHPFPM"));
if (!is_numeric($EnablePHPFPM)) {
$EnablePHPFPM = 0;
}
if ($EnablePHPFPM == 0) {
$EnableArticaApachePHPFPM = 0;
}
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, "/var/run/artica-apache");
$apache_LOCATE_MIME_TYPES = $unix->apache_LOCATE_MIME_TYPES();
if ($EnableArticaApachePHPFPM == 1) {
if (!is_file("{$APACHE_MODULES_PATH}/mod_fastcgi.so")) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} mod_fastcgi.so is required to use PHP5-FPM\n";
}
$EnableArticaApachePHPFPM = 0;
}
}
if ($APACHE_SRC_ACCOUNT == null) {
$APACHE_SRC_ACCOUNT = "www-data";
$APACHE_SRC_GROUP = "www-data";
$unix->CreateUnixUser($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, "Apache username");
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Run as {$APACHE_SRC_ACCOUNT}:{$APACHE_SRC_GROUP}\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} PHP-FPM: {$EnablePHPFPM}\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} PHP-FPM Enabled: {$EnableArticaApachePHPFPM}\n";
}
$f[] = "LockFile /var/run/apache2/artica-accept.lock";
$f[] = "PidFile /var/run/artica-apache/apache.pid";
$f[] = "DocumentRoot /usr/share/artica-postfix";
$open_basedir[] = "/usr/share/artica-postfix";
$open_basedir[] = "/etc/artica-postfix";
$open_basedir[] = "/etc/artica-postfix/settings";
$open_basedir[] = "/var/log";
$open_basedir[] = "/var/run/mysqld";
$open_basedir[] = "/usr/share/php";
$open_basedir[] = "/usr/share/php5";
$open_basedir[] = "/var/lib/php5";
$open_basedir[] = "/var/lighttpd/upload";
$open_basedir[] = "/usr/share/artica-postfix/ressources";
$open_basedir[] = "/usr/share/artica-postfix/framework";
$open_basedir[] = "/etc/ssl/certs/mysql-client-download";
$open_basedir[] = "/var/run";
$open_basedir[] = "/bin";
$open_basedir[] = "/tmp";
$open_basedir[] = "/usr/sbin";
$open_basedir[] = "/home";
//$f[]="php_value open_basedir \"".@implode(":", $open_basedir)."\"";
//$f[]="php_value output_buffering Off";
//$f[]="php_flag magic_quotes_gpc Off";
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Listen Port: {$ArticaHttpsPort}\n";
//.........这里部分代码省略.........
示例15: chown_medir
function chown_medir()
{
$dir = base64_decode($_GET["chown-medir"]);
$unix = new unix();
$APACHE = $unix->APACHE_SRC_ACCOUNT();
$APACHE_GROUP = $unix->APACHE_SRC_GROUP();
@mkdir("/etc/artica-postfix/settings/Daemons", 0755, true);
@mkdir("/usr/share/artica-postfix/ressources/logs", 0755, true);
$f[] = "/etc/artica-postfix/settings/Daemons";
$f[] = "/usr/share/artica-postfix/ressources/logs";
if ($dir != null) {
$f[] = $dir;
}
while (list($key, $directory) = each($f)) {
writelogs_framework("Permissions on `{$directory}` for {$APACHE}:{$APACHE_GROUP}", __FUNCTION__, __FILE__, __LINE__);
@mkdir($directory, 0755, true);
$unix->chown_func($APACHE, null, $directory);
$unix->chown_func($APACHE, null, "{$directory}/*");
$unix->chmod_func(0755, "{$directory}");
$unix->chmod_func(0755, "{$directory}/*");
}
if ($dir == null) {
return;
}
@chown($dir, $APACHE);
@chgrp($dir, $APACHE_GROUP);
}