So My server is CentOS 7 and I have installed:

Apache, MySQL, ProFTPD and Git.

I have my websites in /var/www/, each website has a folder /website1/websitecore which is basically the whole application, controllers, models, templates ect. and in each website folder I have a config, assets and index /website1/config.php, /website1/index.php, /website1/assets/.

So when I create a new website I am creating a new ProFTPD user and then uploading the code, drwxr-xr-x 4 5500 5500 4096 Nov 17 09:40 website1

The question is how can I prevent uploading /websitecore folder for each website, but share it for all of them?

What I have tried is so far is to: Move the /websitecore to /usr/share/php/websitecore and then I have tried to do ln -s, the folder appear in my ftp client, but I can't see any files there.

Then I've tried to mount which worked, I can see the folder and the files in it, but when when I try to access some pages, I get an server error:


You don't have permission to access /websitecore/application/category/`

So I was thinking, if there is a better way of doing this, not messing up with user permissions and groups.

Thank you in advance for any help!

  • You said you symlinked the folder, what are you mounting with mount? Do folders on different sites have different owners, what is preventing you from just putting the folder in webroot of one site and symlinking it in all other folders? Is that you want it visible to different ProFTPD users or are you using suphp and need every folder owned by different user – rAlen Nov 24 '18 at 11:13
  • Do you really want this dependency for all websites sitting only once on your disk, which is visible for all ftp accounts and can be changed by any of them ? Are you sure every change is right for all websites ? I can’t see a problem with having the dependency multiple times on disk, probably in different versions. Maybe space constraints. If this is just code it could be a dependency using composer or maybe a git subrepo. – panpomaly Nov 24 '18 at 11:32
  • No I don't use suPHP. I have used mount because symlink didn't work. It was creating a link, but my index.php couldn't load from it. I have tried to place the webcore folder in /var/www, /usr/share/php/, did all websites one user:group but this didn't help. I am guessing is because ProFTPD locks users to a specific directory, but not sure if that's the case. I have read somewhere that mount --bind folder would work I it does just that issue with the forbidden and I am not sure if it's a good way of doing it. For example if I have 40/50 websites and have all this mounts. – Alex Nov 24 '18 at 11:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.