Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

<VirtualHost ...>
   ...
   Include /etc/apache2/vhost-globals.conf
</VirutualHost>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.