Subdomain not working
I have done a successful subdomain on my linode before. I am following the same steps, but now it does not work, in firefox, I get Problem loading page "Firefox can't find the server at stats.mydomain.com".
Here is what I've done/got:
In the LM: A/AAAA record added with the correct IP and the right subdomain name "stats" (entering "stats.mydomain.com" does the same thing)
On the server, I've done the following
$ sudo nano /etc/apache2/sites-available/stats.mydomain.com
# Place any notes or comments you have here
# It will make any customisation easier to understand in the weeks to come
# domain: stats.mydomain.com
# public: /var/www/vhosts/stats.mydomain.com/
<virtualhost myip:80=""># Admin email, Server Name (domain name) and any aliases
ServerAdmin admin@mydomain.com
ServerName stats.mydomain.com
ServerAlias www.stats.mydomain.com
# Index file and Document Root (where the public files are located)
DocumentRoot /var/www/vhosts/stats.mydomain.com/
<directory var="" www="" vhosts="" stats.mydomain.com="">Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all</directory>
# Custom log file locations
LogLevel warn
ErrorLog /var/www/vhosts/stats.mydomain.com/log/error.log
CustomLog /var/www/vhosts/stats.mydomain.com/log/access.log combined</virtualhost>
Now I run the following
$ sudo mkdir -p /var/www/vhosts/stats.mydomain.com/log/ (this creates the parent directory)
$ sudo chown -R myUser /var/www/vhosts/stats.mydomain.com
$ sudo chgrp -R www-data /var/www/vhosts/stats.mydomain.com
$ echo "Hello World" >> /var/www/vhosts/stats.mydomain.com/index.html
Then I enable the site and reload apache
$ sudo a2ensite stats.mydomain.com
$ sudo /etc/init.d/apache2 reload
Upon loading it up in my browser, it doesn't work! Yes the parent domain works, and I've also got a working subdomain for another site on the same server, so I know it's possible.
What have I missed? Thanks for any help,
Bung
2 Replies
And if you want to test before DNS reflects the change at your ISP, you can add an entry to your HOSTS file:
stats.mydomain.com nnn.nnn.nnn.nnn
To be sure your server is handling things properly regardless of DNS status.