I installed a LAMP server and set up my domain name to resolve to an appropriate IP address. However, when I connect to a server with it's domain name, it is with an IP address in an address bar. My /etc/apache2/sites-available/default looks like this:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin ...
ServerName mydomainname.irrelevant.to.the.question
DocumentRoot /var/www
...
I thought that was supposed to fix this behaviour. What else is required?
It's likely your PHP application.
Apache won't bother with this kind of redirection without being specifically told to with a
Redirect
orRewriteRule
doing it (it doesn't "enforce" matching of theServerName
in any way), but a lot of web applications out there in the world like for the requested hostname to match what they're internally configured with.