Create a shared or virtual folder in linux

Not sure if its called shared or virtual folder here is what i have

I have a folder which stores thousands of images on domain1  
to simplify updates i want to create a "Shared Folder" in domain2 ,domain3 etc...





/var/www/vhosts/domain1.com/httpdocs/images <- real folder
/var/www/vhosts/domain2.com/httpdocs/images <- is actually ../domain1.com/httpdocs/images
/var/www/vhosts/domain3.com/httpdocs/images <- is actually ../domain1.com/httpdocs/images
/var/www/vhosts/domain4.com/httpdocs/images <- is actually ../domain1.com/httpdocs/images

PS.Domain 2,3 & 4 only need readonly access so it doesn't matter if writing isn't allowed

how can i do this in if i only have ssh connection,
my linux skills are not very good ;)
LVL 1
CMDAIAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cjl7freelance for hireCommented:
Hi,
Here is a step-by-step howto on SSH-FS (filesystem over ssh)

http://www.cyberciti.biz/tips/rhel-centos-mounting-remote-filesystem-using-sshfs.html

//j
CMDAIAuthor Commented:
thanks for you reply,
that would be mounting in  a way of mounting a simpler interference for me to use,
i can try it that way but the document seems to out of date case it give me error 404 Not Found
"http://superb-west.dl.sourceforge.net/sourceforge/fuse/fuse-2.6.5.tar.gz""

cjl7freelance for hireCommented:
Either you build them from source or try this page: http://packages.sw.be/fuse-sshfs/


Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

CMDAIAuthor Commented:
could i do this without addins? cas i really make amendments to the server no more the once or twice a year.
cjl7freelance for hireCommented:
Nope.

The only other way is to mount it with an existing network filesystem and that leaves you with NFS.

It would do the job, but you stated that only ssh access is possible.

CMDAIAuthor Commented:
sorry one more question i have samba installed can use it instead?
CMDAIAuthor Commented:
anyway i installed it trying to configure now
CMDAIAuthor Commented:
i think i got everything installed now trying to mount but with no success, are my commands wrong?

sshfs /var/www/vhosts/domain1.com/httpdocs/images: /var/www/vhosts/domain2.com/httpdocs/imagesvirtual

reply is:
read: Connection reset by peer

Open in new window

cjl7freelance for hireCommented:
Yes, but samba isn't ssh...

If you consider using samba I suggest NFS instead. It's more "linux-native" and is already installed on your boxes...

//jonas
CMDAIAuthor Commented:
Connection reset by peer <- no idea what this means
CMDAIAuthor Commented:
To test i tried to unmount it sais that directory is not mounted
svsCommented:
"mount --bind" is much more suited for this task than sshfs, nfs or samba.

Or, you could simply configure aliases in web server.
CMDAIAuthor Commented:
"mount --bind" is much more suited for this task than sshfs, nfs or samba.
Thanks alot work great,
how to unmount?
cjl7freelance for hireCommented:
Stupid me, I didn't read the post good enough!

You can just do a link

ln -s /var/www/vhosts/domain1.com/httpdocs/images /var/www/vhosts/domain2.com/httpdocs/images

assuming that the permissions are OK.

Sorry for the bad advice earlier...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CMDAIAuthor Commented:
so whats the difference between `mount` and `in` ?
cjl7freelance for hireCommented:
ln will do exactly what you want, mount --bind will be a bit trickier to handle and is not needed in this case (IMO).
CMDAIAuthor Commented:
Thank you got it working
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.