WordPress MU Subdomains on Plesk
July 10th, 2008
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
I’ve been setting up WordPress MU on a Plesk server and I have to tell you that getting the subdomains (e.g. blog2.domain.com) to work was driving me crazy. It took a combination of multiple sites before I got it working, so I wanted to post what I did here hoping that it might help someone else.
First and foremost, you need to create the vhost.conf file for the domain itself. The vhost.conf and vhost_ssl.conf file needs to be created in the conf directory of the domain. On Plesk it should be similar to: /var/www/vhosts/domain.com/conf/vhost.conf.
You can create the file from within the Plesk panel itself or using an SSH client like Putty (my preference).
Within the vhost.conf file you need to include the following line:
ServerAlias *.domain.com
Replacing “domain.com” with your domain.
Once you’ve done that you’ll need to run the following from your SSH client (there’s other ways to do this but this worked fine for me):
/usr/local/psa/admin/sbin/websrvmng –reconfigure-vhost –vhost-name=domain.com
Then restart apache and go try it out. Guess what? It’s supposed to work but it still doesn’t!
This is where the final magical step comes in. Log in to your Plesk panel, go to domains, and select the domain that you are trying to set this up on. Once the page loads, select DNS Settings.
From there, click the Add Record button from the top.
The Record Type should be CNAME. In the “Enter domain name” field enter a *. Then in the canonical name field enter your domain (without a www, just a plain domain.com).
Click Ok to save the record and try again. You should now see your WordPress MU Subdomains on Plesk working!
