sim_tcr
Posts: 338
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
Contact: Website

Apache2 virtual directory creation question.

Thu Mar 21, 2013 4:41 pm

Hello,

I would like to deploy a different application code under Apache2 where already another site is running.
I would like to create a virtual directory with 'demo' as name physical path as /var/www/demo
So if i do http://<ip>/demo index.php in /var/www/demo should load.

Can anyone assist in creating a virtual directory with above requirements.

Thanks,
Simon Mandy
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Raspberry Pi 2 x 2, Transcend 32GB Class 10, Transcend 16GB Class 10, Transcend 8GB Class 4, Custom 12V 1.5A (stepped down to 5.5V)

User avatar
joan
Posts: 15001
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Apache2 virtual directory creation question.

Thu Mar 21, 2013 4:59 pm

sim_tcr wrote:Hello,

I would like to deploy a different application code under Apache2 where already another site is running.
I would like to create a virtual directory with 'demo' as name physical path as /var/www/demo
So if i do http://<ip>/demo index.php in /var/www/demo should load.

Can anyone assist in creating a virtual directory with above requirements.

Thanks,
Simon Mandy
Add a file /etc/apache2/conf.d called demo.conf (sudo nano /etc/apache2/conf.d/demo.conf) with contents

Code: Select all

# demo default Apache configuration

Alias /demo /var/www/demo

<Directory /var/www/demo>
	Options Indexes FollowSymLinks
	DirectoryIndex index.php
</Directory>
Restart apache (sudo /etc/init.d/apache2 restart).

sim_tcr
Posts: 338
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
Contact: Website

Re: Apache2 virtual directory creation question.

Thu Mar 21, 2013 5:08 pm

thank you.
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Raspberry Pi 2 x 2, Transcend 32GB Class 10, Transcend 16GB Class 10, Transcend 8GB Class 4, Custom 12V 1.5A (stepped down to 5.5V)

Return to “General discussion”