Unable to execute SQL: Table ‘./db/wp_comments’ is marked as crashed and should be repaired

How to Fix: Crashed MySQL Database

If your database is marked as crashed and needs to be repaired you may find it will not backup (or migrate) using mysqldump. In these instances you need to login to mysql and run the check/repair process. It’s very easy.

First, you need to authenticate to the mysql server. The example below is for Plesk servers:

# mysql -uadmin -p`cat /etc/psa/.psa.shadow`

Let’s check the table and see the current status:

# mysql> check table db.wp_comments;
+-----------------------------------+-------+----------+-----------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-----------------------------------+-------+----------+-----------------------------------------------------------+
| db.wp_comments | check | warning | Table is marked as crashed |
| db.wp_comments | check | error | Size of datafile is: 26984448 Should be: 26985708 |
| db.wp_comments | check | error | Corrupt |
+-----------------------------------+-------+----------+-----------------------------------------------------------+
3 rows in set (0.00 sec)

Now we can see the problem, let’s run the REPAIR TABLE facility:

# mysql> repair table db.wp_comments;
+-----------------------------------+--------+----------+-------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-----------------------------------+--------+----------+-------------------------------------------------------+
| db.wp_comments | repair | info | Found block that points outside data file at 26984408 |
| db.wp_comments | repair | status | OK |
+-----------------------------------+--------+----------+-------------------------------------------------------+
2 rows in set (4.23 sec)

That’s now all fixed. Yes, it’s that easy! Let’s check the table again to be 100% sure:

# mysql> check table db.wp_comments;
+-----------------------------------+-------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-----------------------------------+-------+----------+----------+
| db.wp_comments | check | status | OK |
+-----------------------------------+-------+----------+----------+
1 row in set (0.05 sec)

You can now transfer your MySQL database, dump it or re-migrate it as required.

MICROLITE11 Plesk 12 Upgrade

Plesk-12-Banner

MICROLITE11.COM – Upgrades

During the period 12th thru 16th April the server hardware and plesk panel will be completely upgraded.

HARDWARE: The new hardware will improve the performance and reliability of the server. Response times and security will be greatly increased. The server will also be migrated to our new UK datacenter. The old IP address was 184.173.23.58. The new IP address will be 5.77.60.37.

SOFTWARE: The core OS of the new server will be of the latest stable version. PHP, MySQL  and all other features will be of the latest production versions.

PANEL: The Plesk Panel will be upgrade to Plesk 12, the current latest version of Plesk. This will provide the very latest features, functionality and security for your accounts.

WEBMAIL: AtMail is now replaced with the awesome RoundCube. Your username is in the format name@yourdomain.co.uk. Your passwords are unchanged. If you do have a problem with your mail password simply change it or request support to change it for you.

COST: These are no-cost upgrades, there will be no additional charges to your account.

Plesk 12 User Guidehttp://download1.parallels.com/Plesk/PP12/12.0/Doc/en-US/online/plesk-customer-guide/

Please refrain from making significant changes to your web site during this period. The migration of the data will take many hours. We request that you put off any changes until Monday to avoid an inconsistent transfer of your site data.

MICROLITE10 Plesk 12 Upgrade

Plesk-12-Banner

MICROLITE10.COM – Upgrades

During the weekend 7th/8th/9th February the server hardware and plesk panel will be completely upgraded.

HARDWARE: The new hardware will improve the performance and reliability of the server. Response times and security will be greatly increased. The server will also be migrated to our new UK datacenter. The old IP address was 174.123.47.58. The new IP address will be 5.77.60.40.

SOFTWARE: The core OS of the new server will be of the latest stable version. PHP, MySQL  and all other features will be of the latest production versions.

PANEL: The Plesk Panel will be upgrade to Plesk 12, the current latest version of Plesk. This will provide the very latest features, functionality and security for your accounts.

