Skip to main content

Posts

Showing posts from July, 2014

SOME USEFUL LINUX COMMANDS

1. Tar command ============= Create a tar archive -------------------- root@cpanel [/home]# tar cvzf /root/avid.tar.gz avid/ avid/ is the directory name I want to archive. avid.tar.gz is the file name that will be assigned for the archive. /root/avid.tar.gz  is the path where the tar file will be stored in to, Extract a particular file from tar archive to a required location -------------------------------------------------------------- root@cpanel [/home]#  tar xvzf avid.tar.gz -C /root/ avid/public_html/wp-config.php avid/public_html/wp-config.php In the above example the file  avid/public_html/wp-config.php from the tar file avid.tar.gz is extracted to the location /root/. View the content inside an existing Tar archive -------------------------------------------------- root@cpanel [/home/avid/public_html]# tar tvzf content.tar.gz drwxr-xr-x avid/avid         0 2014-04-16 23:36 wp-content/ drwxr-xr-x avid/avid         0 2014-04-16 23:36 wp-content/plugins

HOW TO ENABLE MYSQL GENERAL LOG OR QUERY LOG

We can view the mysql query and activity by the same, Please see, mysql> set global general_log='ON'; Query OK, 0 rows affected (0.00 sec) mysql> show variables like 'general_log%'; +------------------+-------+ | Variable_name    | Value | +------------------+-------+ | general_log      | ON    | | general_log_file | OFF   | +------------------+-------+ 2 rows in set (0.00 sec) mysql> set global general_log_file='/var/lib/mysql/mysql.log'; Query OK, 0 rows affected (0.01 sec) mysql> show variables like 'general_log%'; +------------------+--------------------------+ | Variable_name    | Value                    | +------------------+--------------------------+ | general_log      | ON                       | | general_log_file | /var/lib/mysql/mysql.log | +------------------+--------------------------+ 2 rows in set (0.00 sec) mysql> Ctrl-C -- exit! Aborted root@cpanel [~]# touch /var/lib/mysql/mysql.log root@cpa

ENABLE HTML EDITOR IN HORDE (CPANEL)

1) Open the file /usr/local/cpanel/base/horde/imp/config/ mime_drivers.php 2) Change “‘inline’ => falce,” to “‘inline’ => true,” as below and save the file. $mime_drivers['imp']['html'] = array( ‘inline’ => true, : : 3) Restart cPanel service : /etc/init.d/cpanel restart 4) Restart IMAP : /scripts/restartsrv courier

MYSQL TUNER TO IMPROVE PERFORMANCE AND TO OPTIMIZE MYSQL

Check the uptime of the mysqlserver, it should be greater than 24 hours mysql> \s; -------------- mysql  Ver 14.14 Distrib 5.1.73, for unknown-linux-gnu (x86_64) using readline 5.1 Connection id:          47240 Current database: Current user:           root@localhost SSL:                    Not in use Current pager:          stdout Using outfile:          '' Using delimiter:        ; Server version:         5.1.73-cll MySQL Community Server (GPLv2) Protocol version:       10 Connection:             Localhost via UNIX socket Server characterset:    latin1 Db     characterset:    latin1 Client characterset:    latin1 Conn.  characterset:    latin1 UNIX socket:            /var/lib/mysql/mysql.sock Uptime:                 10 days 10 hours 37 min 4 sec <------------check this as it is recommended Download the script and proceed the steps below root@cpanel [~]# wget mysqltuner.pl --2014-07-24 03:10:01--  http://mysqltuner.pl/ change the permission

WORDPRESS TRICKS (PASSWORD,THEME,URL)

1. CHANGE THE PASSWORD (USUALLY REQUIRED WHEN NEED TO CHANGE ADMIN PASS) mysql> update wp_users set user_pass=MD5('newpass') where ID= 1; Query OK, 1 row affected (0.00 sec) Rows matched: 1  Changed: 1  Warnings: 0 Here newpass in the bracket is the password you need to set. See the detailed explanation with snippet below Catch your wordpress database from configuration file, (wp-config.php). Verify it Here wordpress is the database name from configuration. I have verified it is available in the server issuing below command root@cpanel [~]# mysqlshow | grep wordpress | wordpress  Switch to the database from Mysql prompt root@cpanel [~]# mysql Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 47061 Server version: 5.1.73-cll MySQL Community Server (GPLv2) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its