/usr/sbin/dmidecode
July 9, 2012
July 1, 2012
Error ip_conntrack: table full, dropping packet
Error ip_conntrack: table full, dropping packet terjadi karena banyaknya kunjungan ke server dan menyebabkan database iptable menjadi penuh
solusi:
1. naikkan kapasitas iptable
echo 131072 > /proc/sys/net/ipv4/ip_conntrack_max
2. flush kosongkan iptable
iptables -P
iptables -F
June 15, 2012
Mod_Deflate
Ke cPanel >> Apache Configuration >> Include Editor >> Post VirtualHost Include >> All Version Tambahkan kode ini
AddOutputFilterByType DEFLATE text/html text/plain text/xml
# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won’t work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don’t compress images
SetEnvIfNoCase Request_URI \
\.(?:exe|t?gz|zip|bz2|sit|rar)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
Test:
http://www.whatsmyip.org/http-compression-test/
Install Memcache
cd /usr/local/src/
wget https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz
tar xfz libevent*
cd libevent*
./configure
make
sudo make install
sudo ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib
cd /usr/local/src/
wget http://memcached.googlecode.com/files/memcached-1.4.13.tar.gz
tar xfz memcached*
cd memcached*
./configure
make
sudo make install
test memcached
memcached -d -u nobody -m 1024 127.0.0.1 -p 11211
Kalau error
ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
Install libmemcached
cd /usr/local/src/
wget http://launchpad.net/libmemcached/1.0/1.0.4/+download/libmemcached-1.0.4.tar.gz
tar -zxvf libmemcached-1.0.4.tar.gz
cd libmemcached-1.0.4
./configure
make && make install
Install memcached
pecl install memcached
pecl install memcached
http://forums.cpanel.net/f5/memcached-instalation-memcached-so-missing-257942.html
April 5, 2012
‘./eximstats/sends’ is marked as crashed
MySql Error
[ERROR] /usr/sbin/mysqld: Table './eximstats/sends' is marked as crashed and last (automatic?) repair failed
Repair from command line ssh
myisamchk -r /var/lib/mysql/eximstats/sends.MYI
March 26, 2012
Disable PHP Execition
open .htaccess and add
Order Deny,Allow
Deny from all
March 23, 2012
Tuning MySQL Performance with MySQLTuner
You can download the MySQLTuner script as follows:
wget http://mysqltuner.com/mysqltuner.pl
In order to run it, we must make it executable:
chmod +x mysqltuner.pl
Afterwards, we can run it. You need your MySQL root password for it:
./mysqltuner.pl
MySql Configuration
[mysqld]
safe-show-database
skip-locking
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
skip-networking
##used in replication to give each master and slave a unique identity
server-id=1
##amount of seconds during inactivity that MySQL will wait before it will close a connection on a non-interactive connection.
wait_timeout=5
##amount of seconds during inactivity that MySQL will wait before it will close a connection on interactive connection, interactive is mysql shell sessions
interactive_timeout=28800
##The number of seconds that the mysqld server waits for a connect packet before responding with Bad handshake
connect_timeout=5
##If more than this many successive connection requests from a host are interrupted without a successful connection, the server blocks that host from further connections
max_connect_errors=10
#The maximum number of simultaneous connections permitted to any given MySQL user account
max_user_connections=15
##This value indicates how many maximum concurrent connections mysql server can handle. If mysql reaches to it maximum (max) limit then you can see errors like "too many connections".
max_connections=200
##key_buffer_size is the size of the buffer used for index blocks. The key buffer is also known as the key cache.
key_buffer_size=128M
#The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use indexes and thus perform full table scans.
join_buffer_size=1M
##Each session that needs to do a sort allocates a buffer of this size
sort_buffer_size=2M
##Each thread that does a sequential scan allocates a buffer of this size (in bytes) for each table it scans.
read_buffer_size=131072
#The maximum size of one packet or any generated/intermediate string.
max_allowed_packet=2M
##The number of open tables for all threads
table_open_cache=2048
##which sets the number of threads to hold open in memory to service new connections
thread_cache_size=16
##enables applications to give the threads system a hint about the desired number of threads that should be run at the same time.
thread_concurrency=10
##Cache all cacheable query results except for those that begin with SELECT SQL_NO_CACHE.
query_cache_type=1
##Do not cache results that are larger than this number of bytes
query_cache_limit=1M
##The amount of memory allocated for caching query results
query_cache_size=128M
##The number of open tables for all threads
table_cache=5120
tmp_table_size=32M
max_heap_table_size=64M
innodb_buffer_pool_size=64M
innodb_additional_mem_pool_size=8M
innodb_log_file_size=8M
##If a query takes longer than this many seconds, the server increments the Slow_queries status variable
long_query_time=1
##to enable or disable the slow query log
slow_query_log=1
slow-query-log=1
slow_query_log_file=/var/log/mysql/mysql-slow.log
March 22, 2012
Drop memory cache
drop memory cache
crontab -e
*/15 * * * * sync; echo 3 > /proc/sys/vm/drop_caches
March 16, 2012
Nginx
Install NGINX
cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
./nginxinstaller install
Uninstall NGINX
cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
./nginxinstaller uninstall
Nginx Installation error:
File "/scripts/createvhosts.py", line 2, in ?
First uninstall nginx then run this command
wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz
tar fxz Python-2.5.2.tgz
cd Python-2.5.2
./configure
make
make install
Nginx running warning
nginx: [warn] conflicting server name "YOURIPADDRESS" on 66.228.117.248:80, ignored
nginx: [warn] conflicting server name "YOURIPADDRESS" on 66.228.117.248:80, ignored
nginx: [warn] conflicting server name "YOURIPADDRESS" on 66.228.117.248:80, ignored
nginx: [emerg] bind() to YOURIPADDRESS:80 failed (98: Address already in use)
nginx: [emerg] bind() to YOURIPADDRESS:80 failed (98: Address already in use)
nginx: [emerg] bind() to YOURIPADDRESS:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
already running.
run this commands
cd /etc/nginx/vhosts
perl -pi -w -e 's/server_name(.*) YOURIPADDRESS/server_name$1/g;' *
Replace YOURIPADDRESS with the ip address you see in the errors.
Now go to WHM > Tweak settings and change Apache non-SSL IP/port to 0.0.0.0:8081