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 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.

share|improve this question
    
Which web server are you using? –  LukeR Jun 24 '11 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 Jun 24 '11 at 9:38
    
The platform is lamp if that's what you are asking... besides that I don't really understant the question. –  zozo Jun 24 '11 at 9:38
    
Apache. Sorry for lack of info. –  zozo Jun 24 '11 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.

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.