Welcome to WebmasterWorld Guest from 54.198.93.179

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Apache Virtual Hosting and Nameservers?

Apache Virtual Hosting and Nameservers?

     
4:32 am on Nov 18, 2002 (gmt 0)

10+ Year Member



Hi,
I'm trying to host an extra domain name I have on my computer. My domain registrar (GoDaddy) gives me two nameservers for my domain name. I set up NS1 and NS2.[xxx].com with two of the static IP addresses my ISP gives me. I'm not sure what I need to do to get it to work with Apache. Right now, I'm running Apache from my Win9x OS, though when I really start hosting my sites, I plan to use redhat. Anyway, it works fine to access my server via [68.102.xx.xxx,...] but I can't get it to work with my domain name. I'd like to know how to configure my httpd.conf file to work with my domain name.

THANKS
Joshua

4:19 pm on Nov 18, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Is anyone at WebmasterWorld hosting their own site?

(bump)

Jim

6:19 pm on Nov 18, 2002 (gmt 0)

10+ Year Member



I don't know...I'm new here. The description of this forum says "From webservers..." Perhaps I should go elsewhere?

Joshua

6:29 pm on Nov 18, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



joshua,

Welcome to WebmasterWorld!

The forum seems slow today. It was really slow yesterday, too. I know we have members who can answer your question... Unfortunately, I've never done what you're trying to do, and don't know how to set up local DNS.

(bump 2)

Jim

6:36 pm on Nov 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have a look at Apache´s VirtualHosts [httpd.apache.org] documentation.

Once you set up DNS so that your domains resolves to your static ip address you need to set up a VirtualHost container for each domain you want to host.

NameVirtualHost your.static.ip.address 
#
<VirtualHost your.static.ip.address>
DocumentRoot /path/to/files
ServerAdmin root@new_domain.tld
ServerName www.new_domain.tld
ErrorLog /path/to/errorlog
CustomLog /path/to/accesslog combined
</VirtualHost>
#
<VirtualHost your.static.ip.address>
DocumentRoot /path/to/other/files
ServerAdmin root@other_domain.tld
ServerName www.other_domain.tld
ErrorLog /path/to/other/errorlog
CustomLog /path/to/other/accesslog combined
</VirtualHost>

Andreas

6:42 pm on Nov 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just reread your post. If you just want those two domains and want to use a separate IP for each domain name then your configuration would look like this:

<VirtualHost your.static.ip.address> 
DocumentRoot /path/to/files
ServerAdmin root@new_domain.tld
ServerName www.new_domain.tld
ErrorLog /path/to/errorlog
CustomLog /path/to/accesslog combined
</VirtualHost>
#
<VirtualHost your.other_static.ip.address>
DocumentRoot /path/to/other/files
ServerAdmin root@other_domain.tld
ServerName www.other_domain.tld
ErrorLog /path/to/other/errorlog
CustomLog /path/to/other/accesslog combined
</VirtualHost>

Notice the missing NameVirtualHost directive. This is an IP based virtual host configuration as opposed to the name base setup in my previous post.

Andreas

8:47 pm on Nov 18, 2002 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I host my own sites, but never messed with DNS. I kept my domains parked at Verio and use their name servers and zone files. There was no charge.

To set up a proper DNS server you need 2 servers for constant redundancy.

I'm also using IIS not Apache.

7:37 pm on Nov 19, 2002 (gmt 0)

10+ Year Member



Hi,

Just to expand on the above info a little (I host numerous domains on Apache),

One additional item that I find is a must to add is an alias like:

ServerAlias yourdomain.com

That way either www. or not will get them to the site.

There are many other directives and such that you can place in that file for each virtual domain but that one is important.

-Anon1

8:33 pm on Nov 19, 2002 (gmt 0)

10+ Year Member



I have another problem. I was accessing my server by typing in my IP address in Internet Explorer and it worked fine. However, when I tried it on my other computer (same internet connection), it wouldn't load it. Are there Network settings that need changed in Win9x before this'll work right? I was thinking that's why it won't work with my domain name.

Thanks.
Joshua

10:26 pm on Nov 19, 2002 (gmt 0)

10+ Year Member



joshua,

There are so many possible reasons why it is not working for you that I would be making a weak guess without more information.

Like:

Is the web-server local to you or remote out on the net somewhere?

Is your Win9x server running any firewall type software or hardware?

Is that the same Win9x box that is also hosting the site via Apache?

Can you access it over your local network (if your machines are on one)?

Also after re-reading your first post: the info posted above regarding <VirtualHost> settings would typically be made in the vhosts.conf and not the httpd.conf file. httpd.conf should have a section like this which tells Apache to then process the vhosts.conf file:

#
# After processing this file, Apache will also process the following
# files in order.
#
ResourceConfig conf/defaults.conf
AccessConfig conf/vhosts.conf

-anon1

8:55 pm on Nov 20, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In addition to Andreas' Apache config segment, you also need to make sure that www.new_domain.tld points to your.static.ip.address, and www.other_domain.tld points to your.other_static.ip.address. This is done on your DNS server, and the exact method depends on how your DNS is set up, what type of server you are using, etc. Most likely you want to make those A records ('www in A ip-address' in Bind zone files). I actually use CNAMEs ('www IN CNAME @' in a Bind zone file (@ is Bind shorthand for the domain name the zone file is being used for)) and A records for the names the CNAMEs point to.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month