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

I was wondering what are the common things you should look at when debugging a new subdomain not being picked up correctly by apache.

Here are the steps I followed to create the sub-domain;

I copied the setup file from an existing (working) domain in sites-available.

sudo cp old new

Then I edited this to work with the new site (replace 'old' with 'new')

< VirtualHost *:80>

ServerName new.srv.co.uk

DocumentRoot /srv/www/new/public_html/

ErrorLog /srv/www/new/logs/error.log

CustomLog /srv/www/new/logs/access.log combined

< /VirtualHost>

I then created the link in the sites-enabled folder.

ls -s ../sites-available/new new

The next step was to create the appropriate directories in /srv/www/ and gave them the same permissions as other site already listed there.

Finally I restarted apache

sudo /etc/init.d/apache2 restart

It restarts fine but the URL will not work for the site.

If I edit the file in sites-available to break it (remove the '*' for example) apache fails to restart, so I know it is finding that file OK.

There is nothing in the error log and browsers are reporting things like 'Firefox can't find the server at ...'

share|improve this question
    
What is the error you see in the browser ? Is there anything relevant in your error log ? –  Iain Jul 19 '11 at 9:19
1  
Sorry if it seems obvious, but does you new subdomain dns point to your server IP ? –  clmssz Jul 19 '11 at 9:20
    
@spud, don't apologise, I am sure it will turn out to be something daft I am doing. I am going to double check that now. –  Toby Jul 19 '11 at 9:24
add comment

1 Answer 1

up vote 2 down vote accepted

The browser is telling you that it cannot reslove the hostname to an address. You need to create a DNS A or CNAME entry that will resolve your new domain to the IP address of the server that is hosting your apache server.

share|improve this answer
    
I have checked and the CNAME record is set and looks fine. It would have only been done today so could it simply be a propagation issue? –  Toby Jul 19 '11 at 9:32
1  
the address in your error message resolves for me and I get Working... –  Iain Jul 19 '11 at 9:42
    
Must be an internal issue, thank you so much. –  Toby Jul 19 '11 at 9:48
add comment

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.