Force Umount if Busy

If device is busy and you can’t umount it, try it with -l option (lazy unmount). Or you can force it.

# standard
umount /mnt/data
# lazy umount
umount -l /mnt/data
# force
umount -f /mnt/data

Lazy unmount is safer since it will detach immediately and clean up all references to the file system. Force is a bit more drastic.

Run Shell Script From Your Website

Here’s how to run a shell script from your website. You’ll need 2 files.

Here’s the contents of foo.php. Wrap your output with ‘pre’ for better formatting.

$output = shell_exec('/var/www/html/ 2>&1');
echo "$output";

Here’s the content of Output will be displayed on web page.

now="$(date +'%y%m%d')"
echo $now
aws s3 ls

Phpinfo Blank Page

Here’s how to fix when phpinfo is displaying a blank page. The install is missing this php module.

apt install php libapache2-mod-php

Restart after install.

service apache2 restart