How to create tar.gz in Linux :
tar -zcvf "archive.tar.gz" "file.sql"
tar -zcvf "archive.tar.gz" "/home/example/public_html/"
How to extract tar.gz in Linux :
tar -zxvf "archive.tar.gz"
How to create tar.gz in Linux :
tar -zcvf "archive.tar.gz" "file.sql"
tar -zcvf "archive.tar.gz" "/home/example/public_html/"
How to extract tar.gz in Linux :
tar -zxvf "archive.tar.gz"
You can run these commands to install PECL memcache (not memcached).
However, this memcache will work with memcached.
wget http://pecl.php.net/get/memcache-3.0.8.tgz
tar xvfz memcache-3.0.8.tgz
cd memcache-3.0.8
phpize
./configure
make
make install
Take note of the php extensions directory that memcache is installed in.
Mine is: /usr/local/lib/php/extensions/no-debug-non-zts-20020429/
Then add this line to your php.ini
extension="/usr/local/lib/php/extensions/no-debug-non-zts-20020429/memcache.so"
I use Centos & WHM.
Here is how to install memcached (not memcache) using command line.
First, installing memcached
wget http://memcached.org/latest
tar -zxvf memcached-1.x.x.tar.gz
cd memcached-1.x.x
./configure && make && make test && sudo make install
If you are using WHM & CSF, under CentOS, you may follow this steps to change SSH port from 22 (default) to something else 🙂
To install ConfigServer Security & Firewall (CSF) in WHM, please run this commands in your SSH terminal one by one.
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
After it completes, there is a new menu in WHM which is under “Plugins” category, named “ConfigServer Security & Firewall”. 🙂
Here i will explain how to install Litespeed webserver in WHM.
According to the Litespeed wiki :
wget http://www.litespeedtech.com/packages/cpanel/lsws_whm_autoinstaller.sh
chmod a+x lsws_whm_autoinstaller.sh
./lsws_whm_autoinstaller.sh TRIAL 2 1000 admin a1234567 root@localhost 1 0
If you have litespeed license, replace “TRIAL” with your serial number.
You can replace “admin” with another litespeed admin username.
You can replace “a1234567 ” with another litespeed admin password.
You can replace “root@localhost” with another litespeed admin e-mail.
To export a mysql database by linux command line,
for example your database name is my_database, your mysql username is my_username, and your mysql password is my_password, you can use this command :
mysqldump --opt --single-transaction -umy_username -pmy_password my_database > /your/path/here/export.sql
Note: after “-u” and “-p”, there is NO space. 🙂
Recently when i optimized some mysql tables from phpmyadmin, some of the tables were “locked” and showed as “in use” on phpmyadmin. The tables could not be used, read, etc. So the script was stopped working.
I have tried to repair / check / analyze from phpmyadmin but i couldn’t repair it.
So i tried to repair the mysql tables from SSH.
Go to your database directory. Usually it is located on
/etc/var/lib/mysql/YOUR_DATABASE_NAME/
So use this command first
cd /etc/var/lib/mysql/YOUR_DATABASE_NAME/
Next, use this command
myisamchk --safe-recover --force YOUR_TABLE_NAME
And the MySQL table should be repaired now.