hosting subdomain problem

Problems with the Windows version of XAMPP, questions, comments, and anything related.

hosting subdomain problem

Postby grutz » 18. September 2006 12:56

Hi

Just a simple question for you brighter ones. I have several web sites running on my web server but now want to host sub domains but when I put in the setting into httpd-vhosts.conf as below it doesn't work. Where am I going wrong?

<VirtualHost *:80>
ServerName mydomain.co.nz
ServerAlias www.mydomain.co.nz
DocumentRoot "D:/www/mydomain.co.nz "
<Directory "D:/www/mydomain.co.nz ">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName subdomain.mydomain.co.nz
ServerAlias www.subdomain.mydomain.co.nz
DocumentRoot "D:\www\subdomain.mydomain.co.nz"
<Directory "D:\www\subdomain.mydomain.co.nz">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
grutz
 
Posts: 18
Joined: 07. August 2006 06:00

Re: hosting subdomain problem

Postby Izzy » 18. September 2006 13:55

grutz wrote:...Just a simple question for you brighter ones...

Your just smooth talking here. :)

grutz wrote:<VirtualHost *:80>
ServerName mydomain.co.nz
ServerAlias www.mydomain.co.nz
DocumentRoot "D:/www/mydomain.co.nz "
<Directory "D:/www/mydomain.co.nz ">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName subdomain.mydomain.co.nz
ServerAlias www.subdomain.mydomain.co.nz
DocumentRoot "D:\www\subdomain.mydomain.co.nz"
<Directory "D:\www\subdomain.mydomain.co.nz">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


The subdomain container should be forward slashes:
Code: Select all
<VirtualHost *:80>
ServerName subdomain.mydomain.co.nz
ServerAlias www.subdomain.mydomain.co.nz
DocumentRoot "D:/www/subdomain.mydomain.co.nz"
<Directory "D:/www/subdomain.mydomain.co.nz">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby grutz » 25. September 2006 04:59

Hi Izzy

Been away on holiday and got back to see it still doesn't work even with the correction you suggested...darn it
grutz
 
Posts: 18
Joined: 07. August 2006 06:00

Postby Izzy » 25. September 2006 06:24

Your subdomain should still have an A entry in your DNS Zone File or it won't resolve from the Internet. Check with your DNS Service.
These are examples of subdomain entries in a Zone File:
Code: Select all
mail   14400   IN   A   123.123.123.123
www   14400   IN   A   123.123.123.123
ftp   14400   IN   A   123.123.123.123
forums   14400   IN   A   123.123.123.123
www.forums   14400   IN   A   123.123.123.123
anysubdomain   14400   IN   A   123.123.123.123

They would relate to addresses:
mail.domain.name
www.domain.name
ftp.domain.name
forums.domain.name
www.forums.domain.name
anysubdomain.domain.name
Etc.

Get the idea?
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby grutz » 25. September 2006 06:56

Thanks Izzy but last week I arranged for the DNS A name to point to the ip of my xampp server. So it can't be that. I've now asked them to point it to their web server and I will upload the web site later when it populates. However I've also subdomained another domain name I own to carry on testing my apache and it still doesn't work. Any more suggestions as to the problem???
grutz
 
Posts: 18
Joined: 07. August 2006 06:00

Postby Izzy » 25. September 2006 07:26

grutz wrote:Thanks Izzy but last week I arranged for the DNS A name to point to the ip of my xampp server. So it can't be that. I've now asked them to point it to their web server and I will upload the web site later when it populates. However I've also subdomained another domain name I own to carry on testing my apache and it still doesn't work. Any more suggestions as to the problem???

If mydomain.co.nz has an A record pointing to your XAMPP Server on IP 123.123.123.123
and subdomain.mydomain.co.nz has an another A record pointing to your XAMPP server IP 123.123.123.123
and your XAMPP server has a virtualhost container like you posted above then there is not much else there is to offer you by way of configuration information as they should work and do work on my server.

Both your mydomain.co.nz and any subdomains you dream of, must have an separate A record pointing to your server's IP. It is not enough to only have your main domain name pointing, all subdomains must also point else how do you expect a browser to find http://subdomain.mydomain.co.nz ?

Also the directories you have set above are directories I assume.
DocumentRoot "D:/www/subdomain.mydomain.co.nz"
<Directory "D:/www/subdomain.mydomain.co.nz">

Normally a subdomain directory may look like this:
DocumentRoot "D:/www/mydomain.co.nz/subdomain"
<Directory "D:/www/mydomain.co.nz/subdomain">


You can also check to see if your domains/subdomains are resolving correctly here:
http://70.84.211.98/co/DomainDossier.vbs.asp

