UbuntuJon Posted June 23, 2013 Share Posted June 23, 2013 Hi Just wanted some advice on the above. I'm trying to configure a cloud server (Ubuntu), and had a couple of questions. 1) My etc/hosts file, apache vhost and DNS all contain my domain name as domain.tld (without the www). In my vhost I have server name as domain.tld, and two server aliases set as www.domain.tld and *.domain.tld - I can reach my site with the URL "domain.tld", but not with "www.domain.tld". Does this mean I need two DNS records setup, one for "domain.tld" and one for "www.domain.tld"? Surely not? I thought that was the point of ServerAlias? 2) Am I supposed to add my domain name to my server's etc/hosts file? Or is that something I don't need to be doing? Thanks all Jon Quote Link to comment https://forums.phpfreaks.com/topic/279483-correct-setup-of-apache-etchosts-and-dns-on-ubuntu-server/ Share on other sites More sharing options...
kicken Posted June 23, 2013 Share Posted June 23, 2013 ServerAlias only means that apache will recognize that server name as also belonging to the given vhost. You still need a DNS entry so that clients can resolve that domain to the proper IP address. You can do this either with a separate A entry or a CNAME record. Adding the domain to the hosts file is not strictly necessary so long as it exists in DNS. Quote Link to comment https://forums.phpfreaks.com/topic/279483-correct-setup-of-apache-etchosts-and-dns-on-ubuntu-server/#findComment-1437524 Share on other sites More sharing options...
UbuntuJon Posted June 26, 2013 Author Share Posted June 26, 2013 Thanks for the reply, it helped me get it working. Quote Link to comment https://forums.phpfreaks.com/topic/279483-correct-setup-of-apache-etchosts-and-dns-on-ubuntu-server/#findComment-1437968 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.