Q&A: apache template, dns template

(note: some questions from emails are answered here, so that everyone can utilize. let me know if something private to you is written here.i will remove that info.If you wish, I may also remove whole question/answer.)

here are my advices/suggestions:
* unless you know what you are doing, or you are sure what you are doing, do Not edit those templates (especially dns template, it contains many things needed.); because those templates are working in most cases. you normally do not need to edit them. even if you use your own dns (actually ehcp also does like that, your own dns), you dont needt to edit them.
* in dnstemplate, you dont need to replace "{domainname}" with your actual domainname, that conversion is done by ehcp, automatically. and, it is safer to leave it as {domainname}, to prevent typos. same applies for apachetemplate.

* to run multiple cms site (multiple sites that have cms inside) you dont need to edit any template/setting in ehcp, AFAIK, just setup/add your domains one by one, then, install any cms inside.
* if you need to setup a "multiple cms accross many sites" (one cms, many sites) this is something different. do you want this ?
* backup your apache templates in ehcp gui, so that you may rollback. (maybe we can integrate this feature in ehcp)
* in case you fail something, just "delete from customsettings" in mysql, so that, all custom settings are reset, and you revert to original template.
* many things are related to "apache configs". and can be done in apachetemplate in ehcp gui. So, if something can be done in apache configs, then you need to know related apache configs. and ehcp is only a gateway to apache/nginx configs. For detailed apache config questions, you need to consult to apache documentation, ehcp is mostly transparent to apache.

On Thu, Oct 7, 2010 at 11:46 PM, Jxxxxxxx wrote:
> I am a little bit confused. I set this up before, and was working following
> the documentations. Then I was using it for just one site. this is what I
> did. I opened up the apache and dns template in ECHP GUI and enter the dns
> and ip in the following:
> #____________start of
> {domainname}__paneluser:{panelusername}_reseller:{reseller}_id:{id}____________
> # explanation  {aciklama}
>         ServerName   {domainname}
>         ServerAlias  www.{domainname}        
> # buraya aliaslar yazilacak..
> {aliases}
>         UseCanonicalName Off
>         DocumentRoot {homedir}/httpdocs
>         ScriptAlias /cgi-bin/ {homedir}/httpdocs/cgi-bin/
>         # this combined log format is understandable by webalizer... some
> other formats are not recognised by webalizer.. thats why, specified here
> explicitly.. 
>         LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
> \"%{User-Agent}i\"" combined
> LogFormat "%v:%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
> vhost_combined
>    CustomLog  {homedir}/logs/access_log combined
>    CustomLog  /var/log/apache_common_access_log vhost_combined
>    php_admin_value open_basedir {homedir}
>    php_admin_value upload_tmp_dir {homedir}/phptmpdir
> php_admin_value session.save_path {homedir}/phptmpdir
>         AccessFileName .htaccess
> AllowOverride all
> {customhttp}
> ServerName  webmail.{domainname}
> ServerAlias  mail.{domainname}
> ServerAlias  email.{domainname}
> DocumentRoot /var/www/vhosts/ehcp/webmail
>         LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
> \"%{User-Agent}i\"" combined
> LogFormat "%v:%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
> vhost_combined
>    CustomLog  {homedir}/logs/access_log combined
>    CustomLog  /var/log/apache_common_access_log vhost_combined
> php_admin_value open_basedir /var/www/vhosts/ehcp/webmail
> php_admin_value upload_tmp_dir /var/www/vhosts/ehcp/webmail/data
> php_admin_value session.save_path /var/www/vhosts/ehcp/webmail/data
> ServerName  cpanel.{domainname}
> ServerAlias  panel.{domainname}
> ServerAlias  ehcp.{domainname}
> ServerAlias  cp.{domainname}
> DocumentRoot /var/www/vhosts/ehcp/
>         LogFormat "%v:%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
> \"%{User-Agent}i\"" vhost_combined
>    CustomLog  /var/log/apache_common_access_log vhost_combined
> php_admin_value open_basedir /var/www/vhosts/ehcp/
> #____________end of
> {domainname}__paneluser:{panelusername}_reseller:{reseller}_id:{id}____________
> $TTL    86400
> @       IN      SOA     ns.{domainname}. {dnsemail} (
>                         {serial}     ; Serial
>                         10800   ; Refresh
>                         1200     ; Retry
>                         86400  ; Expire
>                         86400 ) ; Minimum
> {domainname}.           IN NS   ns.{domainname}.
> ns.{domainname}.        IN A    {dnsip}
> ns1.{domainname}.       IN A    {dnsip}
> ns2.{domainname}.       IN A    {dnsip}
> dns.{domainname}.       IN A    {dnsip}
> dns1.{domainname}.       IN A    {dnsip}
> dns2.{domainname}.       IN A    {dnsip}
> {domainname}.           IN A    {webip}
> mail.{domainname}.      IN A    {mailip}
> smtp.{domainname}.   IN A    {webip}
> webmail.{domainname}.   IN A    {webip}
> ftp.{domainname}.       IN CNAME        {domainname}.
> www.{domainname}.       IN CNAME        {domainname}.
> {domainname}.           IN MX  10 mail.{domainname}.
> {domainname}.           IN TXT "v=spf1 a mx"
> {customdns}
> *                       IN A    {webip}
> ns1 and ns2 = the registered domain with my serverip. With this that site
> was runing fine. When added another domain 2 in num, I did the same thing.
> And confusion started from there. My admin mail was filled with apache error
> message from the server. So I started deleting all the file I edited
> manually. At a time I could not could not even access my server again. I
> have been battling with that for about two days now. So today, I started all
> over by reinstalling. Now I have echp runing. Kindly advice on how to go
> about putting multiple CMS site to the server without runing into the same
> problem again.
> Thanks
> Jxxxxx