WEBMAIL: AtMail is now replaced with the awesome RoundCube. Your username is in the format name@yourdomain.co.uk. Your passwords are unchanged. If you do have a problem with your mail password simply change it or request support to change it for you.

COST: These are no-cost upgrades, there will be no additional charges to your account.

Plesk 12 User Guidehttp://download1.parallels.com/Plesk/PP12/12.0/Doc/en-US/online/plesk-customer-guide/

Please refrain from making significant changes to your web site during this period. The migration of the data will take many hours. We request that you put off any changes until Monday to avoid an inconsistent transfer of your site data.UPDATE: 11/02 05:00 – The Plesk 12 migration is complete and live. All files have been migrated. If you suspect your have any missing files, databases or email please log a ticket with the helpdesk with details. The old server will remain online for 7 days and we can re-migrate any accounts during this time.UPDATE: 11/02/07:30 - During the migration process, some customers may have some emails duplicated. This is because during the copy, for caution, we overlapped to ensure no emails were missed. This means some emails may be copied twice. Clients can just delete any unwanted emails if this occurs for them.

MICROLITE8 Plesk 12 Upgrade

Plesk-12-Banner

MICROLITE8.COM – Upgrades

During the period 14th/17th February the server hardware and plesk panel will be completely upgraded.

HARDWARE: The new hardware will improve the performance and reliability of the server. Response times and security will be greatly increased. The server will also be migrated to our new UK datacenter. The old IP address was 184.173.23.13. The new IP address will be 5.77.60.33.

SOFTWARE: The core OS of the new server will be of the latest stable version. PHP, MySQL  and all other features will be of the latest production versions.PANEL: The Plesk Panel will be upgrade to Plesk 12, the current latest version of Plesk. This will provide the very latest features, functionality and security for your accounts.WEBMAIL: AtMail is now replaced with the awesome RoundCube. Your username is in the format name@yourdomain.co.uk. Your passwords are unchanged. If you do have a problem with your mail password simply change it or request support to change it for you.COST: These are no-cost upgrades, there will be no additional charges to your account.

Plesk 12 User Guidehttp://download1.parallels.com/Plesk/PP12/12.0/Doc/en-US/online/plesk-customer-guide/

Please refrain from making significant changes to your web site during this period. The migration of the data will take many hours. We request that you put off any changes until Monday to avoid an inconsistent transfer of your site data.UPDATE: 17/02 05:00 – The Plesk 12 migration is complete and live. All files have been migrated. If you suspect your have any missing files, databases or email please log a ticket with the helpdesk with details. The old server will remain online for 7 days and we can re-migrate any accounts during this time.UPDATE: 17/02 06:00 - During the migration process, some customers may have some emails duplicated. This is because during the copy, for caution, we overlapped to ensure no emails were missed. This means some emails may be copied twice. Clients can just delete any unwanted emails if this occurs for them.

MICROLITE5 Plesk 12 Upgrade

Plesk-12-Banner

MICROLITE5.COM – Upgrades

During the period 7th/8th February the server hardware and plesk panel will be completely upgraded.

HARDWARE: The new hardware will improve the performance and reliability of the server. Response times and security will be greatly increased. The server will also be migrated to our new UK datacenter. The old IP address was 184.173.23.61. The new IP address will be 5.77.60.29.

SOFTWARE: The core OS of the new server will be of the latest stable version. PHP, MySQL  and all other features will be of the latest production versions.PANEL: The Plesk Panel will be upgrade to Plesk 12, the current latest version of Plesk. This will provide the very latest features, functionality and security for your accounts.

WEBMAIL: AtMail is now replaced with the awesome RoundCube. Your username is in the format name@yourdomain.co.uk. Your passwords are unchanged. If you do have a problem with your mail password simply change it or request support to change it for you.

COST: These are no-cost upgrades, there will be no additional charges to your account.

Plesk 12 User Guidehttp://download1.parallels.com/Plesk/PP12/12.0/Doc/en-US/online/plesk-customer-guide/

