How to enable virtual hosting with Apache.

I don’t monkey with the Apache configuration file enough to keep this information accessible in my brain. Here are some personal notes.

I set up a new LAMP server yesterday. Today I added some name-based virtual hosts to the configuration file, but was getting the following warning when restarting Apache:

[warn] _default_ VirtualHost overlap on port 80, the first has precedence

This warning was being triggered because I had not told Apache to use name-based virtual hosting. To enable name-based virtual hosting, locate and uncomment the NameVirtualHost directive in the Apache configuration file.

The Apache documentation site has information about setting up name-based virtual hosts. You can also find the details for the NameVirtualHost directive.

This entry was posted in SysAdmin and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">