homepage Welcome to WebmasterWorld Guest from 54.161.214.221
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Apache Virtual Hosting and Nameservers?
Apache Virtual Hosting and Nameservers?
joshua




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

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

 

jdMorgan




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

Is anyone at WebmasterWorld hosting their own site?

(bump)

Jim

joshua




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

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

Joshua

jdMorgan




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

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

andreasfriedrich




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

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

andreasfriedrich




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

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

txbakers




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

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.

anon1




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

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

joshua




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

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

anon1




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

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

dingman




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

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved