John Cox

Blogs · @wyome

Tagged dns · everything

How To Set Up Apache Virtual Hosts on Ubuntu 16.04

This tutorial by [[Brennen Bearnes]] explains how to configure name-based virtual hosting with the [[Apache]] web server on [[Ubuntu 16.04]], enabling a single server to serve multiple domains such as [[example.com]] and [[test.com]]. It walks through creating site directory structures under [[/var/www]], setting ownership and permissions, adding simple demo index.html pages, and creating per-site configuration files by copying and customizing [[000-default.conf]] in [[/etc/apache2/sites-available]]. The guide covers enabling sites with [[a2ensite]] and disabling the default host, restarting [[apache2]], and optionally editing the local [[/etc/hosts]] file to test domains locally. Also included are troubleshooting tips and explanations of ServerName, ServerAlias, DocumentRoot, and log directives so administrators can expand the setup to host additional domains on one VPS. It emphasizes proper permissions, ownership, and testing, and recommends registering real domains and configuring DNS when moving to production.

Permalink