Apache conf setup to serve subdomain site alongside OwnCloud deploy

webserver_issue

#1

I have cross-posted this issue to StackOverflow (since it is more of an apache issue than owncloud issue):

Steps to reproduce

I have deployed OwnCloud 8 on a Ubuntu 14.04 instance to the domain box.example.com. I would like to host some static html on the same VM and have apache point project.example.com to it at /var/www/html.

In apache the file /etc/apache2/conf-available/owncloud.conf was created by OwnCloud containing:

#I changed the first line as follows
##Alias /owncloud "/var/www/owncloud/" # commented out
Alias / "/var/www/owncloud/"
<Directory "/var/www/owncloud">
    Options +FollowSymLinks
    AllowOverride All

    <IfModule mod_dav.c>
      Dav off
    </IfModule>

    SetEnv HOME /var/www/owncloud
    SetEnv HTTP_HOME /var/www/owncloud
</Directory>

How can I add a new subdomain VM in apache so that I'll have two working sites: box.example.com and project.example.com. So far with everything I have tried project loads the OwnCloud front-end and does not open the static html.

Do I need to touch /etc/hosts?

Expected behaviour
box.example.com loads my OwnCloud 8 front-end.
project.example.com loads static html at /var/www/html/index.html

Actual behaviour
box.example.com loads my OwnCloud 8 front-end.
project.example.com loads OwnCloud 8 front-end.

Server configuration
Operating system: Ubuntu 14.04
Web server: Apache
Database: MySQL
PHP version: PHP 5.6.21-1+donate.sury.org~trusty+4 (cli)
ownCloud version (see ownCloud admin page): 8.1.9 (stable)
Updated from an older ownCloud or fresh install: fresh install


Help properly setting up subdomain (cloud.domain.com)
#2

Please keep this in the Miscellaneous category as this is a webserver issue which doesn't belong into the oC server category. For this reason i would also suggest to wait for an answer on stackoverflow as you already have cross-posted there.

Other resources are for example communities like http://www.apachelounge.com/