2

I would like to have two virtual hosts (2 projects) on single machine, and would like to have configuration that is independent of domain name this machine/IP is assigned to

For example I have

  • Domain name testDomainName.com and expecting it to be deployed to example.com or whatever.com,
  • 2 projects project1 and project2.

I'd like to configure project1.testDomainName.com and project2.testDomainName.com, and don't care if it'll change in the future to example.com or whatever.com.

In other words, how can I assign "project1" and "project2" as names, and have the apache automatically cocatenate/interpret it as project1.whatever.com, and project2.whatever.com

2
  • Could do something like this: httpd.apache.org/docs/current/vhosts/mass.html it's a bit of work but would work just fine for your needs. Or you could just have <VirtualHost> entries for both...
    – Nathan C
    May 8, 2014 at 12:21
  • Hey, thanks for the speed response, but my point is that I don't know what is the value of "example.com". What I want to know is can I, and how avoid using it. I assumed that using <VirtualHosts> is necessary
    – Konzulic
    May 8, 2014 at 12:50

1 Answer 1

1

Yes you can. What you're looking for is VirtualDocumentRoot directive.

1
  • Thanks @Marcel. This wasn't approach I expected, but it perfectly solves the issue. Thanks again.
    – Konzulic
    Sep 12, 2015 at 1:55

You must log in to answer this question.

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