0

I'm trying to serve two projects, separately, from a shared directory on an Ubuntu server via Apache. The directory of the whole kit and kaboodle looks something like:

/project
  /api
  /app

Now, I'd like to have this all fit inside one VHost directive, where api.domain.com serves the project out of /project/api whereas *.domain.com serves out of a directory inside /app (it may wind up being public or webroot).

This might be a bit ambitious (or foolish, or not possible) to do this inside one VHost directive, but I'm interested in seeing how people would go about doing something like this. Maybe I just need to split it up. My reasoning for wanting to combine is that there will be shared Apache directives between the two, the only thing that will really differ will be the DocumentRoot. I'd rather not duplicate those settings inside two VHosts, if possible.

1 Answer 1

1

You need to have separate VirtualHost directives. You can include an external file e.g.

<VirtualHost ...>
   ...
   Include /etc/apache2/vhost-globals.conf
</VirutualHost>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .