Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
vms:webdev:apache [2015/08/07 17:13] admin [Create the Shared www Folders] |
vms:webdev:apache [2015/09/06 02:54] admin [Pages Caching] |
||
---|---|---|---|
Line 242: | Line 242: | ||
</code> | </code> | ||
- | You need to install the VirtualBox Guest Additions: | + | You need to install the VirtualBox Guest Additions, see the [[vms:django#install_virtualbox_guest_additions| Install VirtualBox Guest Additions]] section on this wiki. |
- | **LINK NEEDED** | + | |
</WRAP> | </WRAP> | ||
Line 553: | Line 552: | ||
</code> | </code> | ||
- | We could also have a cron script running all the time, avoiding the need of the manual launch of the //watch// command. | + | We could also have a bash script running an endless loop every second, avoiding the need of the manual launch of the //watch// command. To this purpose, we'll create a shell //**drop_caches.sh**// script file and put in an //**@reboot cron task**// (following commands assumed as root): |
- | <code> | + | <code> |
+ | > nano /etc/init.d/drop_caches.sh | ||
+ | PASTE: | ||
+ | #!/bin/bash | ||
+ | sync; echo 3 > /proc/sys/vm/drop_caches | ||
+ | |||
+ | > chmod +x ~/scripts/drop_caches.sh | ||
+ | > crontab -e | ||
+ | |||
+ | PASTE: | ||
+ | @reboot /root/scripts/drop_caches.sh | ||
+ | |||
+ | > reboot | ||
+ | </code> | ||
+ | |||
+ | To make sure that your the script is well running after reboot: | ||
+ | <code> | ||
+ | > ps aux | grep [c]aches | ||
+ | root 2260 0.0 0.0 4184 576 ? Ss 02:50 0:00 /bin/sh -c /root/scripts/drop_caches.sh | ||
+ | root 2266 0.3 0.1 10768 1412 ? S 02:50 0:00 /bin/bash /root/scripts/drop_caches.sh | ||
</code> | </code> |