In this quick tip I’ll show you how you can setup virtual hosts for Apache in Ubuntu.
The first thing that you need to do is clone the default Apache configuration. In the example below
myproject.dev is the virtual host name that you want to use.
Open the new configuration file and update the values for the
ServerName is the virtual host name and the
ServerAlias is the www version. The
DocumentRoot is the absolute path to the directory where your project is stored.
1 2 3 4 5 6 7
Next, enable the new virtual host configuration.
Lastly, add it to the hosts file.