Control Web Panel

WebPanel => Installation => Topic started by: pixelpadre on February 12, 2020, 10:23:12 PM

Title: The big Question
Post by: pixelpadre on February 12, 2020, 10:23:12 PM
So since day #1, I have wondered why we have to have a domain associated with a user.  The requirement to have a domain means that one of my domains will be in /public_html and not /public_html/myuserdomain.com

This is a MAJOR pain in my arse.  It means all of my files and folders will be scattered about with all of my other domain folders.  From a housekeeping perspective, it looks like a total cluster F.
Title: Re: The big Question
Post by: rcschaff on February 12, 2020, 10:42:07 PM
Every hosting panel does the same thing.  Setup add-on domains of you want them all under one account.
Title: Re: The big Question
Post by: ejsolutions on February 12, 2020, 11:59:26 PM
I've always favoured the /home/username/public_html approach.
From a security perspective, I've never advocated the use of add-on domains. Hack one account and there's potential to hack them all, within the same account. Need multiple websites/domains, then be a "Reseller". Period.
Title: Re: The big Question
Post by: pixelpadre on February 13, 2020, 12:30:10 AM
Every hosting panel does the same thing.  Setup add-on domains of you want them all under one account.

You guys are not understanding.  When I create an account for a user, the users domain is /public_html.  Now lets say the same user wants to add 10 domains. The public_html folder will have all of the files for the main website.  But it will also have domain1-10 directories.  What I want to know is why the main domain cant be /public_html/maindomain.com .  this way the public_html directory will only have 11 directories and no files.  Nice and clean.
Title: Re: The big Question
Post by: pixelpadre on February 13, 2020, 12:56:13 AM
I have actually used a domain that I dont own just to fulfill the cpanel requirements.  Then there will never be any files in the public_html directory...only web directories.
Title: Re: The big Question
Post by: rcschaff on February 13, 2020, 01:26:54 AM
Simple workaround.  Create an account with the domain localhost.localdomain.  << DOesn't server anything.  Addon domains now got to /public_html/mydomainname.com

Now public_html doesn't have to server any website.

Of course you could always create your own template for apache/nginx
Location of the files: /usr/local/cwpsrv/htdocs/resources/conf/web_servers/ | http templates = .tpl | https templates = .stpl |

Create a new template that points your main domain to public_html/(domian), and use that template for your website.   Custom templates will not get overwritten.
Title: Re: The big Question
Post by: ejsolutions on February 13, 2020, 01:38:21 AM
Now lets say the same user wants to add 10 domains.
Actually, I do know what you are saying and have come across quite a few clients that have used add-on domains, to host multiple customers/websites under their own account. Bad idea. I've seen this in both cPanel and Plesk and I strongly discourage its' use, regardless of the directory structure used. Any clearer?
As said, a Reseller type of control panel account is a much better prospect - in fact, that's how I started in value-add hosting.
However, if you're not interested in a (more) secure environment, don't let me dissuade you.  :-X

Parked domains are, of course, something different.
Title: Re: The big Question
Post by: pixelpadre on February 13, 2020, 10:55:40 AM
Now lets say the same user wants to add 10 domains.
Actually, I do know what you are saying and have come across quite a few clients that have used add-on domains, to host multiple customers/websites under their own account. Bad idea. I've seen this in both cPanel and Plesk and I strongly discourage its' use, regardless of the directory structure used. Any clearer?
As said, a Reseller type of control panel account is a much better prospect - in fact, that's how I started in value-add hosting.
However, if you're not interested in a (more) secure environment, don't let me dissuade you.  :-X

Parked domains are, of course, something different.

No you still dont get it.

My users have a user account and they can add 10 of their own domains for personal use.  But their primary domain associated with their account does not have its own folder like all of their other personal domains.
Title: Re: The big Question
Post by: adamjedgar on February 13, 2020, 11:31:45 AM
Other control panels i use have the following structure

Home/User/
         Domains/subdomain1/public html/website files
                          /subdomain2/public html/website files

         Public html/primary website files

Much better way than how i recall this panel does it.

