(dv) 4.0:Fix missing 'www.' prefix
- This page was last modified on April 20, 2011, at 14:10.
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
- Click *Domains*
- Click *Control Panel* next to the domain you're trying to fix
- Click *Websites & Domains*
- Click DNS Settins
- Click *Manage* next to the domain you're trying to fix
- Click *Add Record*
- From the dropdown, select *CNAME*
- Enter *www* for *Domain Name*
- Enter your domain name ( eg. *domain.tld* ) under *Canonical Name*
- Click *OK* to save your changes
Configure DNS
- Log into your (dv) Dedicated-Virtual 4.0 via SSH as the *root* user
- Enter the following command, replace *domain.tld* with your actual domain name:
/usr/local/psa/admin/bin/httpdmng --reconfigure-domain domain.tld
- Wait a few moments for this process to complete.
Reconfigure your Virtual Host rules
That's it! You should be all set, the 'www' prefix for your domain should be functional once the *httpdmng* command completes.