I need to create some subdomains for a domain but I can't use cpanel to do that. The server that I'm working on just doesn't have it so don't suggest anything related to cpanel as I've seen on most forums.

Can anyone help me with that? I have root access, anything I want. The O.S. is a CentOS 5.5.

  • Which web server are you using?
    – LukeR
    Commented Jun 24, 2011 at 9:37
  • 4
    Which software are you trying to configure? Apache? Bind? Postfix? You haven't provided enough information for anyone to help you.
    – Flimzy
    Commented Jun 24, 2011 at 9:38
  • The platform is lamp if that's what you are asking... besides that I don't really understant the question.
    – zozo
    Commented Jun 24, 2011 at 9:38
  • Apache. Sorry for lack of info.
    – zozo
    Commented Jun 24, 2011 at 9:40

1 Answer 1


Use a seperate file for each vhost and keep them in the same directory. See the documentation for the Include directive (which provides an example of doing exactly that).

How you generate the file is up to you - you might use a template and sed, or just generate the config directly by echo >>$yournewvhost is up to you. Note that the vhost file can itself have Includes - so if you've got different groups of sites where you want to enable different groups of functionality, then you don't need to explicitly state it in each vhost.

You must log in to answer this question.

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