Reputation: 3338
On my previous question
Saving changes to an EC2 instance without having to register an AMI each time?
I asked how was posible for me to save files to my spot instance without having to register a new AMI
each time. I researched and it looks like attaching an EBS
volume is a way of saving data persistently without having to register an AMI
each time I make changes.
The new issue I have is that I need to "call" files in the EBS
volume via cron and treat them as webpages. They are mostly PHP
files.
I tried setting up my EBS
under /var/www/html
but AWS prevents me to do that suggesting me to use /dev/sdf
instead
Is there anyway I can set my EBS
volume under my webserver so I can call my files on the EBS
using the cron and interpret them as valid PHP
files?
Any tip in the right direction will be much appreciated.
Thanks
Upvotes: 1
Views: 606
Reputation: 10033
/dev/sdf
is a block device and /var/www/html
is a mount point. They're completely different things; analogous to a physical book and a bookmark.
You first have to attach your EBS volume to your instance. It will show up as /dev/sdf
(or whatever device name you've specified). You then have to create a file system on it using mkfs.ext4 /dev/sdf
. You then mount the newly created volume using mount /dev/sdf /var/www/html
. To have it automatically mount at boot, edit /etc/fstab
and append the following to the file:
/dev/sdf /var/www/html ext4 defaults,noatime 0 0
Upvotes: 2