本文整理汇总了PHP中unix::APACHE_MODULES_PATH方法的典型用法代码示例。如果您正苦于以下问题:PHP unix::APACHE_MODULES_PATH方法的具体用法?PHP unix::APACHE_MODULES_PATH怎么用?PHP unix::APACHE_MODULES_PATH使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unix
的用法示例。
在下文中一共展示了unix::APACHE_MODULES_PATH方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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>";
//.........这里部分代码省略.........
示例2: APACHE_ADD_MODULE
function APACHE_ADD_MODULE($moduleso_file)
{
$unix = new unix();
if (preg_match("#^mod_proxy#", $moduleso_file)) {
return;
}
if ($moduleso_file == "mod_proxy_balancer.so") {
return;
}
if ($moduleso_file == "mod_unique_id.so") {
return;
}
if ($moduleso_file == "mod_proxy_ftp.so") {
return;
}
if ($moduleso_file == "mod_proxy_html.so") {
return;
}
if ($moduleso_file == "mod_rpaf-2.0.so") {
return;
}
$APACHE_MODULES_PATH = $unix->APACHE_MODULES_PATH();
if ($moduleso_file == 'mod_perl.so') {
if (!AuthorizedModule($moduleso_file)) {
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: blacklisted\n";
}
return;
}
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: perl_module OK\n";
}
return 'LoadModule perl_module' . "\t{$APACHE_MODULES_PATH}/{$moduleso_file}";
}
if ($moduleso_file == 'mod_log_config.so') {
if (!AuthorizedModule($moduleso_file)) {
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: blacklisted\n";
}
return;
}
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: log_config_module OK\n";
}
return 'LoadModule log_config_module' . "\t{$APACHE_MODULES_PATH}/{$moduleso_file}";
}
if ($moduleso_file == 'mod_vhost_ldap.so') {
if (!AuthorizedModule($moduleso_file)) {
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: blacklisted\n";
}
return;
}
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: vhost_ldap_module OK\n";
}
return 'LoadModule vhost_ldap_module' . "\t{$APACHE_MODULES_PATH}/{$moduleso_file}";
}
if ($moduleso_file == 'mod_ldap.so') {
if (!AuthorizedModule($moduleso_file)) {
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: blacklisted\n";
}
return;
}
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: ldap_module OK\n";
}
return 'LoadModule ldap_module' . "\t{$APACHE_MODULES_PATH}/{$moduleso_file}";
}
if ($moduleso_file == 'mod_rewrite.so') {
if (!AuthorizedModule($moduleso_file)) {
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: blacklisted\n";
}
return;
}
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: mod_rewrite OK\n";
}
return 'LoadModule rewrite_module' . "\t{$APACHE_MODULES_PATH}/{$moduleso_file}";
}
if ($moduleso_file == 'mod_dav.so') {
if (!AuthorizedModule($moduleso_file)) {
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: blacklisted\n";
}
return;
}
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: dav_module OK\n";
}
return 'LoadModule dav_module' . "\t{$APACHE_MODULES_PATH}/{$moduleso_file}";
}
if ($moduleso_file == 'mod_suexec.so') {
if (!AuthorizedModule($moduleso_file)) {
if ($GLOBALS["VERBOSE"]) {
echo "{$moduleso_file}: blacklisted\n";
}
return;
//.........这里部分代码省略.........
示例3: 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();
//.........这里部分代码省略.........
示例4: 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";
//.........这里部分代码省略.........
示例5: apache_config
function apache_config()
{
$sock = new sockets();
$unix = new unix();
$EnablePHPFPM = 0;
@mkdir("/var/run/squid", 0755, true);
@mkdir("/var/run/squid", 0755, true);
$APACHE_SRC_ACCOUNT = "squid";
$APACHE_SRC_GROUP = "squid";
$APACHE_MODULES_PATH = $unix->APACHE_MODULES_PATH();
if (!isset($GLOBALS["HyperCacheStoragePath"])) {
$sock = new sockets();
$GLOBALS["HyperCacheStoragePath"] = $sock->GET_INFO("HyperCacheStoragePath");
if ($GLOBALS["HyperCacheStoragePath"] == null) {
$GLOBALS["HyperCacheStoragePath"] = "/home/artica/proxy-cache";
}
}
$SquidEnforceRules = intval($sock->GET_INFO("SquidEnforceRules"));
$HyperCacheHTTPListenPort = $sock->GET_INFO("HyperCacheHTTPListenPort");
$HyperCacheHTTPListenPortSSL = $sock->GET_INFO("HyperCacheHTTPListenPortSSL");
$HyperCacheHTTPListenPortSSLEnabled = intval($sock->GET_INFO("HyperCacheHTTPListenPortSSLEnabled"));
if (!is_numeric($HyperCacheHTTPListenPort)) {
$HyperCacheHTTPListenPort = 8700;
}
if (!is_numeric($HyperCacheHTTPListenPortSSL)) {
$HyperCacheHTTPListenPortSSL = 8900;
}
$HyperCacheListenAddr = $sock->GET_INFO("HyperCacheListenAddr");
$unix = new unix();
$NETWORK_ALL_INTERFACES = $unix->NETWORK_ALL_INTERFACES();
unset($NETWORK_ALL_INTERFACES["lo"]);
if ($HyperCacheListenAddr == null) {
$HyperCacheListenAddr = $unix->NETWORK_DEFAULT_LISTEN_ADDR();
$sock->SET_INFO("HyperCacheListenAddr", $HyperCacheListenAddr);
}
if ($unix->NETWORK_IS_LISTEN_ADDR_EXISTS($HyperCacheListenAddr)) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} {$HyperCacheListenAddr} doesn't exists...\n";
}
$HyperCacheListenAddr = $unix->NETWORK_DEFAULT_LISTEN_ADDR();
$sock->SET_INFO("HyperCacheListenAddr", $HyperCacheListenAddr);
}
$ipaddr = $HyperCacheListenAddr;
$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;
}
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, "/var/run/squid");
$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 ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Listen address: {$ipaddr}\n";
}
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: {$HyperCacheHTTPListenPort} SSL Port: {$HyperCacheHTTPListenPortSSL}\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} PHP-FPM: {$EnablePHPFPM}\n";
}
$q = new mysql_squid_builder();
$nice = EXEC_NICE();
$sql = "SELECT * FROM artica_caches_mirror WHERE enabled=1 AND `ToDelete`=0";
$results = $q->QUERY_SQL($sql);
$HyperCache = new HyperCache();
while ($ligne = mysql_fetch_assoc($results)) {
$t = time();
$sitename = $ligne["sitename"];
$sitename_path = $HyperCache->HyperCacheUriToHostname($sitename);
$workingdir = $GLOBALS["HyperCacheStoragePath"] . "/mirror/{$sitename_path}";
if (!is_dir($workingdir)) {
@mkdir($workingdir, 0755, true);
}
@chown("{$GLOBALS["HyperCacheStoragePath"]}/mirror", "squid");
@chgrp("{$GLOBALS["HyperCacheStoragePath"]}/mirror", "squid");
@chown("{$GLOBALS["HyperCacheStoragePath"]}/mirror/{$sitename_path}", "squid");
@chgrp("{$GLOBALS["HyperCacheStoragePath"]}/mirror/{$sitename_path}", "squid");
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} build folder for mirrored {$sitename_path}\n";
}
$mirrors[] = "";
$mirrors_aliases[] = "alias /{$sitename_path} {$workingdir}";
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: alias /{$sitename_path} {$workingdir}\n";
}
$mirrors[] = "";
//.........这里部分代码省略.........
示例6: CheckHttpdConf
//.........这里部分代码省略.........
}
if (!is_numeric($FreeWebListenPort)) {
$FreeWebListenPort = 80;
}
if (!is_numeric($FreeWebsEnableModSecurity)) {
$FreeWebsEnableModSecurity = 0;
}
if (!is_numeric($FreeWebsEnableModEvasive)) {
$FreeWebsEnableModEvasive = 0;
}
if (!is_numeric($FreeWebsEnableModQOS)) {
$FreeWebsEnableModQOS = 0;
}
if (!is_numeric($FreeWebsEnableOpenVPNProxy)) {
$FreeWebsEnableOpenVPNProxy = 0;
}
if (!is_numeric($TomcatEnable)) {
$TomcatEnable = 1;
}
if (!is_numeric($FreeWebEnableSQLLog)) {
$FreeWebEnableSQLLog = 0;
}
if (!is_numeric($FreeWebEnableModSUPhp)) {
$FreeWebEnableModSUPhp = 0;
}
if ($unix->isNGnx()) {
$FreeWebListenSSLPort = 447;
$FreeWebListenPort = 82;
}
if ($unix->IsSquidReverse()) {
$FreeWebListenSSLPort = 447;
$FreeWebListenPort = 82;
}
$APACHE_MODULES_PATH = $unix->APACHE_MODULES_PATH();
$toremove[] = "mod-status.init";
$toremove[] = "status.conf";
$toremove[] = "fcgid.load";
$toremove[] = "fcgid.conf";
$toremove[] = "fastcgi.conf";
$toremove[] = "fastcgi.load";
$toremove[] = "fastcgi.conf";
$toremove[] = "log_sql.load";
$toremove[] = "log_sql_mysql.load";
$toremove[] = "geoip.conf";
$toremove[] = "bw.load";
$toremove[] = "geoip_module.load";
$toremove[] = "log_sql_module.conf";
$toremove[] = "log_sql_module.load";
$toremove[] = "log_sql_mysql_module.load";
$toremove[] = "log_sql_ssl.load";
$toremove[] = "unique_id.load";
$toremove[] = "mime.conf";
$toremove[] = "mime.load";
$toremove[] = "php5.conf";
$toremove[] = "php5.load";
$toremove[] = "fcgid_module.load";
$toremove[] = "php5-fpm.load";
$toremove[] = "fastcgi.load";
$toremove[] = "php5-fpm.conf";
$toremove[] = "bw.load";
$toremove[] = "status_module.load";
$toremove[] = "autoindex.load";
$toremove[] = "ldap.load";
if (is_file("/etc/apache2/sites-enabled/000-default")) {
$ToDeleteDefault = true;
$q = new mysql();
示例7: usersMenus
}
}
if (preg_match("#--no-compile#", @implode(" ", $argv))) {
$GLOBALS["NO_COMPILE"] = true;
}
if (preg_match("#--verbose#", @implode(" ", $argv))) {
$GLOBALS["VERBOSE"] = true;
}
if (preg_match("#--repos#", @implode(" ", $argv))) {
$GLOBALS["REPOS"] = true;
}
if (preg_match("#--force#", @implode(" ", $argv))) {
$GLOBALS["FORCE"] = true;
}
$users = new usersMenus();
$APACHE_MODULES_PATH = $unix->APACHE_MODULES_PATH();
if (!is_dir($APACHE_MODULES_PATH)) {
echo "Unable to locate APACHE MODULES DIRECTORY...\n";
die;
}
$timefile = $unix->file_time_min("/etc/artica-postfix/mod_rpaf-2.0.so.compile");
if ($timefile < 60) {
echo "Already executed since {$timefile}mn, need to wait 1h\n";
die;
}
$wget = $unix->find_program("wget");
$tar = $unix->find_program("tar");
$rm = $unix->find_program("rm");
$cp = $unix->find_program("cp");
$dirsrc = "mod_rpaf";
$Architecture = Architecture();