Web Hosting Talk







View Full Version : cPanel Zone Templates Question


whservices
04-24-2008, 01:29 PM
So I'm trying to create some custom Zone Templates in WHM. I'm looking for some feedback on what I'm trying to do here, and you can tell me if this is going to work...

Basically, in an effort to make my cpanel servers more PCI Compliant, I have to disable mod_userdir. Doesn't sound that hard does it? Well it is, as customers like to view their site before they change the nameservers. So I was thinking of trying something like Hsphere has, that being a "aliased" subdomain which points to the user's public_html. Then I could disable mod_userdir ... I think that makes sense.

So my question is, what variables can I use in the Zone Templates Editor?

%domain% = domain name
%nameserverentry% = nameserver

What other variables can I use here?

I've already posted this in the cPanel forums, but either no one knows, or they are withholding the information from me :D

I thought I would get some words from the WHT Community. Thanks!

RHS-Chris
04-24-2008, 04:21 PM
What about using the 'alias' option in apache?

Alias /username "/home/username/public_html"

Easiest way would be to use the includes editor for cPanel to add these lines in for each user. Then should then be able to visit the link below, and thier site content should be there:

http://yourip/username

I've not tried this, let me know if it works :)

whservices
04-24-2008, 05:51 PM
Yes that works. Hmm, PCI has an issue with this one as well. It's basically the samething. That's why I'm trying to make it a subdomain. Then it will just register as a DNS issue, which won't be that high of a negative score.

DaveDark
04-25-2008, 06:12 PM
I've included the variables in our DNS zone templates below. However, it appears that you'd be wanting to edit a different zone than is being created for the domain as their zone won't do any good until propagated.

So, ideally, you'd set up something like customer1.jumptomydomain.com and then add a vhost in apache for that subdomain to go to the customer's site and then remove it when the site has propagated?







The following variables are available within DNS zone templates:


%cpversion% -- cPanel Version
%domain% -- Name of the domain being created
%ttl% -- Domain time to live
%nsttl% -- Nameserver time to live
%rpemail% -- Contact Email
%serial% -- Serial

%nameserver% -- hostname of primary nameserver
%nameserver2% -- hostname of secondary nameserver
%nameserver3% -- hostname of third nameserver
%nameserver4% -- hostname of fourth nameserver
%nameservera% -- IP of primary nameserver
%nameservera2% -- IP of secondary nameserver
%nameservera3% -- IP of third nameserver
%nameservera4% -- IP of fourth nameserver

%ip% -- IP of domain
%ftpip% -- IP of FTP server for domain

whservices
04-25-2008, 06:16 PM
Thanks Dave. You understood what I'm saying, and yes you are correct. I would be editting another zone than is being created, so that wouldn't work.

Any chances of something like this being created? I have to say, that's ONE good feature to Hsphere. I still prefer cPanel to anything else though. :-)

DaveDark
04-25-2008, 06:32 PM
Thanks Dave. You understood what I'm saying, and yes you are correct. I would be editting another zone than is being created, so that wouldn't work.

Any chances of something like this being created? I have to say, that's ONE good feature to Hsphere. I still prefer cPanel to anything else though. :-)

It's definitely an interesting approach to the problem we currently try to solve using mod_userdir.

So I take it in hsphere, you can set up a particular domain that you use for new domains to alias to and hsphere will add the DNS entry whenever an account is created?

Is there an agent to remove that entry after say 3 days when DNS should be kicked in?

whservices
04-25-2008, 06:41 PM
It's definitely an interesting approach to the problem we currently try to solve using mod_userdir.

So I take it in hsphere, you can set up a particular domain that you use for new domains to alias to and hsphere will add the DNS entry whenever an account is created?

Is there an agent to remove that entry after say 3 days when DNS should be kicked in?

In Hsphere, say the server hostname is: cp.domain.com ...
It will create an alias say: da09a8ksl.domain.com to point to their web docs. <<< Note that it's random characters to help with security and the bandwidth issue you currently face with mod_userdir on cPanel.

The alias actually remains there until the account is destroyed, but can be turned on/off by the user within Hsphere. But I think it would be good to autodelete after X amount of days. I don't know that I would set it to 3 days, maybe 30 days. Some customers will spend months developing a site before taking it live.

DaveDark
04-25-2008, 06:50 PM
In Hsphere, say the server hostname is: cp.domain.com ...
It will create an alias say: da09a8ksl.domain.com to point to their web docs. <<< Note that it's random characters to help with security and the bandwidth issue you currently face with mod_userdir on cPanel.

The alias actually remains there until the account is destroyed, but can be turned on/off by the user within Hsphere. But I think it would be good to autodelete after X amount of days. I don't know that I would set it to 3 days, maybe 30 days. Some customers will spend months developing a site before taking it live.

Thanks. Likely, we could allow you to set the amount of time before the entry is auto removed and default it at something long like 30 or 60 days.

I'll make sure this hits the feature request system over here.

whservices
04-25-2008, 07:01 PM
Thanks. Likely, we could allow you to set the amount of time before the entry is auto removed and default it at something long like 30 or 60 days.

I'll make sure this hits the feature request system over here.

Very cool. I'll be looking for it!