2

I am trying to have multiple websites hosted on one server, but do not know for sure if I should create the Virtual Hosts for each website contained in one file or have each of them in their own separate files.

All help is appreciated.

1

This is really personal preference. There are pros and cons to each. By putting them all in one file you have one place to look for configuration information. BY putting them in separate files, with names based on the domain, it is easy to do an ls (assuming UNIX/Linus) and see the domains that are hosted on the server.

1
  • A single VirtualHost might apply to several domains, so you would need to consider that scenario when thinking of a multi-file naming convention. If a VirtualHost is very large - lots of config - then it might be beneficial to have a separate file. – MrWhite Dec 23 '16 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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