Subdomain alias on Plesk 9/Ubuntu

Subdomain alias on Plesk 9/Ubuntu

Plesk on Ubuntu is just a little bit different than Plesk on most other Linux platforms. There is plenty of information on how to do subdomain aliasses on Plesk, but to get it working on Ubuntu you need a bit more effort. So… here’s how to do it;

  1. Make a subdomain like normal using Plesk (I use version 9.2.3, but should be the same atleast for all Plesk 9’s).
  2. Log in to SSH or FTP as root user (you can’t do this through the panel; shame on you, Parallels!).
  3. Make a “vhost.conf” in the /conf directory in your subdomain. For subdomain “test.example.com” (assuming the domain is example.com) this would be “/var/www/vhosts/example.com/subdomains/test/conf” and the file would be “/var/www/vhosts/example.com/subdomains/test/conf/vhost.conf“. The vhost.conf file is an empty, plain text file.
  4. Edit vhost.conf and insert a line for each alias. For example, alias “alias.example.com” would require the following line in vhost.conf:
    ServerAlias alias.example.com

    1. If you use SSL, you must make (copy) an identical file named “vhost_ssl.conf” in the same directory.
  5. Log in to SSH.
  6. Enter the following command in the terminal (obviously replacing the marked parts):
    /usr/local/psa/admin/sbin/websrvmng -u –vhost-name=example.com

    1. If you want to reconfigure all (sub)domains at once, you can use:
      /usr/local/psa/admin/sbin/websrvmng -a
  7. Restart the server through the Plesk panel.
That should be it. The change will survive server reboots and such.