Skip to content

Apache vhost config

Paolo Willy Nicorelli edited this page Apr 7, 2016 · 1 revision

In order to use vhost as a user you must enable apache userdir

sudo a2enmod userdir

then, suppose your username is fiend and your webify dir app is on /home/fiend/works/webify

add the virtualhost definition in /etc/apache2/sites-available/ as 025-webify.conf

## content of /etc/apache2/sites-available/025-webify.conf
<VirtualHost webify.local:80>
        ServerName webify.local

        ServerAdmin fiend@localhost
        DocumentRoot /home/fiend/public_html/webify/
        <Directory /home/fiend/public_html/webify>
                Require all granted
                AllowOverride All
        </Directory>
</VirtualHost>

enable the virtualhost

sudo a2ensite 025-webify.conf

add in you /etc/hosts the row:

127.0.0.1	webify.local

add the link on public_html

cd ~/public_html
ln -s /home/fiend/works/webify/build /home/fiend/public_html/webify

restart apache service with

sudo service apache2 reload

browse http://webify.local

Clone this wiki locally