The following command will optimize all databases in mysql (excpect those that don't support it due to their storage engine).
You can throw the
--auto-repair
flag in if you are brave.
The following command will optimize all databases in mysql (excpect those that don't support it due to their storage engine).
You can throw the
--auto-repair
flag in if you are brave.
If you need to change the TTLs on all domains in Plesk at once, you can massage the database with the following command:
Substitute the TTL values for what you need. Since the flat files are still used by named to provide DNS resolution, those will need to be updated as well. This command will do the trick:
I had occassion to run across the following question recently:
"Plesk was just upgraded to version 9.2.x and all domains now have an overuse policy set to not allow overuse. I can manually change this to allow overuse, but is there a way to do this through the database so I don't have to do it a domain at a time?".
The answer is yes, sort of. Plesk provides a 'domain_pref' utility that allows the setting of many of the parameters related to domain preferences. This allows one to change parameters for domains using the command line instead of logging into the interface. It works on one domain at a time, so some scripting foo is necessary in order to accomplish this on multiple domains.
In regards to the overuse policy, this handy little one-liner will allow the updating of all domains to a specific overuse policy.
There are three options available for the overuse policy.
The script above does the following things:
1. Connects to the Plesk database and selects a list of all domains from the 'domains' table.
2. Runs the 'domain_pref' CLI and sets the overuse policy to 'block'.
It has also come to my attention that the clients will have to have their overuse policy set as well.
As always, BACK UP the psa database before doing anything with the CLI.
If you run into semaphore issues….
First, determine the number of semaphores in use.
Then determine the current settings in the kernel for the number of semaphores.
Look at the 4th field. It shows the maximum number of shared memory segments for the entire system. If your number of semaphores in use is higher than this number, you will need to increase it. You do this in increments of 128. For example, if your ipcs output is 267 and your kernel settings are '384 64000 64 256' then you have exceeded the number of available shared memory segments.
Add increments of 128 to each of the numbers to exceed what the system is currently using. In this case, you can just add 1×128 so your new values would be: '512 64128 192 384'.
Edit /etc/sysctl.conf and look for "kernel.sem=". Add your new values here, replacing what is here (or better yet, comment the line and add a new one with the new values).
Once you have added this, all you have to do (on a Redhat box) is to issue
in order to use the new values.
Follow these steps to install APC on a RHEL 5 server.
1. Install php-devel for phpize (if not installed).
2. Install the apache devel pkgs for apxs (if needed).
3. Make /tmp executable.
4. Set the memory limit in /usr/share/pear/pearcmd.php to 16M.
5. Install apc.
6. Add a /etc/php.d/apc.ini with the following line:
7. Restart apache (check configuration first for errors).
Remove the ini_set and set /tmp back to noexec.