changing the Apache DocumentRoot path to new add additional hardisk
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would safe me the hassle and just mount the new partition at the old DocumentRoot /var/www/html afte copying the files over to it. Then restart apache.
Device Boot Start End Blocks Id System
/dev/sda1 * 2 501 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 502 61440 62401536 8e Linux LVM
Partition 2 does not end on cylinder boundary.
mount UUID=af3558aa-6786-43fa-b026-2c42df622795 /var/www/html
Just have in mind that all the files that are under /var/www/html are masked by the new mount and can't be accesed until the new mount is umounted again.
Yes. Read up on the mount command. And maybe filestructure or filesystem under linux in generell.
The mount command takes two arguments. One is the device in your case given with the UUID and the path inside the filesystem where the new device should be accessible at. Just do a df -h before the mount and after the mount and you will see the difference.
You sure could use the new path for the docroot. There are just many ways to do things.
My guess is that the path your using as the new DocumenRoot isn't there yet. Did you create it?
Please give the output of
Code:
ls -lh /media/af3558aa-6786-43fa-b026-2c42df622795
Just another thing to remark is that after everything works you should enter the /media/af3558aa-6786-43fa-b026-2c42df622795/ mount into your /etc/fstab file
Hm, tough one. So the directory exists but apache is still complaining. Last shot of me would be a typo.
Okay lets try this. Change the DocumentRoot back to its original value (/var/www/http it was?), restart apache. This is too make sure that we have a generel sane configuration.
After that make extra to get path right. cd into the /media/uuid/http directory and use the command pwd to print the working directory. Copy that and paste it into the apache configuration as the value for DocumentRoot.
Or maybe you can mount the new disk under a simpler directory. Something like /media/new_disk. This way you can nearly rule out typos.
Okay some explanation for names a disk partition can be addressed through.
You can use the name of the partition like it is under /dev. In your case this should be /dev/sdb1 if I read your fdisk -l output correct. (Using dev names may lead to errors cause the bios might rearrange the order harddrives are named during reboots).
Or can use the uuid of the partition. Use the blkid tool to get it. Or use tune2fs -l /dev/devicename
Or one can use a label when creating the filesystem.
Now to mount (You did have a look at man mount, didn't you )
mount needs a device and a path. The opposite command is umount and it only needs one of the options you used when mounting a device. So you could unmount the drive either by specifying the path where its mounted or use the device name. For ease use
Code:
umount /dev/sdb1
After unmounting the drive you can mount it like this
Code:
mount /dev/sdb1 /media/new_disk
and the new disk will be available under /media/new_disk/. AS long as the directory exists.
HOw to get rid of the /media/uuid thing should be some options for udev. But I'm not sure about it. Did the disk got automounted after adding the new disk through VM?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.