ServerAlias has lost www on all domains after upgrade

anton_latvia

Well-Known Member
PartnerNOC
May 11, 2004
432
47
178
Latvia
cPanel Access Level
Root Administrator
We had server which was not updated for some time (but it already was cpanel11). Now we decided to upgrade whm and apache/php. Everything worked fine with update, but then suddenly all clients (more than 1000) started to complain, that their website stopped working.
In apache's config there was the following situation:

ServerName domain.com
ServerAlias domain.com

No www.! Of course we easily searched and replaced with www, but guys... That's the thing we've been worried before the upgrade - something will be screwed.. And that happened. I have executed distiller to save changes, I hope www. will stay where it is, but may be someone could look into this issue to fix it? By the way, WHM had been upgraded to the latest currnet version.
WHM 11.15.0 cPanel 11.18.0-C20595

Regards,
Anton.
 

handsonhosting

Well-Known Member
Feb 17, 2002
151
0
316
Omaha, NE
cPanel Access Level
Root Administrator
Just to comment,

We ran an upgrade on one of our serves also, and the ServerAlias tags no longer function :(

I've tried the rebuildhttpdconf command - no luck.

We were on the CURRENT build also - I'm now upgrading to EDGE to see if there's any difference.

how did you get around the issue if the ServerAlias has multiple domains on it? So far, if it has more than one it's not resolving at all (from what I've tried here).
 

BenThomas

Well-Known Member
Feb 12, 2004
598
0
166
Houston, Texas USA
cPanel Access Level
Root Administrator
You can resolve this issue by running the following commands:

/usr/local/cpanel/bin/userdata_update (This restores the missing alias in the userdata and merges it with your existing data)
/scripts/rebuildhttpdconf (This builds the httpd.conf against the merged userdata )

We're still investigating how this could happen. I've only been able to reproduce the issue by manually removing the www.domain server alias from the userdata and rebuilding the httpd.conf immediately afterwards. This can also be reproduced by manually removing the www.domain server alias from httpd.conf and running "/usr/local/cpanel/bin/apache_conf_distiller --update" to update the userdata with the missing server alias. There's no code that I can think of that would remove the server alias from either point (only code to ensure that it is there).
 

BenThomas

Well-Known Member
Feb 12, 2004
598
0
166
Houston, Texas USA
cPanel Access Level
Root Administrator
I'll be looking over the ticket now and will report back any findings. Additional tickets regarding this issue would be appreciated, just make the subject:

ATTN: cpanelben Missing www serveralias

So that it will be sent to me. Please submit a ticket even if you were able to quickly resolve the issue.
 

oulzac

Well-Known Member
Aug 7, 2005
131
0
166
I also have this issue, but can not open a ticket directly as I rent the server.
the fix listed in this ticket did not work for me.
 

BenThomas

Well-Known Member
Feb 12, 2004
598
0
166
Houston, Texas USA
cPanel Access Level
Root Administrator
I should mention after running userdata_update and rebuildhttpdconf, you need to restart Apache in order for your changes to take effect.

I've determined that the issue was related to how ServerName and ServerAlias were implemented in older builds and have updated our code to address the issue.

This change will be available in builds with and ID of 20607+.
 

oshs

Well-Known Member
PartnerNOC
Sep 5, 2004
146
0
166
Hi all,

Had this problem on all servers which just had SuPHP implemented, and had to run the scripts you mentioned.

However upon doing so, this "no 'main_domain' key" error is being thrown up shown below - what does this indicate?

Regards,
Suhail.


root@server12 [~]# /usr/local/cpanel/bin/userdata_update
root@server12 [~]# /scripts/rebuildhttpdconf
[Cpanel::AdvConfig::apache]: User 'webaudio' data set has no 'main_domain' key.
[Cpanel::AdvConfig::apache]: User 'keywordr' data set has no 'main_domain' key.
[Cpanel::AdvConfig::apache]: User 'animeser' data set has no 'main_domain' key.
[Cpanel::AdvConfig::apache]: User 'searchen' data set has no 'main_domain' key.
[Cpanel::AdvConfig::apache]: User 'paypercl' data set has no 'main_domain' key.
[Cpanel::AdvConfig::apache]: User 'russellc' data set has no 'main_domain' key.
[Cpanel::AdvConfig::apache]: User 'linkbuil' data set has no 'main_domain' key.
[Cpanel::AdvConfig::apache]: User 'ebidtra' data set has no 'main_domain' key.
[Cpanel::AdvConfig::apache]: User 'experien' data set has no 'main_domain' key.
Succeeded
 

Rubas

Well-Known Member
Sep 15, 2003
125
0
166
This change will be available in builds with and ID of 20607+.
What does this mean for an updated system where this www are removed from /var/cpanel/userdata/username but the httpd.conf actually is okay?

I updated a system from cPanel 11.15.0-R18373 to cPanel 11.18.0-R20595 ..
 
Last edited:

BenThomas

Well-Known Member
Feb 12, 2004
598
0
166
Houston, Texas USA
cPanel Access Level
Root Administrator
[Cpanel::AdvConfig::apache]: User 'webaudio' data set has no 'main_domain' key.
This occurs when the primary domain is not set in the /var/cpanel/users/username file. It's the entry for "DNS=userdomain.com". It's important for various parts of cPanel for this domain to be set. Correct the entry in /var/cpanel/users/username file and re-run /usr/local/cpanel/bin/userdata_update to resolve the issue.
 

BenThomas

Well-Known Member
Feb 12, 2004
598
0
166
Houston, Texas USA
cPanel Access Level
Root Administrator
What does this mean for an updated system where this www are removed from /var/cpanel/userdata/username but the httpd.conf actually is okay?
In builds less than 20607, it will mean that the "www" ServerAlias entry for the domain may be missing (in some circumstances). We're pushing out the changes from 20607 this week to all trees.
 

Rubas

Well-Known Member
Sep 15, 2003
125
0
166
Atm the entries are missing in the userdata but not in the httpd.conf (over 1000 accounts on this server) .. will an update to 20607 fix the problem if the entries are already deleted?
 
Last edited:

Rubas

Well-Known Member
Sep 15, 2003
125
0
166
Atm the entries are missing in the userdata but not in the httpd.conf (over 1000 accounts on this server) .. will an update to 20607 fix the problem if the entries are already deleted?
I tried this and it looks liked it worked to fix the userdata ...
/usr/local/cpanel/bin/userdata_update (This restores the missing alias in the userdata and merges it with your existing data)
 

nariman

Registered
Mar 4, 2007
2
0
151
I have been having a problem accessing www on my domain since the update that rolled out on Friday the 8th. I have since updated to the lastes edge update and still no fix. I have rebuilt my httpd.conf file a number of times and restarted apache.

The weird thing is that it seems to go in an out. It will work for a couple of minutes and then die again for a while.

Any help is much appreciated.