Please refrain from making significant changes to your web site during this period. The migration of the data will take many hours. We request that you put off any changes until Monday to avoid an inconsistent transfer of your site data.UPDATE: 07/02 05:00 – The Plesk 12 migration is complete and live. All files have been migrated. If you suspect your have any missing files, databases or email please log a ticket with the helpdesk with details. The old server will remain online for 7 days and we can re-migrate any accounts during this time.

UPDATE: 07/02 06:00 - During the migration process, some customers may have some emails duplicated. This is because during the copy, for caution, we overlapped to ensure no emails were missed. This means some emails may be copied twice. Clients can just delete any unwanted emails if this occurs for them.

Plesk Server Upgrades – Incoming

Plesk-12-Banner

So that we can continue to provide high levels of performance to all our hosting clients we are planning a number of upgrades to both server hardware and control panel software for 2015.

Plesk 9 – We know many of you love this old panel but unfortunately it’s time to say goodbye to it. All Plesk 9 servers will be upgraded to Plesk 11.5 during Q1 2015. Plesk 11.5 provide higher performance, security and a multitude of new features over Plesk 9. The server hardware will be completely replaced with current high performance hardware.

Plesk 10 – The remaining Plesk 10 servers will be upgraded to Plesk 11.5 during Q1 2015. The server hardware will be completely replaced with current high performance hardware.

Plesk 11/11.5 – Besides security and panel updates, these servers will remain as they are.

Plesk 12 – From Q2 2015 we will be rolling out Plesk 12 for all new accounts. We will offer free migrations from Plesk 11/11.5 to Plesk 12 when requested.

We are committed to ensure we have the highest performance and security available for all of our clients. We will update you directly when your server is affected with specific upgrade dates. If you have any questions please do not hesitate to contact the Helpdesk.

Find all WordPress folders with 777 permissions

How to find all folders with 777 permissions


As the owner of a dedicated server provided shared hosting services, you will find that many of your clients will install applications such as WordPress. So far so good. However, once they start getting stuck with file and folder permissions, they generally go crazy and set everything to 777 in order to fix the problems. Great, they get their site working! Now begin your problems.

With these liberal file and folder permissions together with some not-so-well written plugins, it is only a matter of time before the hackers and crackers target these weak WordPress sites and start injecting all manner of redirects and mail spammers on your server.

Using ‘find’ to locate those weaknesses

So, here is a nifty solution to find all those weak WordPress installations. The following find will list all WordPress installations that contain folders with 777 permissions:

