Skip to content

Commit

Permalink
fix reset-mysql-root-password.php (move tmp dir and add '--skip-grant…
Browse files Browse the repository at this point in the history
…-tables'); add mod_remoteip in defaults.conf.tpl in apache 2.4 (if reverseproxy); mod ~lxcenter.conf.tpl (ThreadsPerChild using $mcfactor); add rate_limit in named.options.conf for bind; add options for 'security.limit_extensions' in 'php configures'; remove old code in phpinilib.php and phpini_sync.lib.php; add remove esmtp in install process; fix add-rainloop-domains
  • Loading branch information
mustafaramadhan committed Apr 30, 2017
1 parent 1d2f9ea commit aac99f4
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 207 deletions.
8 changes: 5 additions & 3 deletions kloxo/bin/common/misc/reset-mysql-root-password.php
Expand Up @@ -2,6 +2,8 @@

include_once "lib/html/include.php";

$tpath = "/usr/local/lxlabs/kloxo/serverfile";

if (isset($argv[1])) {
$pass = $argv[1];
} else {
Expand All @@ -16,7 +18,7 @@
$text = str_replace("'USER'", "'root'", $text);
$text = str_replace("'PASSWORD'", "'{$pass}'", $text);

file_put_contents("/tmp/reset-mysql-password.sql", $text);
file_put_contents("{$tpath}/reset-mysql-password.sql", $text);

print("Stop MySQL service...\n");
if (isServiceExists('mysqld')) {
Expand All @@ -27,7 +29,7 @@

print("MySQL ROOT password reset...\n");
sleep(10);
system("mysqld_safe --init-file=/tmp/reset-mysql-password.sql >/dev/null 2>&1 &");
system("mysqld_safe --skip-grant-tables --init-file={$tpath}/reset-mysql-password.sql >/dev/null 2>&1 &");
sleep(15);

print("Start MySQL service...\n");
Expand All @@ -37,7 +39,7 @@
exec("service mysql start");
}

exec("'rm' -f /tmp/reset-mysql-password.sql");
exec("'rm' -f {$tpath}/reset-mysql-password.sql");

$conn = new mysqli('localhost', 'root', $pass, 'mysql');

Expand Down
2 changes: 1 addition & 1 deletion kloxo/bin/kloxoversion
@@ -1 +1 @@
7.0.0.c-2017042701
7.0.0.c-2017043001
19 changes: 16 additions & 3 deletions kloxo/file/apache/tpl/defaults.conf.tpl
Expand Up @@ -235,10 +235,23 @@ Listen ${ip}:${portssl}
</IfVersion>
<?php
}

if ($reverseproxy) {
?>
<IfModule mod_remoteip.c>
<IfVersion >= 2.4>
RemoteIPInternalProxy <?=$ip;?>
RemoteIPHeader X-Real-IP
</IfVersion>
</IfModule>
<?php
}
?>

## MR -- ruid2 not work dor userdir!
<Ifmodule mod_userdir.c>
## MR -- ruid2 not work for userdir!
<IfModule mod_userdir.c>
UserDir enabled
UserDir /home/*/public_html
<?php
Expand All @@ -258,7 +271,7 @@ Listen ${ip}:${portssl}
<?php
}
?>
</Ifmodule>
</IfModule>

<?php
foreach ($certnamelist as $ip => $certname) {
Expand Down
5 changes: 3 additions & 2 deletions kloxo/file/apache/tpl/~lxcenter.conf.tpl
Expand Up @@ -117,7 +117,7 @@ KeepAliveTimeout 15

MaxSpareThreads <?php echo $maxpar_w; ?>

ThreadsPerChild 25
ThreadsPerChild <?php echo $mcfactor; ?>
ServerLimit <?php echo $maxpar_w; ?>

<IfVersion >= 2.4>
Expand All @@ -141,7 +141,8 @@ KeepAliveTimeout 15

MaxSpareThreads <?php echo $maxpar_w; ?>

ThreadsPerChild 25
ThreadsPerChild <?php echo $mcfactor; ?>

ServerLimit <?php echo $maxpar_w; ?>

MaxRequestsPerChild 0
Expand Down
5 changes: 5 additions & 0 deletions kloxo/file/bind/conf/defaults/named.options.conf
Expand Up @@ -34,6 +34,11 @@ options {
};

notify yes;

rate-limit {
responses-per-second 5;
window 5;
};
};

logging {
Expand Down
3 changes: 2 additions & 1 deletion kloxo/file/php-fpm/tpl/php53-fpm-pool.conf.tpl
Expand Up @@ -126,7 +126,8 @@ rlimit_core = 0

;chdir = /
catch_workers_output = yes
security.limit_extensions = .php .php3 .php4 .php5
security.limit_extensions = <?=$phpfpm_limit_extensions;?>


env[HOSTNAME] = $HOSTNAME
env[PATH] = /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Expand Down
26 changes: 0 additions & 26 deletions kloxo/httpdocs/driver/pserver/phpini__synclib.php
Expand Up @@ -4,34 +4,8 @@ class phpini__sync extends Lxdriverclass
{
function initString()
{
// $pclass = $this->main->getParentClass();

$this->main->fixphpIniFlag();

// $this->setInitString();

}

function setInitString()
{
$modulelist = array('xcache', 'suhosin', 'ioncube', 'zend');

foreach ($modulelist as &$m) {
if ($this->main->phpini_flag_b->isOn("enable_{$m}_flag")) {
$active = isPhpModuleActive($m);

if ($active) {
setPhpModuleActive($m);
}
} else {
setPhpModuleInactive($m);
}
}
}

function enableDisableModule($flag, $mod)
{
// MR -- not used since 6.2.x
}

function createIniFile()
Expand Down

1 comment on commit aac99f4

@fossxplorer
Copy link

@fossxplorer fossxplorer commented on aac99f4 May 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for including rate_limit for bind and mysql root password change with --skip-grant-table as per our discussion in the forum!

Please sign in to comment.