Probably you are missing semicolon “;” at the end of some configuration statement.
Category Archives: Hosting
MySQL downtime: Set max_user_connections
Fix: ERROR 1040 (00000): Too many connections
GRANT USAGE ON *.* TO ‘batchjob1’@’localhost’ WITH MAX_USER_CONNECTIONS 10;
Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened
Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened
jsapi:21 Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened
Usually it means it can be DNS related issues or firewall, please check /etc/resolv.conf
mysql copy table
CREATE TABLE new_table LIKE old_table;
ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation ‘=’
alter table table_name convert to character set utf8 collate utf8_general_ci;
SQL round after division
ROUND(value/100, 2)
mysql delete table values
truncate table_name;
or
delete from table_name; # will not reseting the autoincremental id
mysql avoid table lock during backup
mysqldump –lock-tables=false
wordpress error establishing a database connection
vi wp-config.php
define(‘WP_ALLOW_REPAIR’, true);
http://www.yoursite.com/wp-admin/maint/repair.php
wordpress sidebar drop to bottom
Sidebar drop may be caused by:
Unclosed div tags and other code errors
Too wide content (images, videos, tables, etc.)
CSS editing mistakes
A badly designed theme
Check your site with a code validator:
http://validator.w3.org/
also you can try search unclosed div or other tags:
http://jona.ca/blog/unclosed-tag-finder
install_driver(mysql) failed: Can’t load ‘/usr/lib64/perl5/vendor_perl/auto/DBD/mysql/mysql.so’ for module DBD::mysql: libmysqlclient.so.16:
Fix.
su – munin
vi ~/.bash_profile
export LD_LIBRARY_PATH=$PATH:/usr/local/cpanel/3rdparty/lib64/mysql
munin-run mysql_connections
but this works only from curret shell session, so you need:
vi /etc/ld.so.conf.d/munin.conf
/usr/local/cpanel/3rdparty/lib64/mysql
ldconfig
/etc/init.d/munin-node restart
DBD::mysql::db do failed: Illegal mix of collations
Full error message:
DBD::mysql::db do failed: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation ‘=’
The system failed to lock the file “/home/username/etc/domain.tld/_privs.json” because of an error: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 88.
Fix.
chown username.username /home/username/etc/domain.tld/
mod_security trics
SecRuleEngine On
SecAuditEngine RelevantOnly
SecAuditLogType Serial
SecAuditLog logs/mod_security.log
# a folder where mod_security will store data variables
SecDataDir logs/mod_security-data
# ignore requests from localhost or some other IP
SecRule REMOTE_ADDR "^127\.0\.0\.1$" "phase:1,nolog,allow"
# for all non static urls count requests per second per ip
# (increase var requests by one, expires in 1 second)
SecRule REQUEST_BASENAME "!(\.avi$|\.bmp$|\.css$|\.doc$|\.flv$|\.gif$|\
\.htm$|\.html$|\.ico$|\.jpg$|\.js$|\.mp3$|\
\.mpeg$|\.pdf$|\.png$|\.pps$|\.ppt$|\.swf$|\
\.txt$|\.wmv$|\.xls$|\.xml$|\.zip$)"\
"phase:1,nolog,pass,initcol:ip=%{REMOTE_ADDR},setvar:ip.requests=+1,expirevar:ip.requests=1"
# if there where more than 5 requests per second for this IP
# set var block to 1 (expires in 5 seconds) and increase var blocks by one (expires in an hour)
SecRule ip:requests "@eq 5" "phase:1,pass,nolog,setvar:ip.block=1,expirevar:ip.block=5,setvar:ip.blocks=+1,expirevar:ip.blocks=3600"
# if user was blocked more than 5 times (var blocks>5), log and return http 403
SecRule ip:blocks "@ge 5" "phase:1,deny,log,logdata:'req/sec: %{ip.requests}, blocks: %{ip.blocks}',status:403"
# if user is blocked (var block=1), log and return http 403
SecRule ip:block "@eq 1" "phase:1,deny,log,logdata:'req/sec: %{ip.requests}, blocks: %{ip.blocks}',status:403"
# 403 is some static page or message
ErrorDocument 403 "
take it easy yo!"
getpwuid: couldn’t determine user name from uid 4294967295
vi httpd.conf
User nobody
Group nobody
exim: no message ids given after -Mrm option
If you have such error: Line mismatch: 1d
exim -bp | grep "h" | awk '{print $3}' | xargs exim -Mrm
or just simple:
exim -bp | awk '{print $3}' | xargs exim -Mrm