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 ...'

link|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 ? – spud 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
feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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