Author Topic: Change Domain Home Dir  (Read 2598 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Change Domain Home Dir
« on: February 03, 2022, 11:09:48 AM »

Is there any way to change the Home dir of a Domain (Addon Domain)

Actually it is /home/USER/DOMAIN

but as it is impossible using the filesystemlock to work for this directory (it only works for public_html and everything in there) i wanna move my addon domain to /home/USER/public_html/DOMAIN

Any way to do this?

thanks

Offline
***
Re: Change Domain Home Dir
« Reply #1 on: February 03, 2022, 06:53:01 PM »
Let me reply to your question by first saying that it's not a good idea to put an addon domain inside public_html. Here's why:
Let's say that you have domainONE.com created with the account. CWP forces* it into public_html folder. Now, you create an addon domain domainTWO.com and you choose it to be inside public_html, meaning public_html/domainTWO.com
Now, we already have a problem.

If someone accesses www.domainONE.com, it will work fine.
but if someone does www.domainONE.com/domainTWO.com, it will show the addon domain within domainONE. Also explained here:
https://forum.centos-webpanel.com/index.php?topic=11600.msg39622#msg39622
This is where CWP's design logic is flawed.

- The first flaw is that CWP forces the use of public_html for the main domain.
- The second flaw is that CWP allows you to put an addon domain inside public_html.
Mentioned here: https://forum.centos-webpanel.com/index.php?topic=7189.msg39661#msg39661
- The third flaw is that CWP devs have said on a thread to create a new user account for each new domain as "this is how it should be done". This is a very flawed logic for me, as I for example have 18 domains that all rewrite/redirect to the main domain. Why should I create 19 different accounts....


So, my suggestion is to accept CWP's logic and just go with it.

- Let the main domain be in /home/user/public_html, and all other addon domains be in /home/user/addonDomain.com

As for your problem with how the filesystemlock works, I did not notice it before. You are correct sir, it seems like this is a fifth design flaw.

Quote
File System Lock will lock all files and folders from any changes, this will also block all uploads, file modifications and even backup restore. This will secure your website almost 100%, and it's very useful if you are the only one who modifies website. If you need to modify your website or upload new files then you need to temporary unlock your files.

According to this, in my understanding and hopefully how it should be interpreted, the entire /home/user should be locked, or just at least all domain folders, including addon domains.

*You can change it by adding a custom vhost template for that domain, AFTER creating the account, but you will have a lot of issues because a lot of modules relies on the main domain existing in public_html
« Last Edit: February 03, 2022, 06:59:36 PM by iraqiboy90 »

Offline
***
Re: Change Domain Home Dir
« Reply #2 on: February 03, 2022, 07:09:06 PM »
You can, if you have access to ssh, to lock the entire folder with
Code: [Select]
chattr +i folder
but this defeats the purpose of the button in the UserCP if the user does not have access to ssh.

Offline
*
Re: Change Domain Home Dir
« Reply #3 on: February 09, 2022, 01:19:17 PM »
You can, if you have access to f95zone ssh, to lock the entire folder with
Code: [Select]
chattr +i folderbut this defeats the purpose of the button  in the UserCP uwatchfree if the user does not have access to ssh.

I'll try this out and let you know!