Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to improve the performance of a web application running on Apache, so I created a Raid Array on /dev/md0.

Now I need to figure out how to move the application to the array and make sure that Apache will still serve it when someone accesses my domain.

Web application is in the directory: /var/www/html - Raid Array device is: /dev/md0

How do I make the application run on the array?

Cross Posted at: http://unix.stackexchange.com/questions/21713/move-web-directory-to-raid-array

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Copy all of your files to the new device, stop apache, then mount the new device on top of your existing /var/www/html and restart apache.

mount /dev/md0 /mnt
cp -r /var/www/html/* /mnt 
umount /mnt
service httpd stop
mount /dev/md0 /var/www/html
service httpd start

You would then need to ensure it's mounted at boot by editing the /etc/fstab

/dev/md0    /var/www/html ....
share|improve this answer
1  
Also, make a filesystem on md0 if there isn't already. –  Shane Madden Sep 29 '11 at 16:31

You can copy the contents of /var/www/html (or /var/www or all of /var if you want) to /dev/md0 and just mount /dev/md0 as /var/www/html (or whatever). Shouldn't be too complicated.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.