How do I create a virtual host / subdomain?

1) Where is the virtual hosts file located? And what should I write to it?
2) How are virtual hosts related to subdomains in the control panel?

My server is Apache2, on CentOS

1 Reply

First off, here's a section of our guides that shows you how to configure your Apache virtual hosts:

Apache Virtual Hosts

I'm assuming that by 'Control Panel' that you're working with cPanel? If not, please let me know. For cPanel, there's a doc on their site which might be a good resource:

cPanel Subdomains

I hope this helps you out!


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct