Plesk subdomain accessible with www

Solution – follow the following steps to make your subdomain accessible with www

1. Add one line to the special configuration file for the subdomain.

Normally this file is located in

/var/www/vhosts/domain/subdomains/subdomain/conf/vhost.conf .
Create the file, if there is no file yet. Add the following line, save it and exit the editor.
ServerAlias www.subdomain.domain.com

What does ServerAlias www.subdomain.domain.com mean?

This is a Apache configuation that says that Apache will also serve the subdomain if you access it with www. This is normally used for the domain name, but also working for sub-domains.

2. (optional – maybe necessary in Plesk 7/7.5, but works without in Plesk 8)

1. Add a A record type in the DNS zone of the domain for the subdomain starting with www. Select the following menu entries.

2.Server => Domains => domain.com => DNS

3. There you’ll see a list of DNS entries for the domain. Check the IP address for the subdomain entry – copy to clipboard or write it down, if you don’t know it

4. Now you create a new entry with the button Add new entry  – use the following value

  • Record type: A
  • Domain name: www.subdomain (Plesk 8)
  • IP address: enter the IP address that you copied in step 2.2, e.g. 111.111.111.111

Press OK to add the new entry to the DNS.

5 .Check if there is a new entry wit the following value:
www.subdomain.domain.com A 111.1111.111.111

3. Recreate the Plesk / Apache configuration for the whole domain
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com

4. Restart Apache to read the new configuration and serve pages with www.subdomain.domain.com

service httpd restart

:)

Leave a Reply

You must be logged in to post a comment.