Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have configured a subdomain in my Apache2 httpd server, but having a problem. I can reach the subdomain by using http://subdomain.domain.com but do not access it by using www.subdomain.domain.com

My top-level domain say, domain.com can be reached with both http://domain.com and www.domain.com

Here is source from my subdomain config file in sites-available

<VirtualHost *:80>
    ServerName subdomain.domain.com
    ServerAlias www.submdomain.domain.com
    ServerAlias http://www.subdomain.domain.com

    ServerAdmin admin@domain

    DocumentRoot /var/www/domain/subdomain
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/domain/subdomain>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

Where is the problem? Here in this configuration or in A records of my domain name?

EDIT : I get this message from my ISP when I try to reach by www.subdomain.domain.com = "Sorry, the website you were looking for is unavailable."

And when I used a proxy to reach it, it shows this error message = "The requested resource could not be loaded. libcurl returned the error: Couldn't resolve host 'www.subdomain.domain.com"

share|improve this question
    
What happens or error message do you get when you try to access www.subdomain.domain.com ? –  Iain Aug 27 '12 at 9:04
    
@Iain: I cannot reach there, my ISP shows this message "Sorry, the website you were looking for is unavailable." –  Abhi Aug 27 '12 at 9:06

2 Answers 2

You'd need to provide more details, ie. what error is returned when you try to reach your www.subdomain.domain.com. My guess is you don't have www.subdomain.domain.com in your DNS server.

share|improve this answer
    
I have edited my question to include error message, have a look now –  Abhi Aug 27 '12 at 9:14
    
Can you paste the apache2 error report. –  Caterpillar Aug 27 '12 at 9:23

Couldn't resolve host 'www.subdomain.domain.com"

You need to configure your DNS to resolve www.subdomain.domain.com to your server's IP address.

share|improve this answer
    
I am not using DNS, I am using A records and I have added subdomain to it. –  Abhi Aug 27 '12 at 9:15
    
@Abhi: You are using DNS what do you think an A record is ? –  Iain Aug 27 '12 at 9:29
    
I figured it out, I had to configure cname for it to work with www as well. –  Abhi Sep 4 '12 at 7:13
    
So, like I said you had to configure your DNS ... –  Iain Sep 4 '12 at 7:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.