Chris Beach
Chris Beach

Reputation: 4392

Apache - two vhost conf files for same ServerName?

I have a PHP web app served by Apache on a vhost.

I've just created an API in Scala, and would like to deploy Apache vhost config for it without touching the vhost config of the PHP web app.

The PHP app is at www.mydomain.com and the API will be served at www.mydomain.com/api (same domain/subdomain, allowing cookies to be shared)

I'm trying to treat the Apache config for each as separate concerns, although they both share the same ServerName.

Is it possible to get Apache to accept two .conf files that, combined, form the definition of a vhost for a domain?

Upvotes: 0

Views: 79

Answers (1)

E. Celis
E. Celis

Reputation: 727

You are looking for the Include directive which allows to include other files to achieve what you want.

One line like the next in your vhost blocks should work.

Include /etc/httpd/common_setings.conf

Upvotes: 2

Related Questions