On your Cpanel > MySQL Databases > Current Databases size shows as 0.00 MB
To correct this please do the following process
1. vi /var/cpanel/cpanel.config
disk_usage_include_sqldbs value should be "0" change to "1" and wq from your vi editor
ie, it should be as disk_usage_include_sqldbs=1
2. # /scripts/update_db_cache
3. Login to WHM >> Main >> Server Configuration >> Tweak Settings
put "tick" mark for "Calculate the disk usage of account MySQL and PostgreSQL databases" under SQL section
By default it is tick marked in WHM
This will fix your issues. :)
Sunday, September 26, 2010
PPP [Pear to Pear] module installation on OpenVz VPS
For enable PPP you need Hardware Node access.
To insert module to your existing Kernel.Please do the following steps
1. # modprobe ppp_async
2. # modprobe ppp_deflate
To check the module installed or not
3. # lsmod | grep ppp
4. # vzctl set VEID –devices c:108:0:rw –save
5. # vzctl exec VEID mknod /dev/ppp c 108 0
6. # vzctl exec VEID chmod 600 /dev/ppp
7. # vzctl restart VEID
8. # vzctl enter VEID
9. # /usr/sbin/pppd --> for confirming
To insert module to your existing Kernel.Please do the following steps
1. # modprobe ppp_async
2. # modprobe ppp_deflate
To check the module installed or not
3. # lsmod | grep ppp
4. # vzctl set VEID –devices c:108:0:rw –save
5. # vzctl exec VEID mknod /dev/ppp c 108 0
6. # vzctl exec VEID chmod 600 /dev/ppp
7. # vzctl restart VEID
8. # vzctl enter VEID
9. # /usr/sbin/pppd --> for confirming
Thursday, September 23, 2010
Removing malicious Code
Removing malicious Code from your pages:-
Once your server compromised or hacked, most case they have insert some malicious Codes/ scripts on all your web pages. So these following commands will help you to remove completely from your server.
First we need to identify which files are infected with malicious Code/malicious Scripts, for that we can use the following command
1. grep -Ri SEARCH WORD DIRECTORYNAME
OR
2. grep -Ri --files-with-matches 'searchword' directorname(or). for current directory
Script for searching a word in a file and delete that line
#!/bin/bash
grep -rl --include=*.{php,js,html} 123 $1 | xargs sed -i".bckp" '/123/d'
rm -f $1/*.bckp
Once your server compromised or hacked, most case they have insert some malicious Codes/ scripts on all your web pages. So these following commands will help you to remove completely from your server.
First we need to identify which files are infected with malicious Code/malicious Scripts, for that we can use the following command
1. grep -Ri SEARCH WORD DIRECTORYNAME
OR
2. grep -Ri --files-with-matches 'searchword' directorname(or). for current directory
Script for searching a word in a file and delete that line
#!/bin/bash
grep -rl --include=*.{php,js,html} 123 $1 | xargs sed -i".bckp" '/123/d'
rm -f $1/*.bckp
Sunday, September 19, 2010
Friday, September 17, 2010
WORDPRESS
1. Fatal error:Call to undefined function wp() in /home/user/public html/wp-blog-header.php on line14
Solution:-
This issue is due to your wordpress wp-config.php content. For my case wp-config.php content was null. So i have copied the wp-config.php from backup and solve this issue.
or if you dont have one, there is one example:wp-config-sample.php change the name of that file to wp-config.php and change the database connection configures
2.Wordpress site very slow
This might be because of the plugins that you have installed on your wordpress site. Try disabling the last installed plugin or disable them all. To disable, you can follow the following steps
Cpanel --> PhpMyadmin --> Select Database -->> wp-options -->>select active_plugins(will be on page 2) -->>Edit
Copy down the plugins to somewhere else
Remove the plugins from there
Click GO
Then we can re enable it one by one form wordpress admin dashboard, so that we can find the plugin which caused the problem.
NB: If this solution is not successful, you can check these options: Upgrade to the Latest Version, Check With The Host, Optimize the Database, Verify That it Isn’t A Connectivity Issue,
3.Blank Pages in home page or admin page
This is due to recently added plugin , so we can avoid this by disable the last activated plugin by using your PHPMYADMIN[ select the particular database from wp_options > active_plugins]
or this may due to the wrong theme selection , all your wordpress themes are located on /wp-content/themes directory. So we can select the correct theme to "template" and "stylesheet" fields on your Phpmyadmin >> wp-options
*Idea from Dan Thompson
4. Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/user/public_html/wp-content/plugins/web-traffic-genius-pro/curl_functions.php on line 80 or 37 etc
In this situation we need to check php.ini whether safe_mode set to OFF and open_basedir is comment out. In my case open_basedir was not comment out. So i have copied a php.ini file to wp-admin directory and change the line as ;open_basedir = "/home:/tmp:/usr"
5 Problems when trying to open a post from categories list.
or RSS Feed time out
Solution:- Try disabling all your plugins, then see if you can access the feed and the categories. If you can, you then need to re-activate the plugins 1 by 1 until you find which one is causing the site to stop loading correctly.
6 increase the upload size
Solution: copy a php.ini file on your home directory and paste the line
upload_max_filesize = 32M(your required size)
Solution:-
This issue is due to your wordpress wp-config.php content. For my case wp-config.php content was null. So i have copied the wp-config.php from backup and solve this issue.
or if you dont have one, there is one example:wp-config-sample.php change the name of that file to wp-config.php and change the database connection configures
2.Wordpress site very slow
This might be because of the plugins that you have installed on your wordpress site. Try disabling the last installed plugin or disable them all. To disable, you can follow the following steps
Cpanel --> PhpMyadmin --> Select Database -->> wp-options -->>select active_plugins(will be on page 2) -->>Edit
Copy down the plugins to somewhere else
Remove the plugins from there
Click GO
Then we can re enable it one by one form wordpress admin dashboard, so that we can find the plugin which caused the problem.
NB: If this solution is not successful, you can check these options: Upgrade to the Latest Version, Check With The Host, Optimize the Database, Verify That it Isn’t A Connectivity Issue,
3.Blank Pages in home page or admin page
This is due to recently added plugin , so we can avoid this by disable the last activated plugin by using your PHPMYADMIN[ select the particular database from wp_options > active_plugins]
or this may due to the wrong theme selection , all your wordpress themes are located on /wp-content/themes directory. So we can select the correct theme to "template" and "stylesheet" fields on your Phpmyadmin >> wp-options
*Idea from Dan Thompson
4. Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/user/public_html/wp-content/plugins/web-traffic-genius-pro/curl_functions.php on line 80 or 37 etc
In this situation we need to check php.ini whether safe_mode set to OFF and open_basedir is comment out. In my case open_basedir was not comment out. So i have copied a php.ini file to wp-admin directory and change the line as ;open_basedir = "/home:/tmp:/usr"
5 Problems when trying to open a post from categories list.
or RSS Feed time out
Solution:- Try disabling all your plugins, then see if you can access the feed and the categories. If you can, you then need to re-activate the plugins 1 by 1 until you find which one is causing the site to stop loading correctly.
6 increase the upload size
Solution: copy a php.ini file on your home directory and paste the line
upload_max_filesize = 32M(your required size)
Friday, September 10, 2010
Advanced DNS Zone Editor
For enabling Advanced DNS Zone Editor on your cpanel Please do the following
Main >> Packages >> Feature Manager
Edit a Feature List (Click "Edit") There you can put tick mark on your required fields.
Main >> Packages >> Feature Manager
Edit a Feature List (Click "Edit") There you can put tick mark on your required fields.
Wednesday, September 8, 2010
DDOS ATTACK
Symptoms
*Unusual slow network performance
*Unavailability of a particular web site
*Inability to access any web site
*increase the number of spam emails
There are some paid services are there for doing this DDOS attack for the compting companies server to put down. What they are doing , accessing the website from different geo-location/IPs . That is the no of connections made by them should be greater your web server able to handle.
Following command will give you a sorted list of IP addresses that are being connected to the server at port 80:-
netstat -n | awk '{ print $5 }' | cut -d ":" -f 1 | grep "[1-9]" | sort | uniq -c | sort -n
netstat -plan |grep :80 | awk '{print $5}' |cut -d: -f1 |sort |uniq -c |sort -n
You can use the following command to block the IP address:-
iptables -A INPUT -s IP --dport 80 -p tcp -j DROP
There are some scripts will automatically help you against DoS attacks on your server
1. DDoS Deflate
They are using the command " netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n " on their script.
Configuration file is located on /usr/local/ddos/ddos.conf
IP addresses are automatically unblocked after a preconfigured time limit (default: 600 seconds)
To install, simply follow these directions:-
cd /usr/local/src/
wget http://www.inetbase.com/scripts/ddos/install.sh
chmod 0700 install.sh
./install.sh
Installing DOS-Deflate 0.6
Downloading source files.........done
Creating cron to run script every minute.....(Default setting).....done
Installation has completed.
Config file is at /usr/local/ddos/ddos.conf
Please send in your comments and/or suggestions to zaf@vsnl.com
quit from the page
After installing we can do the configuration on /usr/local/ddos/ddos.conf with your favourite editor
NO_OF_CONNECTIONS=150 (it is the default value)
BAN_PERIOD=600(it is the default value) it means Number of seconds the banned ip should remain in blacklist.
==================
Hardening sysctl.conf
/etc/sysctl.conf using your favorite text editor and add the following
# Enable IP spoofing protection, turn on Source Address Verification
net.ipv4.conf.all.rp_filter = 1
# Enable TCP SYN Cookie Protection
net.ipv4.tcp_syncookies = 1
After that Add the below code in /etc/rc.local and restart network
for f in /proc/sys/net/ipv4/conf/*/rp_filter;
do echo 1 > done
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
===================
*Unusual slow network performance
*Unavailability of a particular web site
*Inability to access any web site
*increase the number of spam emails
There are some paid services are there for doing this DDOS attack for the compting companies server to put down. What they are doing , accessing the website from different geo-location/IPs . That is the no of connections made by them should be greater your web server able to handle.
Following command will give you a sorted list of IP addresses that are being connected to the server at port 80:-
netstat -n | awk '{ print $5 }' | cut -d ":" -f 1 | grep "[1-9]" | sort | uniq -c | sort -n
netstat -plan |grep :80 | awk '{print $5}' |cut -d: -f1 |sort |uniq -c |sort -n
You can use the following command to block the IP address:-
iptables -A INPUT -s IP --dport 80 -p tcp -j DROP
There are some scripts will automatically help you against DoS attacks on your server
1. DDoS Deflate
They are using the command " netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n " on their script.
Configuration file is located on /usr/local/ddos/ddos.conf
IP addresses are automatically unblocked after a preconfigured time limit (default: 600 seconds)
To install, simply follow these directions:-
cd /usr/local/src/
wget http://www.inetbase.com/scripts/ddos/install.sh
chmod 0700 install.sh
./install.sh
Installing DOS-Deflate 0.6
Downloading source files.........done
Creating cron to run script every minute.....(Default setting).....done
Installation has completed.
Config file is at /usr/local/ddos/ddos.conf
Please send in your comments and/or suggestions to zaf@vsnl.com
quit from the page
After installing we can do the configuration on /usr/local/ddos/ddos.conf with your favourite editor
NO_OF_CONNECTIONS=150 (it is the default value)
BAN_PERIOD=600(it is the default value) it means Number of seconds the banned ip should remain in blacklist.
==================
Hardening sysctl.conf
/etc/sysctl.conf using your favorite text editor and add the following
# Enable IP spoofing protection, turn on Source Address Verification
net.ipv4.conf.all.rp_filter = 1
# Enable TCP SYN Cookie Protection
net.ipv4.tcp_syncookies = 1
After that Add the below code in /etc/rc.local and restart network
for f in /proc/sys/net/ipv4/conf/*/rp_filter;
do echo 1 > done
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
===================
Subscribe to:
Posts (Atom)