LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-20-2002, 11:16 AM   #1
John_Saunders
Member
 
Registered: Jun 2002
Location: Wilmington, NC
Distribution: Red Hat 7.2
Posts: 47

Rep: Reputation: 15
Can't Get Sub-domains to Work


I am trying to set up a sub-domain off my main domain name. The main domain is pointing to my dedicated server without any problems. It is set up like this:

NameVirtualHost *

<VirtualHost 209.58.581.1>
DocumentRoot /home/login/public_html
ServerName domain.com.com
ErrorLog /home/login/logs/error_log
CustomLog /home/login/logs/access_log combined
ServerAdmin admin@domain.com
ServerAlias domain.com
AddHandler cgi-script .cgi
AddHandler perl-script .pl
UseCanonicalName off
</VirtualHost>

Here is what I entered beneath it in the httpd.conf file:

<VirtualHost statistics.domain.com>
ServerName statistics.domain.com
</VirtualHost>


What am I doing wrong? I want to make sure the sub-domain stats in the address bar the entire time.

Also, what is exactly is the difference between setting UseCanonicalName to on and off? What is a Canonical Domain?
 
Old 07-20-2002, 01:53 PM   #2
linuxlastslonge
Member
 
Registered: Jun 2002
Location: Franklin, IN
Distribution: Debian, CentOS, Mac OS X
Posts: 158

Rep: Reputation: 30
first off, turn canonical name off.
set your NameVirtualHost from * to your dedicated IP address.
In your virtual host directive, you want it to look something like this:

<VirtualHost www.domain.com>
ServerAdmin admin@domain.com
DocumentRoot /var/www/domain.com
ServerName domain.com
ServerAlias www.domain.com
ErrorLog logs/domain.com-errorlog
CustomLog logs/domain.com-access_log common
</VirtualHost>


to have a sub domain, setup another virtual host directive:

<VirtualHost sub.domain.com>
ServerAdmin admin@domain.com
DocumentRoot /var/www/sub.domain.com
ServerName sub.domain.com
ServerAlias sub.domain.com
ErrorLog logs/sub.domain.com-errorlog
CustomLog logs/sub.domain.com-access_log common
</VirtualHost>


then edit your DNS table/record in named and add a line like this:


domain.com. IN A <yourIP>
www IN A <yourIP>
sub IN A <yourIP>


i believe the above will work. if not please e-mail me: matthew@comp-exp.com and i'll send you a copy of my httpd.conf and a copy of my hosts.domain file in named.

good luck.

-matthew-
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail with two domains lasantha Linux - Networking 3 11-02-2005 09:39 AM
Sub Domains Mag|c Slackware 0 06-23-2003 07:30 AM
more domains with sendmail sqn Slackware 0 06-01-2003 04:00 PM
Two domains for sendmail jhildebrand Linux - Software 2 04-26-2003 04:15 PM
who does Linux work with NT Domains yogotie Linux - Networking 7 03-19-2001 10:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration