cpanel httpd.conf file regeneration issue

Hoss

Active Member
Oct 15, 2002
25
0
151
I'm tired of constantly fighting this issue and have been unable to suss a solution just yet.
Everytime cpanel updates my httpd.conf file it adds the folllowing to the very bottom of the file..

<VirtualHost 66.xxx.xxx.133>
ServerName ben.mysite.com
DocumentRoot /usr/local/apache/htdocs
</VirtualHost>
The problem is that I have IP 66.xxx.xxx.133 set up in a virutalhost container above with it set to port 80
<VirtualHost 66.xxx.xxx.133:80>
And my DocumentRoot is NOT /usr/local/apache/htdocs
but IS instead /home/mysite/public_html

Which means everytime apache gets gracefully restarted after cpanel has changed the .conf file I get this error.

[Mon Feb 1 12:59:16 2010] [error] VirtualHost 66.xxx.xxx.133:0 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
There has to be a simple fix to this issue?


While I'm here I also have another small issue which is not of much consequence, but...
cpanel also always generates this entry

# WHM DOMAIN FORWARDING VHOST
<VirtualHost 66.xxx.xxx.134:80>
ServerName 66.xxx.xxx.134
ServerAdmin [email protected]
DocumentRoot /dev/null
ScriptAliasMatch .* /usr/local/cpanel/cgi-sys/domainredirect.cgi
</VirtualHost>
But of course DocumentRoot /dev/null
does not exist. So if you run a configtest it always protests about that entry. I don't believe it causes any harm, but...
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
While I'm here I also have another small issue which is not of much consequence, but...
cpanel also always generates this entry
Code:
# WHM DOMAIN FORWARDING VHOST
<VirtualHost 66.xxx.xxx.134:80>
    ServerName 66.xxx.xxx.134
    ServerAdmin [email protected]
    DocumentRoot /dev/null
    ScriptAliasMatch .* /usr/local/cpanel/cgi-sys/domainredirect.cgi
</VirtualHost>
But of course DocumentRoot /dev/null
does not exist. So if you run a configtest it always protests about that entry. I don't believe it causes any harm, but...
The WHM domain forwarding virtual host may be safely removed by disabling the feature using WHM via the following menu path:
WHM: Main >> DNS Functions >> Setup/Edit Domain Forwarding >> Click to remove domain forwarder
 

Hoss

Active Member
Oct 15, 2002
25
0
151
Thanks Don, do you have any idea what's generating the other entry?
And yes of course I've run the distiller. I'm not having any issues with my configuration not staying as I've set it. Just that the entry always gets added. This has been happening for a long time now.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Thanks Don, do you have any idea what's generating the other entry?
And yes of course I've run the distiller. I'm not having any issues with my configuration not staying as I've set it. Just that the entry always gets added. This has been happening for a long time now.
Without knowing the full context of the situation (as determined via direct access to the system) it is difficult to say with certainty; however, I would venture to believe it is simply the default virtual host and if that is the case it is normal to have the entry in the Apache configuration.
 

Hoss

Active Member
Oct 15, 2002
25
0
151
That would make sense as it's the base system IP (1st one)
Is there no simple way to resolve this? Or anyway at all, for that matter?
I am going to be upgrading servers soon, but currently running Apache 1.41 Virtual host containers are not my forte, but would a workaround be if Listen is set as
Listen 0.0.0.0:80
Above in the httpd.conf file (and it is)

Can I then remove the :80 option from the IP address's in <VirtualHost>

I've read that in Apache 2 this is how you must set it up.

A quick addition
No Domain Forwarder has been setup!
Is what I get in WHM: Main >> DNS Functions >> Setup/Edit Domain Forwarding
But as I recall it was set before to the 134 IP
So can I simply delete that entry > run distiller and make it safely go away?
 
Last edited:

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
That would make sense as it's the base system IP (1st one)
Is there no simple way to resolve this? Or anyway at all, for that matter?
I am going to be upgrading servers soon, but currently running Apache 1.41 Virtual host containers are not my forte, but would a workaround be if Listen is set as
Listen 0.0.0.0:80
Above in the httpd.conf file (and it is)

Can I then remove the :80 option from the IP address's in <VirtualHost>

I've read that in Apache 2 this is how you must set it up.
I would add the port in the single default virtual host directive rather than attempt to edit all other virtual hosts.

After applying changes, ensure to run the distiller, rebuild httpd.conf (as seen below), then restart Apache:
Code:
# /scripts/rebuildhttpdconf
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
A quick addition
Code:
No Domain Forwarder has been setup!
Is what I get in WHM: Main >> DNS Functions >> Setup/Edit Domain Forwarding
But as I recall it was set before to the 134 IP
So can I simply delete that entry > run distiller and make it safely go away?
I would simply toggle the option in WHM, (enable then disable), then, as a precaution, rebuild httpd.conf using the aforementioned command via SSH