find /var/www/vhosts/*/httpdocs/wp-content -perm 0777 -type d | grep -v "wp-content/"

Give this a whirl on your Plesk server and take a look at the list, navigate to each folder and tighten up the permissions as below:

cd /var/www/vhosts/dodgydomain.co.uk/httpdocs
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 750 ../httpdocs

These permission changes eliminate all unnecessary 777 permissions.

Ok, let’s automate the whole process

What? You have lots of these? Then here is a nifty script to automate the process for you:

df=`find /var/www/vhosts/*/httpdocs/wp-content -perm 0777 -type d | grep -v "wp-content/" \
| sed "s/wp-content//g"`

for line in $df;
  do
    echo $line
    cd $line
    find $line -type d -exec chmod 755 {} \;
    find $line -type f -exec chmod 644 {} \;
    chmod 750 $line
  done

This makes things a little more difficult for any would-be injection attempts. If your directory structure is different to the standard Plesk structure simply modify the find command as required.

Server Relocation (Scheduled) 11-12 November

MICROLITE14 Server Relocation (Scheduled)

Affecting Server - M14 | Priority - Critical

UK Cheapest has experienced tremendous growth over the last decade and we couldn’t have done this without you. With the growth which we have experienced year over year, it has come to the stage where we have utilised most of our existing data centre space resulting in us needing to prepare ourselves for the future.

Throughout the November 2013, we will be migrating our data centre hardware to a larger data centre in Reading and your server(s) hardware will need to be moved to our new data centre space.The migration of your server is scheduled to commence on 11-11-2013 and will be completed between 10 PM UK time on 11-11-2013 and 6 AM UK time on 12-11-2013. We regret to inform you that your service will be unavailable during this migration process.

We will take a complete backup of your server before migrating it to the new data centre. If you have any questions regarding your server migration we encourage you to respond to this ticket where one of our senior technicians will be happy to answer any questions or concerns you may have.

We would like to take this opportunity to apologies in advance for the disruption and inconvenience this migration may cause you and we will do everything we can to minimise it.

Yours sincerely,

Support Team

Date - 11/11/2013 22:00 – 12/11/2013 06:00

Last Updated - 31/10/2013 10:56

 

Server Relocation (Scheduled) 14-15 November

MICROLITE13 Server Relocation (Scheduled)

Affecting Server - M13 | Priority - Critical

UK Cheapest has experienced tremendous growth over the last decade and we couldn’t have done this without you. With the growth which we have experienced year over year, it has come to the stage where we have utilised most of our existing data centre space resulting in us needing to prepare ourselves for the future.

Throughout the November 2013, we will be migrating our data centre hardware to a larger data centre in Reading and your server(s) hardware will need to be moved to our new data centre space.The migration of your server is scheduled to commence on 14-11-2013 and will be completed between 10 PM UK time on 14-11-2013 and 6 AM UK time on 15-11-2013. We regret to inform you that your service will be unavailable during this migration process.

We will take a complete backup of your server before migrating it to the new data centre. If you have any questions regarding your server migration we encourage you to respond to this ticket where one of our senior technicians will be happy to answer any questions or concerns you may have.

We would like to take this opportunity to apologies in advance for the disruption and inconvenience this migration may cause you and we will do everything we can to minimise it.

Yours sincerely,

Support Team

Date - 14/11/2013 22:00 – 15/11/2013 06:00

Last Updated - 31/10/2013 10:56

Linux Performance: Remount EXT3 partitions using ‘noatime’

Increase Drive Performance by 40% using noatime

Are you feeling the heat on your dedicated server, getting high I/O wait times?

If you are using EXT3 partitions then it is worth checking to see if they are mounted using ‘noatime’. If they are not, then every read to your partition is also a write which can massively reduce hard drive performance.

First, find all partitions mounted as EXT3 mount without noatime:

# mount | grep ext3
/dev/sda1 on / type ext3 (rw,noatime)
/dev/sdb1 on /backup type ext3 (rw)

Any not showing the noatime attribute, simply remount like so:

# mount -o remount,noatime /backup

You can do this without a server reboot, you can do this with the server live and with the partitions already mounted.

Useful Find Examples

Find all HTML files that contain the text “Loading”

# find . -name *.html -exec grep -il "Loading" {} \;

Find all files modified in last 7 days

# find . -mtime -7

Find all .PHP files modified in last 7 days

# find . -name *.php -mtime -7

Find and Remove all PHP files modified in last 7 days

# find . -name *.php -mtime -7 | xargs rm

Find all  files modified in last 10 days that contain text “Loading” and move to /trash

# find . -type f -mtime -10 -exec egrep -l "Loading" {} \; -exec mv -f {} /trash \;

WordPress File and Folder Permissions

Tighten Up WordPress File and Folder permissions

If you used an auto installer for WordPress you may find that many of your files and folders have 777 attributes, this can be a risk and this permissions can be abused by compromised plugins.

To tighten up your folder, use SSH and locate your /httpdocs folder:

# find . -type d -exec chmod 755 {} \;
# find . -type f -exec chmod 644 {} \;
# chmod 750 ../httpdocs

At the same time, you might want to execute maldet to ensure there is no malware present:

# maldet -a ../httpdocs

Always ensure you are using the latest revision of WordPress. This is the single most important rule for ensuring maximum security of your WordPress site.