Hey whats up guys.. maybe you all can help me.. cause I am lost.. maybe im doing something wrong maybe im not doing something at all.. or maybe im just doing to much of something...

Anyway to make a long story short my company would like to host thier own site inhouse to reduce some costs, as well as offer clients the ability to host there sites through us as an incentive to try an close deals with possible clients.

We are using apache 2.0.48, on an NT based machine. All works accordingly and well up til we try to point the domain to the server.

Now the problem I am having with that is our registar.. we need nameservers, and Im not quite sure how to set those up with apache. If someone could point me to some documentation a module what ever that does that that would be great..

Now my big question is, we went out got some domains that resolve via IP for testing.. all the domains in themselevs reslove fine. But when I put them all into their own vhost container the top one super seeds all the domains. and will send all requests to the server to that specific location within it.

My comapany has it set up like this in the root folder of the server for hosting (htdocs)

.
..
[Clients]
[]
[]
[]
[Company]
[Projects]
index.html
about.html
contact.html

we have our domain, and 3 client domains... my company wants the directory set up like that example above for orginational reasons.. root directory containing our main site, client directory hosting client sites etc.. can anyone give me an example of what to do right in a senerio as I am talkin about?

Dani AI

Generated

Two separate issues are visible here: registrar/DNS and Apache name-based virtual hosting. is correct that nameservers are handled by DNS (not Apache itself) — for quick local testing map each client domain to the server IP in the test machine’s hosts file rather than waiting on registrar changes.

Given ’s layout (a shared htdocs with subfolders for clients), the common symptom where every domain ends up at the same site means Apache is serving the default vhost instead of the intended one. Typical causes are: vhost definitions not being loaded, a mismatch between what Apache is listening on and the addresses in the vhost blocks, missing ServerName/ServerAlias entries, or an earlier “catch‑all” vhost taking precedence. On Windows also confirm the vhosts include is actually referenced from httpd.conf and that Apache was restarted after edits.

Quick, practical checks:

  • Use hosts-file mappings for immediate testing, for example:
    192.0.0.1 client-1.com www.client-1.com
    192.0.0.1 client-2.net www.client-2.net
  • Verify the Host header is delivered to Apache:
    curl -I -H "Host: client-2.net" http://192.0.0.1/
  • Inspect Apache access_log and error_log for which vhost served the request and for any config warnings.
  • Ensure the server firewall permits port 80 and that Apache’s Listen configuration covers the IP/port being used.
  • Make each domain’s DocumentRoot point to its own folder (not a shared index) and check filesystem permissions.

Production notes: registrar DNS must contain A records for each domain (or use a managed DNS provider for reliability). Running authoritative DNS in-house requires registering NS/glue records and at least two independent name servers — this is operationally heavier than using hosted DNS. The above checks usually reveal whether the problem is DNS or vhost configuration.

Recommended Answers

All 2 Replies

Well I will try to seperate your issues out for you.

First, as far as nameservers go, you will need to setup bind/MS DNS, or some kind of DNS Server, these are not done through apache, most people perfer to use a provider for this such as zoneedit.com or some popular DNS Service for reliability. Generally speaking it is recommended that you have 2 different servers for DNS and that they be on different class C's in case there are any routing or power issues.


Your next issue is that the virtual hosting, the top domain will be able to be viewable via ip address, however via the domain name if you are not able to see each domain in their respective site, you will need to make sure that there is a 'NameVirtualHost' directive above the virtual host configuration.

ie.

NameVirtualHost

<VirtualHost >
Servername
Serveralias
......
</VirtualHost>

<VirtualHost >
Servername domain.com
Serveralias www.domain.com
......
</VirtualHost>

Be sure to restart apache after you add in this directive as it requires a restart to recognize the changes.

beats me...good luck with it though sry i cant help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.