So a users p arent domain is separate from addon domains
Title: Re: The big Question
Post by: pixelpadre on February 14, 2020, 12:45:43 AM
I havent had cpanel in many years, and they had the same lame structure as CWP.  I guess what I am really asking is "why is the primary domain treated differently than all of the add on domains for any given user."
Title: Re: The big Question
Post by: rcschaff on February 14, 2020, 12:59:13 AM
I don't know what to tell you.  public_html has been around for decades. If you don't like it, your more than welcome to amend  apache/nginx to meet your needs.   Nobody's twisting your arm to use this software.  You could install a simple lamp stack and manage it yourself.  Your using a package software for the ease of configuring your server. Deal with it, stop complaining, or change to a software that suits what you want to happen.
Title: Re: The big Question
Post by: ejsolutions on February 14, 2020, 01:01:01 AM
+1  8)
Title: Re: The big Question
Post by: pixelpadre on February 14, 2020, 01:07:58 PM
I don't know what to tell you.  public_html has been around for decades. If you don't like it, your more than welcome to amend  apache/nginx to meet your needs.   Nobody's twisting your arm to use this software.  You could install a simple lamp stack and manage it yourself.  Your using a package software for the ease of configuring your server. Deal with it, stop complaining, or change to a software that suits what you want to happen.

Why cant anyone understand what I am saying. 

I dont have a problem with public_html.  the problem is the default domain goes there instead of public_html/defaultdomain.com/index.html

I dont want any files in /public_html/ I want only other directories in /public_html/
Title: Re: The big Question
Post by: ejsolutions on February 14, 2020, 01:46:15 PM
So create a directory and do a redirect - it's what I normally do and is standard fare for many packages.
 :-X :-X
Title: Re: The big Question
Post by: rcschaff on February 14, 2020, 02:09:18 PM
I have told you.  Configure your server the way you want to then.  Your not stating that you want help, you're stating that you want CWP to change the software to suite your needs.

So here, I'm going to help you out:
The Template files cwp uses to build the configs are stored in:
/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts
httpd = apache w/o php-fpm
httpd/php-fpm = apache w/ php-fpm
httpd/proxy = apache acts as a proxy
nginx = proxy
nginx/php-fpm = nginx standalone

I should note.  If you set it as the standard config, path for subdomains/addon domains will be ignored.

Catching a theme here yet?  NOW.  .tpl files are for port 80.  .stpl files are for  443 ssl.

Now let's put it all together.  let's say we are working with nginx standalone.
We copy nginx/php-fpm/default.stpl to nginx/php-fpm/mydomain.stpl
now we edit the line:  root %docroot%;   and change it to  root /home/%user%/public_html/%domain%;
save the template.
Now log into CWP.  Goto Webserver Settings -> WebServers Main Config
Change the default to your new config you created.
Alternatively, you can use your template on a specific domain only by WebServerDomainConf


I should note.  Setting as the Main Config will ignore the path settings for addon/subdomains.  So when setting path for subdomains, make sure you set them public_html/sub.domain.com
Title: Re: The big Question
Post by: pixelpadre on February 15, 2020, 12:28:28 AM
I am not asking anyone to change suit my needs.  I overcame the problem by simply using a fake domain (stupidfakedomain.com) that I do not own for the default user domain.  Then the public_html will never have any files.

There is no logical reason why creating an addon domain also creates an addon directory, but default domain does not get its own directory under the public_html directory.  Like you said, they all do it.  Its not a big problem, but its just chaotic when i explore my main domain and see all these other addon folders sorted alphabetically amongst my default domain files and folders.



Title: Re: The big Question
Post by: rcschaff on February 15, 2020, 01:14:07 AM
Just out of curiosity, did you try creating add-on domains ../addondomain .   I don't use add-ons, so don't test it.
Title: Re: The big Question
Post by: pixelpadre on February 15, 2020, 12:13:42 PM
Just out of curiosity, hows come you have a photo and I dont.
Title: Re: The big Question
Post by: rcschaff on February 15, 2020, 01:40:55 PM
Cause I've got mad skills ;)
Title: Re: The big Question
Post by: pixelpadre on February 15, 2020, 07:30:27 PM
Cause I've got mad skills ;)

You mean this?   http://www.madlibs.com/
Title: Re: The big Question
Post by: rcschaff on February 15, 2020, 11:36:02 PM
Nope, Mad skills.  Cause my pictures my own, not a celeb.
Title: Re: The big Question
Post by: pixelpadre on February 17, 2020, 01:18:36 PM
Thats a big assumption :P
Title: Re: The big Question
Post by: ~Q~ on March 11, 2020, 12:54:24 AM
Good to know. Thank you.

Simple workaround.  Create an account with the domain localhost.localdomain.  << DOesn't server anything.  Addon domains now got to /public_html/mydomainname.com

Now public_html doesn't have to server any website.

Of course you could always create your own template for apache/nginx
Location of the files: /usr/local/cwpsrv/htdocs/resources/conf/web_servers/ | http templates = .tpl | https templates = .stpl |

Create a new template that points your main domain to public_html/(domian), and use that template for your website.   Custom templates will not get overwritten.