Apache2.4 question

Hi, I would like to know if this is possible.

Let's say you have 2 hard drives on one server.
on drive 1 you have dir 1
on drive 2 you have dir 2

then there's a third drive that's hosted on another server in another location.
we will call this nas drive 1 but dir 3.

Let's say my website I want to put folder mydomain.com as a folder.
Let's say I store this on dir 1 on drive 1. do on drive 1 dir1 it would be like drive1:/websites/mydomain

let's say on drive 2 I have the same thing drive2:/websites/mydomain

then on nas drive 1 we have https:/some_ip_address:400/websites/mydomain
it uses the internet to connect to a nas drive I gave random port number.

My point on my website how can I tie them into one?

I want it to be like mydomain.com/ to be tied to all 3.

for instance :

lets say I stored :
template.txt
folder db, mail, userconfig, userpanel.

on hard drive 1.
content_login.txt
folder db, mail, userconfig, userpanel.

on drive 2.

then :
main.html
folder db, mail, userconfig, userpanel.

on nas drive 1 dir 3.

if you look each one has different files.
I want to be able to do this:

mydomain.com/main.html

mydomain.com/content_login.txt

mydomain.com/main.html/template.txt

So, I want to combine all 3 drives to be as one.


so folders db, mail, userconfig, userpanel should be combined with all 3 locations.

That way when I do https://mydomain.com/db

https://mydomain.com/userconfig
https://mydomain.com/userpanel

they should show all files from all 3 locations.
I want to be able to do this on the fly. So, If I need more storage
I can buy some and create these folders and the website should automatically
or I can easily just add in the new location of a 4th drive and continue it.

How would one do this? I know in apache2.4 there's alias locations.
I know about hard links and raids.

How could you combine all 3 locations and folders to act as if it's one folder?

that way if I do https://mydomain.com/db/../ this would reference all folders with db on all drives.

Thank You for your time.
 
Let's say you have 2 hard drives on one server.
on drive 1 you have dir 1
on drive 2 you have dir 2
The drives are irrelevant. All (mounted) filesystems are linked in the same file tree.

Let's say I store this on dir 1 on drive 1. do on drive 1 dir1 it would be like drive1:/websites/mydomain
This isn't MS-DOS or Windows, so why the "drive" letters? <name>:/<filesystem> is an NFS share, i.e. network filesystem. Local drives (better: filesystems) are all mounted in the same file tree. NFS shares are too. They are mounted in the local file tree.

then on nas drive 1 we have
On the NAS you should create an NFS share, which you then mount in the same file tree.

Code:
/data/
/data/filesystem_of_disk1/
/data/filesystem_of_disk2/
/data/some_nfs_share/

My point on my website how can I tie them into one?
As they're just directories in the file tree you can simply refer to them, with Apache you could use Alias /site1 /data/filesystem_of_disk1/site1. Or you could create a virtual host for each site separately. Whatever you want.

I know about hard links and raids.
Hard links cannot cross filesystem boundaries. And RAID has to do with disk management, it has nothing to do with filesystems.
 
The drives are irrelevant. All (mounted) filesystems are linked in the same file tree.


This isn't MS-DOS or Windows, so why the "drive" letters? <name>:/<filesystem> is an NFS share, i.e. network filesystem. Local drives (better: filesystems) are all mounted in the same file tree. NFS shares are too. They are mounted in the local file tree.


On the NAS you should create an NFS share, which you then mount in the same file tree.

Code:
/data/
/data/filesystem_of_disk1/
/data/filesystem_of_disk2/
/data/some_nfs_share/


As they're just directories in the file tree you can simply refer to them, with Apache you could use Alias /site1 /data/filesystem_of_disk1/site1. Or you could create a virtual host for each site separately. Whatever you want.


Hard links cannot cross filesystem boundaries. And RAID has to do with disk management, it has nothing to do with filesystems.
the drive is just as an example it's not using windows.

