Wanting to run multiple sites with subdomains

January 26, 2013 5.2k views
We have our Wordpress site running fine, but (as per the tutorial) its installed in /var/www/ say i wanted to have another site on the same server with a subdomain, how would get that set-up? this is mainly for future referance, in case it might be important to change something now should that time come.
4 Answers
You would add a subdomain in to your DNS through our Domains manager and then create another virtual host entry in your Apache config or nginx config (server name) and then provide it with a separate document root.
Option 2, enable multisite function (according wordpress official docs -http://codex.wordpress.org/Configuring_Wildcard_Subdomains) :

Apache - In the httpd.conf file, or in the include file containing the VirtualHost section for your web account, add a line like this:

ServerAlias *.example.com

Also create a wildcard DNS record like:

*.mysite.com A

Important note: You will need to add this line of code to your wp-config.php to enable multisite function :

define('WP_ALLOW_MULTISITE', true);
i see, thanks for the help, so i don't need to modify anything with my file structure?

With previous hosting i'm used to bending to all these rules, the amount of freedom here is amazing :D
It's really up to you and just depends on how you want to do it.

It's your own server where you manage the configs so it's whatever you find the most comfortable. =]
Have another answer? Share your knowledge.