How to change ServerName in apache server?
<p>I downloaded Apache binary from <a href="http://www.apachelounge.com/" rel="nofollow noreferrer">http://www.apachelounge.com/</a> After installing, in the <code>httpd.conf</code> file on line 220, I changed <code>#ServerName www.example.com:80</code> to <code>ServerName www.example.com:80</code>. Now everything works fine. The server users the domain name <code>localhost</code>. Also <code>localhost:80</code> automatically redirects to <code>localhost</code>.</p>
<blockquote>
<p>Since <code>ServerName</code> is <code>www.example.com:80</code> then why does the server work on <code>localhost</code> instead of <code>www.example.com:80</code>?</p>
<p>If I change every instance of <code>www.example.com:80</code> to <code>mylocalserver:80</code> then why doesn't the apache server work on <code>mylocalserver:80</code>?</p>
</blockquote>