Configure Apache Virtual Host

From Fabelier
Jump to: navigation, search

We assume you have a project on /~nameproject/www/name_of_my_project/ .

How To

Now you would like to make it accessible from the outside e.g. At name_of_your_project.fabelier.org , and thus to use virtual-host for that.

Configuration File

sudo vi /etc/apache2/sites-available/name_of_your_project

<VirtualHost *:8080>
    ServerName name_of_your_project.fabelier.org
    ServerAlias name_of_your_project.fabelier.org
    
    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>

    Alias my_project "/~nameproject/www/name_of_my_project/"

    <Directory "/~nameproject/www/name_of_my_project/">
        Options MultiViews
        AllowOverride None
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>

Restart apache

Then $> sudo service apache2 restart

Configure on your hosting provider the domain name and dns redirection if needed.

Enjoy your new virtual host!

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox