Ram Disks
This revision is from 2024/06/15 23:18. You can Restore it.
##!/bin/bash # Set variablesRAMDISK_SIZE="1G"
MOUNT_POINT="/mnt/ramdisk"
WEB_SOURCE="/var/www/html"
WEB_DEST="$MOUNT_POINT/html"
# Create the mount point if it doesn't existmkdir -p $MOUNT_POINT
# Mount the RAM diskmount -t tmpfs -o size=$RAMDISK_SIZE tmpfs $MOUNT_POINT
# Copy the website filescp -r $WEB_SOURCE $WEB_DEST
# Start the web server (e.g., Apache or Nginx) # systemctl restart apache2 # or `systemctl restart nginx` for Nginx