0

Following the instructions in How to change Public DNS in amazon ec2, I could change public DNS in amazon ec2 (ubuntu image).

What I need to do is to add CName (alias) so that wiki.XYZ.com points to /var/www/html/wiki.

I use godaddy for DNS Zone file, so I added the name wiki, and check ping wiki.XYZ.com works fine.

enter image description here

I also modified the /etc/apache2/apache2.conf, and restarted apache server with service apache2 restart.

<VirtualHost *>
DocumentRoot "/var/www/html/wiki"
ServerName wiki.XYZ.com
# Other directives here                                                         
<Directory "/var/www/html/wiki">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride AuthConfig All
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

However, wiki.XYZ.com ends up in error (not page found) in my browser. What might be wrong?

Community
  • 1
  • 1
prosseek
  • 182,215
  • 215
  • 566
  • 871
  • Is there an index.html file in `/var/www/html/wiki`? Does the server behave differently if this new apache configuration is absent? (i.e., does it seem to be doing *anything* different)? – Michael - sqlbot Nov 03 '15 at 11:54
  • There is an index.html in the directory, and I have the same results without the added configuration. – prosseek Nov 03 '15 at 13:23
  • n.b. the http://example.com and http://example.org domains are set up for the purpose of masking real domain names with placeholders. The .com you appear to be using as a placeholder is a real domain, presumably owned by somebody else. – Michael - sqlbot Nov 03 '15 at 13:53

2 Answers2

0

You should point the Cname to a domain name listed in your A record. Be sure to read @michael in the comments below.

Roger Creasy
  • 1,419
  • 2
  • 19
  • 35
  • 1
    This isn't a DNS issue. Go Daddy's DNS admin tool allows `foo CNAME @` to mean `foo.example.com CNAME example.com`. (Also, note that CNAMEs can't "point to" IP addresses, only other names). This is a web server configuration issue. – Michael - sqlbot Nov 03 '15 at 11:49
  • 1
    @Michael-sqlbot you are correct about the Cname regarding IP addresses; I will edit my answer with your correction. – Roger Creasy Nov 03 '15 at 13:27
0

The issue was with my browser (Safari) that searches wiki.XYZ.com instead of visiting the site. I had to specify http://wiki.XYZ.com. I don't have this issue with Chrome.

Also, the configuration should be modified as follows:

<VirtualHost *:80> <-- specify the port
DocumentRoot "/var/www/html/wiki"
ServerName wiki.XYZ.com
# Other directives here                                                         
<Directory "/var/www/html/wiki">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride AuthConfig All
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>
prosseek
  • 182,215
  • 215
  • 566
  • 871