Your domain/subdomain DNS can be checked here:
http://dnsreport.com
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby grutz » 25. September 2006 08:40

In my "D:\" I have a folder called "www" where web sites are held in their own folders. In this case the folder inside "www" is called "subdomain.mydomain.co.nz". All my web sites work that are parent domains, but this subdomain doesn't. I've typed in the subdomain into http://70.84.211.98/co/DomainDossier.vbs.asp and it appears to work, see below. Obviously I have changed the domain names once I pasted here.

Address lookup
canonical name subdomain.mydomain.co.nz.
aliases
addresses 203.114.177.xxx


DNS records
name class type data time to live
subdomain.mydomain.co.nz IN A 203.114.177.xxx 172800s (2.00:00:00)
mydomain.co.nz IN SOA server: rachel.paradise.net.nz
email: nic.paradise.net.nz
serial: 2006092300
refresh: 7200
retry: 1200
expire: 1728000
minimum ttl: 1800
172800s (2.00:00:00)
mydomain.co.nz IN A 203.96.152.10 172800s (2.00:00:00)
mydomain.co.nz IN MX preference: 10
exchange: pop3.paradise.net.nz
172800s (2.00:00:00)
mydomain.co.nz IN MX preference: 20
exchange: smtp.paradise.net.nz
172800s (2.00:00:00)
mydomain.co.nz IN NS rachel.paradise.net.nz 172800s (2.00:00:00)
mydomain.co.nz IN NS kirsty.paradise.net.nz 172800s (2.00:00:00)
219.177.114.203.in-addr.arpa IN PTR 203-114-177-219.dsl.sta.inspire.net.nz 171490s (1.23:38:10
)

However if I use http://dnsreport.com/ I get this error

[ERROR: The parent servers say that the domain subdomain.mydomain.co.nz does not have any NS records (although they may have some other information on that zone). I can not do a DNS report on a hostname (such as mail.example.com) or a domain name that does not have its own zone.]

Hope this helps you find my problem
grutz
 
Posts: 18
Joined: 07. August 2006 06:00

Postby Izzy » 25. September 2006 09:05

Your subdomain is not a subdomain of your main domain as they have different IPs in the zone file.

mydomain.co.nz IN A 203.96.152.10 172800
subdomain.mydomain.co.nz IN A 203.114.177.xxx 172800s

This is not correct and should have the same IP as your main domain in the main domain's zone file.

As the DNS Report tells you it has no Name Servers associated with the subdomain but would have if it was using the main domain IP as the main domain has a Name Server:
mydomain.co.nz IN NS rachel.paradise.net.nz 172800
mydomain.co.nz IN NS kirsty.paradise.net.nz 172800

Change the IP of the subdomain to the one you have on the main domain and it should work fine. You may have to wait for the changes to propagate the net before you can check them.

Here is a Zone File from an old domain I used to own. It will give you some idea of what a zone file contains and how it associates different items with each other. (The domain name and IP will not resolve as they have been removed from service).
Code: Select all
; Zone File for izzytanet.net
$TTL 14400
@   14440   IN   SOA   ns1.idnservers.net.   admin.idnservers.net.   (
               2004102704
               7200
               7200
               1209600
               86400
               )

izzytanet.net.   14400   IN   NS   ns1.idnservers.net.
izzytanet.net.   14400   IN   NS   ns2.idnservers.net.
izzytanet.net.   14400   IN   TXT   "v=spf1 a mx ptr ~all"

izzytanet.net.   14400   IN   A   204.157.9.44

localhost.izzytanet.net.   14400   IN   A   127.0.0.1

izzytanet.net.   14400   IN   MX   0   idns01.idnservers.net.

mail   14400   IN   A   204.157.9.44
www   14400   IN   A   204.157.9.44
ftp   14400   IN   A   204.157.9.44
forums   14400   IN   A   204.157.9.44
www.forums   14400   IN   A   204.157.9.44

See how the main domain name izzytanet.net and the subdomains mail/www/ftp/forums/www.forums have all got the same IPs.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby grutz » 25. September 2006 09:32

I have only one domain name that is hosted on paradise's server and it is this domain name that has a subdomain that I am trying to host on my xampp server, that is why the ip address differs.
grutz
 
Posts: 18
Joined: 07. August 2006 06:00

Postby Izzy » 25. September 2006 09:42

grutz wrote:I have only one domain name that is hosted on paradise's server and it is this domain name that has a subdomain that I am trying to host on my xampp server, that is why the ip address differs.

