(dv) 4.0:Fix missing 'www.' prefix

  • This page was last modified on April 20, 2011, at 14:10.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki

On rare occasions when adding a domain to Plesk, the 'www' prefix does not work as intended. This is caused by a missing rule in the /var/www/vhosts/domain.tld/conf/####_httpd.include. When there's a problem, the file starts with:

<VirtualHost 123.123.123.123:80>
ServerName "domain.tld:80"
...

However, the server also needs to be listening for the 'www' prefix. Instead, the file should look like:

<VirtualHost 123.123.123.123:80>
ServerName "domain.tld:80"
ServerAlias  "www.domain.tld"
...


Since we cannot modify the httpd.include file directly without being overwritten, instead we must tell Plesk to configure this ServerAlias. In previous versions of Plesk, this was as simple as clicking a checkbox. However in Plesk 10, Parallels has complexified this one simple process. Below you'll find instructions on how to correct this.

Instructions

    Configure DNS

  1. Click *Domains*
  2. Click *Control Panel* next to the domain you're trying to fix
  3. Click *Websites & Domains*
  4. Click DNS Settins
  5. Click *Manage* next to the domain you're trying to fix
  6. Click *Add Record*
  7. From the dropdown, select *CNAME*
  8. Enter *www* for *Domain Name*
  9. Enter your domain name ( eg. *domain.tld* ) under *Canonical Name*
  10. Click *OK* to save your changes


    Reconfigure your Virtual Host rules

  1. Log into your (dv) Dedicated-Virtual 4.0 via SSH as the *root* user
  2. Enter the following command, replace *domain.tld* with your actual domain name:
    /usr/local/psa/admin/bin/httpdmng --reconfigure-domain domain.tld
    
  3. Wait a few moments for this process to complete.

That's it! You should be all set, the 'www' prefix for your domain should be functional once the *httpdmng* command completes.