NameVirtualHost *:0 has no VirtualHosts ...done.

I started getting this error, due to this apache2 can not start.

Please advice.

ensure that you have following lines in /etc/apache2/ports.conf

NameVirtualHost *
Listen 80

I have a VPS and I installed EHCP. It works great.

My problem is that domains I add domain in EHCP doesn't show unless I manually add the domain in my VPS. I have to manually add dns zones from the VPS panel or the domain will not work.

How can i solve this? What I want is to just add the domain in the EHCP and not need to add the domain in my VPS admin panel. Any idea?

Thanks.

look at your /etc/bind/named.conf file
there should be a line at end:
include "/etc/bind/named_ehcp.conf";

if there is no such file, then, add it.

Additionally,
check that you have a file dnszonetemplate in your ehcp dir.
And make sure it has something in it like:


$TTL 86400
@ IN SOA ns.{domainname}. {dnsemail} (
{serial} ; Serial
10800 ; Refresh
3600 ; Retry
604800 ; 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}
webmail.{domainname}. IN A {webip}
ftp.{domainname}. IN CNAME {domainname}.
www.{domainname}. IN CNAME {domainname}.
{domainname}. IN MX 10 mail.{domainname}.
* IN A {webip}

{customdns}

if it has something else, or empty. fill it with this.
dns zone files are generated from this.
Additionally, make sure that you have ehcp daemon running.

To check that:
ps aux | grep index
you will see like:
$ ps aux | grep index
root 9384 0.0 0.6 36556 13300 ? S 11:58 0:02 php index.php daemon

Thanks for the really quick reply.

I checked all those you listed, and I have them like that.

My issue is when I add the domain in EHCP, it doesnt really work unless I add the domain to the VPS (i use slicehost) slice manager panel. It is kinda tiring cause i have to do it twice - one in EHCP and one in the VPS panel.

Also, say for example, i add a subdomain to one of my domains in EHCP, it will not work unless i add an A zone entry to the original domain in the Slicehost Control Panel.

I am thinking it should be adding automatically.

Everything else works fine. You have any idea why this happens?

i understand now your case,
it seems that your vps uses some type of redirection or web translation, and it seems that you have some type of ip sharing..

may i ask you ,
1- does your vps have a dedicated real ip address ? (if it has, ehcp should be enaugh for a normal hosting operation)
what is your ip ? (you may write like xx.yy.65.55)
2- can you provide more information about your vps-slice manager? at which ip your slice manager works ?
3- does anybody else shares your ip ?
4- where is slice manager running ? are you able to access slice manager files ? is it php or opensource ?

i ask these to find a solution for your case.

Yes, my vps have a dedicated ip address - my ip is xx.yy.234.226. It is from www.slicehost.com. Aside from complete SSH access to my VPS, it has a slice manager control panel. The vps comes with a clean install of debian (and some other linux releases).

you did not answer all of my questions,
if you have a dedicated ip address, then you should do nothing related to hosting, with slice control panel...
does anybody else shares your ip ?
and read questions above again...

Im not sure if anybody else share my IP, but Im pretty sure it's not being shared since it's a dedicated IP address.

The slicehost control panel is web based access. Im not sure if it's php or an open source like you're asking. Basically, it has a dns server which allows me to add domain and zone entries (like a dns server), and to restart-backup-rebuild-reboot the vps slice. That is its only feature.

EHCP is running it's own DNS server, that's why im wondering why do i need to add the same domain i add in EHCP to the server panel.

my direct contact info is at http://www.ehcp.net/?q=node/366
if you need help

Ok i think i found the problem - my nameserver points to the VPS's.

the dedicated IP addy of my server is xx.yy.234.226. But since i only have one dedicated IP and I want to use my domain as nameserver entries, i did a little work around. From the domain control panel - i added 2 hosts to mydomain.com - ns1 and ns2 which both point to the the VPS's main addresses - aa.bb.cc.dd and not to my xx.yy.234.226.

you should do nothing special if you even want to use same ip for nameserver entries.
As i described before,
just setup your your domain on ehcp, on your ip of xx.yy.234.226. (ehcp setups ns1 and ns2 automatically)
Then, just redirect your domain and name server to your ip of xx.yy.234.226 . Do not redirect dns/name server to main ip of vps/slice manager.
This way, you will be able to use ehcp and setup domains without having to deal with slice manager.
These are also defined step by step in http://www.ehcp.net/helper/yardim/cat.php?cid=4

hope this helps...

this is my ports.conf

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default

NameVirtualHost *
Listen 80

# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443

look at following files and match <VirtualHost *> with Namevirtualhost directive,
They should be similar,

/etc/apache2/sites-enabled/000-default
/var/www/vhosts/ehcp/apachehcp.conf -> you may empty this file, since it is re-constructed by ehcp when you do syncdomains in ehcp
/var/www/vhosts/ehcp/apachetemplate

my files for ex:

root@ehcpdeveloper-yenihdd:/web/ehcp# cat apachetemplate
#____________start of {domainname}__paneluser:{panelusername}_reseller:{reseller}_id:{id}____________
# explanation {aciklama}
# Namevirtualhost *:80
# <VirtualHost *:80>

<VirtualHost *>
ServerName {domainname}
ServerAlias www.{domainname}
UseCanonicalName Off
DocumentRoot {homedir}/httpdocs

# 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

{customhttp}

</VirtualHost>

<VirtualHost *>
ServerAlias webmail.{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

</VirtualHost>

#____________end of {domainname}__paneluser:{panelusername}_reseller:{reseller}_id:{id}____________

root@ehcpdeveloper-yenihdd:/etc/apache2# cat ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default

NameVirtualHost *
Listen 80

<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
</IfModule>

root@ehcpdeveloper-yenihdd:/etc/apache2# cat sites-enabled/000-default
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

i think im getting the same problem i too have ehcp running on slicehost

i liked the idea of slicehost as it gave me much scope of running my own server at a fraction of the cost of a dedicated server

i have 2 dedicated ip addresses

i have installed ehcp and if i just want to use domains and standard web pages all seems to work fine
email works although there was some problems sending email

my biggest headaches is i have been trying to install Dolphin 6.1 a social network site and is installed vire a script 1st of it bottoms out untill i install ImageMagick
then there was alot of

Warning: is_file() [function.is-file]: open_basedir restriction in effect
i managed to solve that one in php.ini

but cannot solve
Warning: chmod() [function.chmod]: Operation not permitted

after install is complete apart from the 2 errors everything seems to work fine

but all the links in the navigation bar dont work i am about to try a custom dns in the hope this will solve issue i will keep you informed

that is a security issue..
to disable it,
open your apachetemplate file in ehcp dir,
find "php_admin_value open_basedir {homedir}"
remove it.
go to options in ehcp, click sync domains
open_basedir restriction cleared this way...
This makes a small security hole in your server.