Hi Markus,

Your issue stems from the fact that you did a CNAME record. CNAME
records act as pointers to other servers so in effect the browser is
redirected to cr.am when they go to api.cr.am. The www server is only
ever seeing cr.am come in because DNS redirects the visitor before it
gets to your server. What you want is an A record for api.cr.am that
points to your www server.  I know scalr has a %hostname% variable,
but is there a %hostip% variable to use in this case?

Mike

On Mar 27, 3:21 pm, markus albe <[email protected]> wrote:
> Hi,
>
> I've been trying to setup a subdomain for our farm, and so far it
> seems I haven't had luck.
>
> I added an entry in the application's DNS zone, and also added a
> default DNS record, but still nothing.
>
> Our main domain is cr.am, and the entry in the app's DNS zone was
> filled like this:
> Domain: api.cr.am
> TTL: 14400
> IN: CNAME
> Record Value: cr.am
>
> And the entry in the default DNS records was configured like this:
> Domain: api.%hostname%
> TTL: 14400
> IN: CNAME
> Record Value: %hostname%
>
> I have setup a vhost in apache like this:
>
> <VirtualHost *>
>         ServerName api.cr.am
>         DocumentRoot /var/www/html/api
>
>         ErrorLog /var/log/apache2/cram_api.error.log
>         CustomLog /var/log/apache2/cram_api.access.log combined
>         ServerSignature On
>
>         <Directory "/var/www/html/api">
>                 Options -Indexes FollowSymLinks MultiViews
>                 AllowOverride Options AuthConfig FileInfo
>                 Order allow,deny
>                 allow from all
>
>                 RewriteEngine On
>                 # RewriteBase /
>                 RewriteCond %{REQUEST_FILENAME} -s [OR]
>                 RewriteCond %{REQUEST_FILENAME} -l [OR]
>                 RewriteCond %{REQUEST_FILENAME} -d
>                 RewriteRule ^.*$ - [NC,L]
>
>                 ## route all the 404's to index.php.
>                 RewriteRule ^.*$ /index.php [QSA,NC,L]
>         </Directory>
> </VirtualHost>
>
> and apache's default.conf looks more or less like
>
> NameVirtualHost *:80
> <VirtualHost *:80>
>         ServerAdmin webmas...@localhost
>
>         DocumentRoot /var/www/html/home/
>         <Directory />
>                 Options FollowSymLinks
>                 AllowOverride None
>         </Directory>
>         <Directory /var/www/html/home/>
>                 Options -Indexes FollowSymLinks MultiViews
>                 AllowOverride Options AuthConfig FileInfo
>                 Order allow,deny
>                 allow from all
>         </Directory>
> .
> ,
> ,
> </VirtualHost>
>
> We have a www role and an app role running, and when I go to
> api.cr.am, I always see the default site, and the separate access log
> shows that the api.cr.am vhost isn't receiving the requests... any
> idea why is this happening?
>
> DNS related stuff is not my strong part, so any help will be more than
> welcome :-)
>
> oh, and here's what dig shows to me (not sure if this is of any help,
> so forgive me if it's not :-P :-))
>
> For cr.am:
>
> r...@lilith:/# dig -t any cr.am
> ; <<>> DiG 9.4.2-P1 <<>> -t any cr.am
> ;; global options:  printcmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9944
> ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2
>
> ;; QUESTION SECTION:
> ;cr.am.                         IN      ANY
>
> ;; ANSWER SECTION:
> cr.am.                  2151    IN      NS      ns1.scalr.net.
> cr.am.                  2151    IN      NS      ns2.scalr.net.
>
> ;; AUTHORITY SECTION:
> cr.am.                  2151    IN      NS      ns1.scalr.net.
> cr.am.                  2151    IN      NS      ns2.scalr.net.
>
> ;; ADDITIONAL SECTION:
> ns1.scalr.net.          147019  IN      A       174.132.108.66
> ns2.scalr.net.          147019  IN      A       174.132.97.130
>
> And for api.cr.am
>
> r...@lilith:/# dig -t any api.cr.am
> ; <<>> DiG 9.4.2-P1 <<>> -t any api.cr.am
> ;; global options:  printcmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65299
> ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
>
> ;; QUESTION SECTION:
> ;api.cr.am.                     IN      ANY
>
> ;; ANSWER SECTION:
> api.cr.am.              13710   IN      CNAME   cr.am.
>
> ;; AUTHORITY SECTION:
> cr.am.                  2147    IN      NS      ns1.scalr.net.
> cr.am.                  2147    IN      NS      ns2.scalr.net.
>
> ;; ADDITIONAL SECTION:
> ns1.scalr.net.          147015  IN      A       174.132.108.66
> ns2.scalr.net.          147015  IN      A       174.132.97.130
>
> and here's the result when I query ns1.scalr.net
>
> r...@lilith:/# dig @ns1.scalr.net -t any cr.am
>
> ; <<>> DiG 9.4.2-P1 <<>> @ns1.scalr.net -t any cr.am
> ; (1 server found)
> ;; global options:  printcmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31621
> ;; flags: qr aa rd; QUERY: 1, ANSWER: 9, AUTHORITY: 0, ADDITIONAL: 2
> ;; WARNING: recursion requested but not available
>
> ;; QUESTION SECTION:
> ;cr.am.                         IN      ANY
>
> ;; ANSWER SECTION:
> cr.am.                  14400   IN      MX      30
> ALT2.ASPMX.L.GOOGLE.COM.
> cr.am.                  14400   IN      MX      10 ASPMX.L.GOOGLE.COM.
> cr.am.                  14400   IN      MX      40
> ASPMX2.GOOGLEMAIL.COM.
> cr.am.                  14400   IN      MX      50
> ASPMX3.GOOGLEMAIL.COM.
> cr.am.                  14400   IN      MX      20
> ALT1.ASPMX.L.GOOGLE.COM.
> cr.am.                  90      IN      A       75.101.207.96
> cr.am.                  14400   IN      SOA     ns1.scalr.net.
> admin.scalr.net. 2009032717 14400 7200 86400 300
> cr.am.                  14400   IN      NS      ns2.scalr.net.
> cr.am.                  14400   IN      NS      ns1.scalr.net.
>
> ;; ADDITIONAL SECTION:
> ns1.scalr.net.          3600    IN      A       174.132.108.66
> ns2.scalr.net.          3600    IN      A       174.132.97.130
>
> and...
>
> r...@lilith:/# dig @ns1.scalr.net -t any api.cr.am
>
> ; <<>> DiG 9.4.2-P1 <<>> @ns1.scalr.net -t any api.cr.am
> ; (1 server found)
> ;; global options:  printcmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 10632
> ;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
> ;; WARNING: recursion requested but not available
>
> ;; QUESTION SECTION:
> ;api.cr.am.                     IN      ANY
>
> ;; AUTHORITY SECTION:
> cr.am.                  300     IN      SOA     ns1.scalr.net.
> admin.scalr.net. 2009032717 14400 7200 86400 300
>
> Thanks in advance!
>
>      Markus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"scalr-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/scalr-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to