You posted this:
Code:
/data/
/data/filesystem_of_disk1/
/data/filesystem_of_disk2/
/data/some_nfs_share/

what I want to do is take your example above.

what I want is to combine all of them. I don't want it separate like that.
I can mount it separate. I just want to on my website be able to reference them as one.
I gave example of 2 hard drives and 1 nas drive just as an example that there's 3 seperate
directory and file locations. I want to make it look combined into one folder.

I want it so that when I do an
Code:
 ls-l /data/
it would list filesystem_of_disk1, filesystem_of_disk2,some_ntfs_share all
in
Code:
  /dad/all_three_located_here
as if it's alll combined under the data folder.

I don't want the 3 locations to be referenced as 3 different locations.

For example for disk 1 let's say under data there's a folder called user_images. This folder would be filled with user images. over time this hard drive gets filled.
I will then create the same folder on hard drive 2 to extend it. and then on with nas drive. so 3 locations would have the same folder name.
That way if I look in
Code:
 /var/user_images/
inside that folder it will list files in all three locations. Would this be possible without error?
if you have the same name of a folder and you try and move it onto the same locations as another folder with the same name it would ask if you want t overwrite the folder.
or it will give an error that you cannot move the file into this folder because another folder exists with the same name.

What I am saying is that I want folder user_images to reference the user_images folder stored in all 3 locations to be reference in this folder as if it was merged as to one folder.
so the root of user_images of all 3 locations should be listed under this user_images folder.
 
The drives are irrelevant. All (mounted) filesystems are linked in the same file tree.


This isn't MS-DOS or Windows, so why the "drive" letters? <name>:/<filesystem> is an NFS share, i.e. network filesystem. Local drives (better: filesystems) are all mounted in the same file tree. NFS shares are too. They are mounted in the local file tree.


On the NAS you should create an NFS share, which you then mount in the same file tree.

Code:
/data/
/data/filesystem_of_disk1/
/data/filesystem_of_disk2/
/data/some_nfs_share/


As they're just directories in the file tree you can simply refer to them, with Apache you could use Alias /site1 /data/filesystem_of_disk1/site1. Or you could create a virtual host for each site separately. Whatever you want.


Hard links cannot cross filesystem boundaries. And RAID has to do with disk management, it has nothing to do with filesystems.
So, are you saying I can mount let's say I made a folder on each of the 3 location called data.
I can mount that data as one folder combining all 3 into one?

like hard drive 1 has /data/filesystem of disk one
hard drive 2 has /data /filesystem of disk two
nas drive 3 has /data/nas filesystem disk 3

if I do a ls -l on / will it show /data/ and if I ls -l /data/ will it show everything in folders data stored on filesystem of disk one, /filesystem of disk two,nas filesystem disk 3 ?

So, in my example we make the folder data on all 3 drives and then we make user_images folder inside the data folder on all 3 drives.

so on my website I want to be doing something like mywebsite.com/data/user_images/ this should grab all those folders from each of the 3 drive and display it as if it's one folder.

so /data/user_images needs to point to -> disk1/data/user_images, disk2/data/user_images , nas disk3 /data/user_images

it should list all images stored in those folders in each location as if it's one folder.

so you're saying I can mount 3 of the drives at the same data folder and there wont be no conflict?

What I want is something like this:

disk1/data/user_images/pattyman.jpg,
disk2/data/user_images/rainbowman.jpg ,
nas disk3 /data/user_images/arrowman.jpg

to look like this on my website:
mydomain.com/data/pattyman.jpg,

mydomain.com/data/rainbowman.jpg ,

mydomain.com/data/arrowman.jpg,

that way from my website it will look as one folder combined. Even though this could be coming from 3 different filesystems or 1,000 different filesystems.
 
look at unionfs or if its just for apache you can create dynamic directory indexes which search all locations and present and index with proper urls
or use mod_rewrite with a rewrite program and return the proper content
the program is fed the filename and returns dir/filename
 
Back
Top