The following steps will allow you to offer "unlimited subdomains" for your clients on a Plesk system. Once you've completed these steps, the client can create a new subdomain by creating a new folder in the httpdocs or httpsdocs folder -- in other words, /usr/local/psa/home/vhosts/domain.com/httpdocs/newsub will be available via http://newsub.domain.com/. The usual http://www.domain.com/ , http://www.domain.com/webstat/ and (if applicable) https://www.domain.com/ URLs will continue to work, as well.
So here are the steps:
1. Add the VirtualDocumentRoot directive from mod_vhost_alias to your httpd.conf file; this setting will apply to all domains on your server.
Edit /usr/local/psa/apache/conf/httpd.conf and at the end of the file, add this line:
CODE
VirtualDocumentRoot /usr/local/psa/home/vhosts/%2+/httpdocs/%1
2. Add a wildcard subdomain record in the default DNS settings; this record will be added to each new domain you add (existing domains will need to have this added manually).
Log in to PSA as the Administrator, and click the Server button at the top. Then, click the DNS button to show the default DNS settings. Add a new A record here with
CODE
domain name: [b]*[/b].<domain>.
IP address: [b]<ip>[/b]
(Bold portions are to be added; unbolded text is already displayed on the form when added the record.)
IP address: [b]<ip>[/b]
3. Create a symbolic link for the www "subdomain", since the VirtualDocumentRoot directive will translate www.domain.com to ~domain/httpdocs/www. We'll make the change in the .skel directory, so it will apply to all new physical hosting accounts that will be added (existing clients will have to manually add the link and then change the owner of the link to the appropriate user to match the owner of the httpdocs directory).
Log in to your server and change user to root. Then execute the following commands:
CODE
cd /usr/local/psa/home/vhosts/.skel/httpdocs
ln -s . www
cd ../httpsdocs
ln -s . www
ln -s . www
cd ../httpsdocs
ln -s . www
That's it!
This has some drawbacks (like the inability to control the number of subdomains allowed), but it's an easy way to offer subdomains to your clients on the Plesk server without using up additional domains in the 200-domain Plesk license.
Are there any serious side effects that I'm missing??