Current time: 12-23-2024, 11:52 PM Hello There, Guest! (LoginRegister)


Post Reply 
Suggestion to have multiple sites share a common shared directory
Author Message
gilbert Offline
Junior Member
*

Posts: 45
Joined: May 2007
Reputation: 0
Post: #1
Suggestion to have multiple sites share a common shared directory
Hi,

I have a client that would like to have several sites share a common set of files such as images.

What permissions would you recommend I use to set a directory to have so it could be accessible by multiple ispcp users.

Also would you suggest we use a link or do we need to copy the files to each of the sites directory structure?

Please suggest pros and cons of using links versus copying files.
Obviously copying would duplicate files and waste storage.

If I created a folder such as /var/www/virtual/site1.com/htdoc/sharedfolder.
Where would we actually put the sharefolder.
I assume that the group would be www-data
who would be the owner
I guess if the permissions were rw-rw-r-- it would be ok?

Thanks,

Gilbert.
05-07-2009 12:21 PM
Find all posts by this user Quote this message in a reply
gilbert Offline
Junior Member
*

Posts: 45
Joined: May 2007
Reputation: 0
Post: #2
RE: Suggestion to have multiple sites share a common shared directory
Hi again,

Does anyone have any suggestions for this?

(05-07-2009 12:21 PM)gilbert Wrote:  Hi,

I have a client that would like to have several sites share a common set of files such as images.

What permissions would you recommend I use to set a directory to have so it could be accessible by multiple ispcp users.

Also would you suggest we use a link or do we need to copy the files to each of the sites directory structure?

Please suggest pros and cons of using links versus copying files.
Obviously copying would duplicate files and waste storage.

If I created a folder such as /var/www/virtual/site1.com/htdoc/sharedfolder.
Where would we actually put the sharefolder.
I assume that the group would be www-data
who would be the owner
I guess if the permissions were rw-rw-r-- it would be ok?

Thanks,

Gilbert.
09-02-2009 11:05 AM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #3
RE: Suggestion to have multiple sites share a common shared directory
Hi

Your client can not create a subdomain through the panel and put all the files (not executable) in the DocumentRoot? I do not understand the nature of your problem.
09-02-2009 11:40 AM
Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #4
RE: Suggestion to have multiple sites share a common shared directory
Yeah, it seems totally unnecessary that all files are accessible by different virtual hosts. As nuxwin said, just create a subdomain, put all the files there, and then link to the resources using a full url like http://static.domain.tld/image.jpg
09-02-2009 03:40 PM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #5
RE: Suggestion to have multiple sites share a common shared directory
Maybe there are reasons for the multiple domains... ok, lets try...

with php files there will be a permission problem when symlinking - so php files must be copied and the owner adopted to the domain.

But with html, images etc symlinks should do the job. Owner: original domain, Group: www-data (rw-r-----) - or if you upload with ftp: group original domain, but make the folder and files world readable (minimum rw-r--r--)...

That's my opinion...

/Joximu
09-02-2009 04:55 PM
Visit this user's website Find all posts by this user Quote this message in a reply
gilbert Offline
Junior Member
*

Posts: 45
Joined: May 2007
Reputation: 0
Post: #6
RE: Suggestion to have multiple sites share a common shared directory
Hi,

The client has a dedicated server so security is not an issue of access between the sites is not an issue and or all sites on the server.

user for site that initiates the copy is vu2001
when I su vu2001
issue
cp /var/www/virtual/site1.com/htdocs/copyTest/pumadisc.jpg /var/www/virtual/site2.com/htdocs/copyTest/

I get
cp: accessing `/var/www/virtual/site2.com/htdocs/copyTest/': Permission denied

ls -l /var/www/virtual/
drwxrwx--- 8 vu2010 www-data 4096 2009-09-02 00:26 site2.com
ls -l /var/www/virtual/site2.com/
drwxrwxr-x 5 vu2010 www-data 4096 2009-08-31 15:12 htdocs
ls -l /var/www/virtual/site2.com/htdocs
drwxrwxr-x 2 vu2010 www-data 4096 2009-08-31 15:12 copyTest


Would I have to add vu2001 to www-data group is that a good solution?

Thanks,
Gilbert.
(This post was last modified: 09-03-2009 09:51 AM by gilbert.)
09-03-2009 09:50 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #7
RE: Suggestion to have multiple sites share a common shared directory
adding the vu-User to the group www-data would maybe also be a solution.

Adding an x-Flag on the (home)folder site2.com (so we have perms 771) and of course allowing vu2001 to write in the destination folder (either change the group to vu2001 or add write permissions on the "copyTest" destination folder.

/J
09-03-2009 04:29 PM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #8
RE: Suggestion to have multiple sites share a common shared directory
Quote:The client has a dedicated server so security is not an issue of access between the sites is not an issue and or all sites on the server.

Why don't you copy as root then? It will be much easier overall, just make sure to change file ownerships afterwards and done Smile
09-03-2009 05:11 PM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #9
RE: Suggestion to have multiple sites share a common shared directory
...maybe the customer uploads some new files and then they have to be spread over the other domains... - a bash script would do the job (with rsync or "cp -u" ...) and permission settings...

/J
09-03-2009 05:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)