hostin ehcp in a domain or ip ? howto host a domain in ehcp..

this is taken from a question and answer:

ehcp is for hosting, you may host domains in ehcp. yourdomain.com can also be hosted on ehcp. this is upon your choice.. if you have already hosting for yourdomain.com, then you may not need to transfer its hosting to ehcp (which runs on your server)/your server..
or you may choose to transfer it to your server, ehcp..

if you dont have already hosting for yourdomain.com, then you should only "redirect " it to your server (ehcp). redirecting means, you set your server ip, as the dns of yourdomain.com. Thus, anyone who wants to reach yourdomain.com will be redirected to your server. You have to redirect to your (this, ehcp-installed) server to host your domain yourdomain.com in your server.. this is so called hosting..
To redirect: i think You should use "transfer dns to webhost" feature. you should be able to write ips too.. if you cant, look something "register dns server" on your namecheap domain control panel... there should be something like this..... it have to be... then register your own dns server with ns.yourdomain.com for single dns server, or ns1.yourdomain.com, ns2.yourdomain.com if you need two dns server, these may have same ip... if you have difficulty in doing this, i may help you...

we come to ehcp:
ehcp does not require a domainname to host inside it.. ehcp may be hosted on a server ip directly.... buf if you want, you may also copy its files to some domain's hosting space and run it from there... but you dont have to do so... for instance, you may do:
1- first, run ehcp from your servers ip
2- create your domain yourdomain.com using ehcp, redirect your domains dns to your server ip...
3- copy your files under yourdomain.com domain in your server, such as yourdomain.com/ehcp .. (copy files under /var/www/vhosts/ehcp/* to /var/www/vhosts/yourdomain/yourdomain.com/httpdocs/)

this way, your ehcp runs from nowon on your server, under your domain account...

Another similar answer:
you need to register your domain in a domain seller, then redirect your domain to your server as dns..

you need to register your server as dns server in your domain seller.
domain seller's usually have sections like register dns.

Go to register dns,
enter ns1.yourdomain.com to name, and your external/real server ip as dns ip.
you may use same ip for both ns1.yourdomain.com and ns2.yourdomain.com

Unfortunately, some domain sellers does not allow same ip for ns1 and ns2. In this case, you need either a secondary ip for your server, or you need to port your domain to another domain seller/registrar..

Additionally:
* if you are using your server to access you pages, that is hosted on same server/ehcp, then make sure that you checked checkbox at settings, "This machine is used for Desktop access too (Update hosts file with domains) " - placed on top of settings.. Otherwise, you wont be able to see your domains on your local server...

* if you are on same internal Local Area Network - LAN as your server that you installed ehcp, then you wont be able to access your domains until you update your hosts file (linux/windows) with info like domains at /etc/hosts. Please be sure that this is a case only you are on same lan as your server. (Used by some companies..)

have a look at relevant pages too:
http://www.ehcp.net/?q=node/167
http://www.ehcp.net/?q=node/106
http://www.ehcp.net/?q=node/104

another Q & A in similar topic:

Guest chat
Guest has joined.

Guest: hi
Sent at 10:24 PM on Friday

me: hi
Sent at 10:28 PM on Friday

Guest: sorry about my english. just installed ehcp and having a trouble with dns. still i can't manage dns2 for a domain

Sent at 10:29 PM on Friday

me: .
what you mean by dns2 ?
your domain not working ?
what is your domainname ?
Sent at 10:32 PM on Friday

Guest: no. i own a hosting company and just moving to a vps. everything runs fine, i love ehcp but i need secondary dns too. but after a few hours of broesing your forums, just font the answer: "Unfortunately, some domain sellers does not allow same ip for ns1 and ns2. In this case, you need either a secondary ip for your server, or you need to port your domain to another domain seller/registrar.."

me: your ns2 not working ?
what is your domainname ?
i will check.

Guest: so in my case i need another dns server for secondary dns. although i have 2 ip addresses from different subnets, so theoretically i am able to serve ns1 and ns2, but unfortunately ehcp is not able
i have a lot of domains, i host hundreds of them, so i just need a secondary dns somewhere

me: ehcp can handle two dns

Guest: how?

me: 1min
you have ip1 for dns1

Guest: i'm clicking ehcp for 9 hours now

me: ip2 for dns2
right, for example,

Guest: yes, that is ehcp"s ip

me: where ip2 is located ?
same server or remote server ?
or another server ?

Guest: at the same vps, but different subnet

me: then, you have 2 ip's in one vps
isnt it ?

Guest: i have virtually two ip's: 193.23.139.51 and 193.23.138.51, but thy are on the same vps

me: ok. thats right.
now,
open file /var/www/vhosts/ehcp/dnszonetemplate
in console,
write your ip2 in front of dns2 line
and ns2 line
save file
then,
in ehcp
options->sync dns
thats it
or, you may also use same ip's,
if your domain seller allows for this.

Guest: hungarian registrars need two different subnet ip''s

me: ok. then do like i described.
understand ?

Guest: party, cause i don't have dns folder under ehcp describet up
i use debian lenny, not ubuntu, but nearly the same are they

me: no dns folder
/var/www/vhosts/ehcp/dnszonetemplate
this file
edit this file

Guest: just found it, thanks

me: $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}
content this
make that like following:
$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 99.99.99.99
dns.{domainname}. IN A {dnsip}
dns1.{domainname}. IN A {dnsip}
dns2.{domainname}. IN A 99.99.99.99
{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}

Guest: i'm a little bit tired, but i can't find here NS records

me: assuming your ip2 is 99.99.99.99

Guest: my running bind's zonefile looks like this:

me: dont edit bind zonefile
they are built from db by ehcp automatically

Guest: ;
; BIND reverse data file for kraeta.hu zone
;
$TTL 300
@ IN SOA ns.kraeta.hu. dnsadmin.ns.kraeta.hu. (
2010010802 ; Serial
8H ; Refresh
2H ; Retry
1W ; Expire
1D ) ; Negative Cache TTL
;
NS ns.kraeta.hu.
NS ns.koczka.hu.
MX 10 mail.kraeta.hu.
;
ns IN A 212.40.96.85
ns1 IN A 212.40.96.85
ns2 IN A 212.92.23.213

me: just edit the file i mentioned.

Guest: no, editing the templatefile
in my running zone there are two NS records for each dns's

me: probably you edited them manually, or using another tool.

Guest: yes, amually anf via shellscript

me: you should use ehcp to handle dns for all domains, for a consistent hosting operation

Guest: yes, that's my plan

me: ehcp manages dns and apache configs

Guest: i love it, especially the ability to install scripts and cms's

me: just edit that file, then, in ehcp gui->options->sync dns

Guest: ok, i see

me: if you need more help, open a forum topic.
see you,