Installation-ramdisk

Source 1

sudo vim /etc/fstab

rule

tmpfs           /tmp              tmpfs   defaults,noatime,mode=1777 0       0
tmpfs           /var/log          tmpfs   defaults,noatime,mode=0755 0       0

create

sudo vim /etc/init.d/prepare-dirs

and add

#!/bin/bash
#
### BEGIN INIT INFO
# Provides:          prepare-dirs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Required-Start:  
# Required-Stop:  
# Short-Description: Create /var/log/apache2 directory on tmpfs at startup
# Description:       Create /var/log/apache2 directory on tmpfs at startup
### END INIT INFO
 
DIR=/var/log/apache2
 
#
# main()
#
case "${1:-''}" in
  start)
    # create the /var/log/apache2 needed by webserver
    if [ ! -d ${DIR} ]; then
      mkdir ${DIR}
      chmod 755 ${DIR}
    fi
    ;;
  stop)
    ;;
  restart)
   ;;
  reload|force-reload)
   ;;
  status)
   ;;
  *)
   echo "Usage: $SELF start"
   exit 1
   ;;
esac

enable

sudo chmod 744 /etc/init.d/prepare-dirs
sudo update-rc.d prepare-dirs defaults 01 99