Skip to main content

Misc Issue

Low Ram

Enable 2GB swap , if you see the services are being killed

fallocate -l 2G /swapfile
dd if=/dev/zero of=/swapfile bs=1M count=2048
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

Also make the number of child workes 2x the amout of RAM in www-data pool of php-fpm .

Home Path

To set home for user - inside public_html create .bash_profile inside the file put the home path as

echo "export HOME='/srv/www/my.writetextfast.com/home/'" >> ~/home/bash_profile

Cleanup

Find largest file -

find -type f -exec du -Sh {} + | sort -rh | head -n 5

Cleanup snaps folder

snap list --all | while read snapname ver rev trk pub notes; do if [[ $notes = *disabled* ]]; then snap remove "$snapname" --revision="$rev"; fi; done

Resize allocated disk

tune2fs -m1 /dev/sda

Clear comments

// Delete comments
wp comment delete $(wp comment list --status=spam --format=ids) --force

// Delete Pending
wp comment delete $(wp comment list --status=hold --format=ids) --force

No log but critial

Create a debug backtrace in mu-plugins , this will dump all messages -

add_filter(
'wp_php_error_message',
function( $message, $error ) {
        debug_print_backtrace();
        return $message;
},
10,
2
);