Well it won't work as you have found out.
It is no longer a subdomain, it is a new main domain and as such will have to have its own name servers at your domain registra and it's own Zone file. Thats why it is called a subdomain of the main domain.

They need to have the same IPs in the main domain Zone File. That is the file that the Internet uses to find your main and sub domain server. If they have a different IP it is impossible to locate the server. This is also the file that the DNS Bind software uses and is an Internet Standard.

If you host the subdomain on the server that is hosting your main domain then the zone file will be edited to reflect this and the subdomain will work. But will never work the way you wanted it to by hosting the subdomain on another server.

When you set up your new domain with subdomains on your XAMPP server then that will also work.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby grutz » 25. September 2006 10:14

Thanks Izzy for your help. I'm trying to get paradise (isp that is hosting domain name) to change the pointing of the subdomain and will report back when they have and let you know if that fixes the problem. I've also created a subdomain to one of mydomans on xampp and will let you know if that works once its propagated.
Much appreciated.
grutz
 
Posts: 18
Joined: 07. August 2006 06:00

Postby Izzy » 25. September 2006 10:53

grutz wrote:Thanks Izzy for your help. I'm trying to get paradise (isp that is hosting domain name) to change the pointing of the subdomain and will report back when they have and let you know if that fixes the problem. I've also created a subdomain to one of mydomans on xampp and will let you know if that works once its propagated.
Much appreciated.
Your welcome.

Just to recap and to simplify the issue with a simple explanation, as the above was interspersed with factors relating to the explanation.

mydomain.co.nz and subdomains.mydomain.co.nz all hosted on your ISP will work absolutely.

mydomain.co.nz hosted on your ISP but subdomains.mydomain.co.nz hosted on your XAMPP server will not work.

mydomain.co.nz and subdomains.mydomain.co.nz all hosted on XAMPP server will work absolutely.

The proviso on all the above is the DNS (zone file) is configured correctly.

I prefer to manage my own DNS by using zoneedit.com no matter where I have my sites registered and hosted.

I register a domain name at a domain name registrar (eg. godaddy.com).
I then register that domain for free with zoneedit.com.
Then I configure that domain's DNS Zone file at zoneedit.com, using their very simple control panel, for my specific needs which I find much easier than trying to explain to a third party what I require to be done.
I then notify my registrar of my domain name's new zoneedit's Name Servers (eg. ns1.zoneedit.com and ns2.zoneedit.com).
I now have full control of my domain name, it's DNS and it's hosting.
Editing if things change is as simple as loggin in to zoneedit and doing the changes which has a very quick propagation response - often munutes not hours or days.
And "oh! what a feeling". :)
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby LEX200 » 26. September 2006 14:38

I have p3p.sytes.net
how I can do subdomain like as
mail.p3p.sytes.net

examles please
LEX200
 
Posts: 13
Joined: 13. September 2006 23:00

Postby grutz » 26. September 2006 19:06

Hi Lex200

From above comments from Izzy you will note that you need to do two things.
1. Setup your zone file for both domain and sub domain. I would suggest you take Izzy's advice and open a free account at zoneedit. I did and it was easy to setup.
2. Add the following to your "httpd-vhosts.conf" file. The path to this file is xampp\apache\conf\extra

Below I'm using an example domain name and sub domain for security reasons. I would suggest that you edit your post above and take out your domain name and leave an example too, again for security reasons. Everything I put in brackets is only my comments, don't include them in your vhost config file. I appologies if I make this very simply as I'd rather do this in case you are a newbie like me.

(My program is installed in D drive, you need to change it to C if you have it installed there)

NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost:80
DocumentRoot "D:/xampp/htdocs"
</VirtualHost>


(business is the example domain name)
(the web sites are in a folder called sites)

<VirtualHost *:80>
ServerName business.co.nz
ServerAlias www.business.co.nz
DocumentRoot "D:/sites/business.co.nz/" <Directory "D:/sites/business.co.nz/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


(my.business is the example subdomain name)

<VirtualHost *:80>
ServerName my.business.co.nz
ServerAlias www.my.business.co.nz
DocumentRoot "D:/sites/my.business.co.nz/"
<Directory "D:/sites/my.business.co.nz/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Hope this helps. If you have problems paste here but change the domains to examples before posting.
grutz
 
Posts: 18
Joined: 07. August 2006 06:00

Postby LEX200 » 26. September 2006 19:38

Hi grutz adn thx
but I have free domain p3p.sytes.net and I don't know how to register mail.p3p.sytes.net
in apache I know wat I should write!
How I egister mail.p3p.sytes.net for internet?
LEX200
 
Posts: 13
Joined: 13. September 2006 23:00

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 96 guests