Nurs1927

Well-Known Member
Nov 22, 2015
93
7
58
Spain
cPanel Access Level
Root Administrator
Hello, when I used
/scripts/rebuildhttpdconf
I have this error:
Code:
info [rebuildhttpdconf] Missing IP for domain centos-66-64-cpanel.localdomain, using my IP

info [rebuildhttpdconf] Missing ServerName for domain centos-66-64-cpanel.localdomain, using centos-66-64-cpanel.localdomain

info [rebuildhttpdconf] Missing port for domain centos-66-64-cpanel.localdomain, using 80

info [rebuildhttpdconf] Missing user for domain centos-66-64-cpanel.localdomain, using nobody

info [rebuildhttpdconf] Missing owner for domain centos-66-64-cpanel.localdomain, force lookup to root

info [rebuildhttpdconf] Missing group for domain centos-66-64-cpanel.localdomain, using nobody

info [rebuildhttpdconf] 'local' template in use (/var/cpanel/templates/apache2_2/main.local)

Built /usr/local/apache/conf/httpd.conf OK
Attempt to correct the error according to this source:
Fix for "Missing owner for domain X, force lookup to root" - The cPanel Admin

But in
[/var/cpanel/userdata/nobody] I only have
Code:
my IP  myIP.cache  main  main.cache
I don´t have my hostname in [/var/cpanel/userdata/nobody]
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Hello :)

The messages you see should not cause any problems, and likely stems from cached data after you changed the hostname of your server. What custom entries are you using in the /var/cpanel/templates/apache2_2/main.local file?

Thank you.
 

Nurs1927

Well-Known Member
Nov 22, 2015
93
7
58
Spain
cPanel Access Level
Root Administrator
I think that I don´t use custom entries in /var/cpanel/templates/apache2_2/main.local

This is my mail.local file.

Code:
 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#   Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the       #
#   configuration file. To have modifications retained, all modifications must be checked into the              #
#   configuration system by running:                                                                            #
#       /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
#   To see if your changes will be conserved, regenerate the Apache configuration file by running:              #
#       /usr/local/cpanel/bin/build_apache_conf                                                                 #
#   and check the configuration file for your alterations. If your changes have been ignored, then they will    #
#   need to be added directly to their respective template files.                                               #
#                                                                                                               #
#   It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf       #
#   For detailed instructions on using Include files and the apache_conf_distiller with the new configuration   #
#   system refer to the documentation at: http://go.cpanel.net/customdirectives                                 #
#                                                                                                               #
#   This configuration file was built from the following templates:                                             #
#     /var/cpanel/templates/apache2/main.default                                                                #
#     /var/cpanel/templates/apache2/main.local                                                                  #
#     /var/cpanel/templates/apache2/vhost.default                                                               #
#     /var/cpanel/templates/apache2/vhost.local                                                                 #
#     /var/cpanel/templates/apache2/ssl_vhost.default                                                           #
#     /var/cpanel/templates/apache2/ssl_vhost.local                                                             #
#                                                                                                               #
#  Templates with the '.local' extension will be preferred over templates with the '.default' extension.        #
#  The only template updated by the apache_conf_distiller is main.default.                                      #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


[% IF file_test('f', '/usr/local/apache/conf/includes/pre_main_global.conf') -%]
Include "/usr/local/apache/conf/includes/pre_main_global.conf"
[% END -%]
[% IF file_test('f', '/usr/local/apache/conf/includes/pre_main_2.conf') -%]
Include "/usr/local/apache/conf/includes/pre_main_2.conf"

[% END -%]


[% FOREACH dir IN main.loadmodule.items -%]
LoadModule [% dir.module %] [% dir.filename %]
[% END -%]




[% FOREACH dir IN main.include.items -%]
Include [% dir.include %]
[% END -%]


ErrorLog [% main.errorlog.item.errorlog %]
DefaultType [% main.defaulttype.item.defaulttype %]
[% FOREACH dir IN main.scriptaliasmatch.items -%]
ScriptAliasMatch [% dir.regex %] [% dir.path %]
[% END -%]

RewriteEngine [% main.rewriteengine.item.rewriteengine %]
[% FOREACH dir IN main.addtype.items -%]
AddType [% dir.mime %] [% dir.extension %]
[% END -%]

[% FOREACH dir IN main.alias.items -%]
Alias [% dir.url %] [% dir.path %]
[% END -%]


[% FOREACH dir IN main.scriptalias.items -%]
ScriptAlias [% dir.url %] [% dir.path %]
[% END -%]


<Directory "[% main.maindirectory.item.directory %]">
    Options [% main.directory.options.item.options %]
    AllowOverride [% main.directory.allowoverride.item.allowoverride %]
</Directory>

<Directory "[% main.maindirectoryusrlocalapachehtdocs.item.directory %]">
    Options [% main.directoryusrlocalapachehtdocs.options.item.options %]
    AllowOverride [% main.directoryusrlocalapachehtdocs.allowoverride.item.allowoverride %]
    Order [% main.directoryusrlocalapachehtdocs.order.item.order %]
[% FOREACH dir IN main.directoryusrlocalapachehtdocs.allow.items -%]
    Allow from [% dir.allow %]
[% END -%]

</Directory>

<Files [% main.mainfileserrorlog.item.files %]>
    Order [% main.fileserrorlog.order.item.order %]
[% FOREACH dir IN main.fileserrorlog.deny.items -%]
    Deny from [% dir.deny %]
[% END -%]

    Satisfy [% main.fileserrorlog.satisfy.item.satisfy %]
</Files>

<FilesMatch [% main.mainfilesmatchht.item.filesmatch %]>
    Order [% main.filesmatchht.order.item.order %]
[% FOREACH dir IN main.filesmatchht.deny.items -%]
    Deny from [% dir.deny %]
[% END -%]

    Satisfy [% main.filesmatchht.satisfy.item.satisfy %]
</FilesMatch>

<IfModule [% main.mainifmodulelogconfigmodule.item.ifmodule %]>
[% FOREACH dir IN main.ifmodulelogconfigmodule.logformat.items -%]
    LogFormat [% dir.logformat %]
[% END -%]

[% FOREACH dir IN main.ifmodulelogconfigmodule.customlog.items -%]
    CustomLog [% dir.target %] [% dir.format %]
[% END -%]

    <IfModule [% main.mainifmodulelogconfigmoduleifmodulelogiomodule.item.ifmodule %]>
[% FOREACH dir IN main.ifmodulelogconfigmodule.ifmodulelogiomodule.logformat.items -%]
        LogFormat [% dir.logformat %]
[% END -%]

    </IfModule>

</IfModule>

<IfModule [% main.mainifmodulealiasmodule.item.ifmodule %]>
[% FOREACH dir IN main.ifmodulealiasmodule.scriptalias.items -%]
    ScriptAlias [% dir.url %] [% dir.path %]
[% END -%]

</IfModule>

<Directory "[% main.maindirectoryusrlocalapachecgibin.item.directory %]">
    AllowOverride [% main.directoryusrlocalapachecgibin.allowoverride.item.allowoverride %]
    Options [% main.directoryusrlocalapachecgibin.options.item.options %]
    Order [% main.directoryusrlocalapachecgibin.order.item.order %]
[% FOREACH dir IN main.directoryusrlocalapachecgibin.allow.items -%]
    Allow from [% dir.allow %]
[% END -%]

</Directory>

<IfModule [% main.mainifmodulemodlogconfigc.item.ifmodule %]>
[% FOREACH dir IN main.ifmodulemodlogconfigc.logformat.items -%]
    LogFormat [% dir.logformat %]
[% END -%]

[% FOREACH dir IN main.ifmodulemodlogconfigc.customlog.items -%]
    CustomLog [% dir.target %] [% dir.format %]
[% END -%]

</IfModule>

<IfModule [% main.mainifmodulemimemodule.item.ifmodule %]>
    TypesConfig [% main.ifmodulemimemodule.typesconfig.item.typesconfig %]
[% FOREACH dir IN main.ifmodulemimemodule.addtype.items -%]
    AddType [% dir.mime %] [% dir.extension %]
[% END -%]

</IfModule>

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#   Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the       #
#   configuration file. To have modifications retained, all modifications must be checked into the              #
#   configuration system by running:                                                                            #
#       /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
#   To see if your changes will be conserved, regenerate the Apache configuration file by running:              #
#       /usr/local/cpanel/bin/build_apache_conf                                                                 #
#   and check the configuration file for your alterations. If your changes have been ignored, then they will    #
#   need to be added directly to their respective template files.                                               #
#                                                                                                               #
#   It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf       #
#   For detailed instructions on using Include files and the apache_conf_distiller with the new configuration   #
#   system refer to the documentation at: http://go.cpanel.net/customdirectives                                 #
#                                                                                                               #
#   This configuration file was built from the following templates:                                             #
#     /var/cpanel/templates/apache2/main.default                                                                #
#     /var/cpanel/templates/apache2/main.local                                                                  #
#     /var/cpanel/templates/apache2/vhost.default                                                               #
#     /var/cpanel/templates/apache2/vhost.local                                                                 #
#     /var/cpanel/templates/apache2/ssl_vhost.default                                                           #
#     /var/cpanel/templates/apache2/ssl_vhost.local                                                             #
#                                                                                                               #
#  Templates with the '.local' extension will be preferred over templates with the '.default' extension.        #
#  The only template updated by the apache_conf_distiller is main.default.                                      #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


PidFile [% main.pidfile.item.pidfile %]
LockFile [% main.lockfile.item.lockfile %]
[% IF configured.ip_listen -%]
[%- FOREACH ip IN configured.ip_listen -%]
Listen [% ip %]:[% configured.main_port %]
[% END -%]
[% ELSE -%]
# Defined in /var/cpanel/cpanel.config: apache_port
Listen [% main.listen.item.listen %]
[% END -%]
User [% main.user.item.user %]
Group [% main.group.item.group %]
ExtendedStatus [% main.extendedstatus.item.extendedstatus %]
ServerAdmin [% main.serveradmin.item.serveradmin %]
ServerName [% wildcard_safe(main.servername.item.servername) %]
LogLevel [% main.loglevel.item.loglevel %]

# These can be set in WHM under 'Apache Global Configuration'
[% IF main.timeout.item.timeout.length %]Timeout [% main.timeout.item.timeout %][% END %]
[% IF main.traceenable.item.traceenable.length %]TraceEnable [% main.traceenable.item.traceenable %][% END %]
[% IF main.serversignature.item.serversignature.length %]ServerSignature [% main.serversignature.item.serversignature %][% END %]
[% IF main.servertokens.item.servertokens.length %]ServerTokens [% main.servertokens.item.servertokens %][% END %]
[% IF main.fileetag.item.fileetag.length %]FileETag [% main.fileetag.item.fileetag %][% END %]
[% IF main.startservers.item.startservers.length %]StartServers [% main.startservers.item.startservers %][% END %]
<IfModule prefork.c>
[% IF main.minspareservers.item.minspareservers.length %]MinSpareServers [% main.minspareservers.item.minspareservers %][% END %]
[% IF main.maxspareservers.item.maxspareservers.length %]MaxSpareServers [% main.maxspareservers.item.maxspareservers %][% END %]
</IfModule>
<IfModule itk.c>
[% IF main.minspareservers.item.minspareservers.length %]MinSpareServers [% main.minspareservers.item.minspareservers %][% END %]
[% IF main.maxspareservers.item.maxspareservers.length %]MaxSpareServers [% main.maxspareservers.item.maxspareservers %][% END %]
</IfModule>
[% IF main.serverlimit.item.serverlimit.length %]ServerLimit [% main.serverlimit.item.serverlimit %][% END %]
[% IF main.maxclients.item.maxclients.length %]MaxClients [% main.maxclients.item.maxclients %][% END %]
[% IF main.maxrequestsperchild.item.maxrequestsperchild.length %]MaxRequestsPerChild [% main.maxrequestsperchild.item.maxrequestsperchild %][% END %]
[% IF main.keepalive.item.keepalive.length %]KeepAlive [% main.keepalive.item.keepalive %][% END %]
[% IF main.keepalivetimeout.item.keepalivetimeout.length %]KeepAliveTimeout [% main.keepalivetimeout.item.keepalivetimeout %][% END %]
[% IF main.maxkeepaliverequests.item.exists('maxkeepaliverequests') %]MaxKeepAliveRequests [% main.maxkeepaliverequests.item.maxkeepaliverequests || 0 %][% END %]

[% IF file_test('f', '/usr/local/cpanel/bin/leechprotect') -%]
RewriteEngine on
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
RewriteLock [% paths.dir_run %]/rewrite_lock
[% END -%]

[% IF supported.mod_userdir -%]
# Set UserDir directory for all virtual hosts, except..
UserDir public_html
# when the following two modules are loaded
<IfModule mod_ruid2.c>
UserDir disabled
</IfModule>
<IfModule itk.c>
UserDir disabled
</IfModule>
[% END -%]

[% IF supported.mod_dir -%]
# DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority
DirectoryIndex [% main.directoryindex.item.directoryindex %]
[% END -%]

[% IF supported.mod_ssl -%]
# SSLCipherSuite can be set in WHM under 'Apache Global Configuration'
SSLHonorCipherOrder on
[% IF main.sslciphersuite.item.sslciphersuite.length %]SSLCipherSuite [% main.sslciphersuite.item.sslciphersuite %][% END %]
[% IF main.sslprotocol.item.sslprotocol.length %]SSLProtocol [% main.sslprotocol.item.sslprotocol %][% END %]
SSLPassPhraseDialog  builtin
SSLSessionCache         dbm:[% paths.dir_run %]/ssl_scache
SSLSessionCacheTimeout  300
SSLMutex  file:[% paths.dir_run %]/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin

[% IF configured.ip_listen_ssl -%]
[%- FOREACH ip IN configured.ip_listen_ssl -%]
    Listen [% ip %]:[% configured.main_port_ssl %]
[% END -%]
[% ELSE -%]
    # Defined in /var/cpanel/cpanel.config: apache_ssl_port
    Listen [% main.ifdefinessl.listen.item.listen %]
[% END -%]
    AddType application/x-x509-ca-cert .crt
    AddType application/x-pkcs7-crl .crl
[% END -%]


[% IF supported.mod_mime -%]
AddHandler cgi-script .cgi .pl .plx .ppl .perl
AddHandler server-parsed .shtml
AddType text/html .shtml
AddType application/x-tar .tgz
AddType text/vnd.wap.wml .wml
AddType image/vnd.wap.wbmp .wbmp
AddType text/vnd.wap.wmlscript .wmls
AddType application/vnd.wap.wmlc .wmlc
AddType application/vnd.wap.wmlscriptc .wmlsc
[% END -%]

<Location /whm-server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    [% IF options_support.APR_HAVE_IPV6 %]
    Allow from 127.0.0.1 ::1
    [% ELSE %]
    Allow from 127.0.0.1
    [% END %]
</Location>

[% IF serve_server_status %]
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from [% allow_server_info_status_from %]
</Location>
[% END -%]
[% IF serve_server_info %]
<IfModule info_module>
    <Location /server-info>
        SetHandler server-info
        Order deny,allow
        Deny from all
        Allow from [% allow_server_info_status_from %]
    </Location>
</IfModule>
[% END -%]

[% IF supported.suexec == 1 %]
# SUEXEC is supported
[% END -%]

[% IF file_test('f', paths.dir_conf_includes _ '/account_suspensions.conf') -%]
Include "[% paths.dir_conf_includes %]/account_suspensions.conf"
[% END -%]
[% IF file_test('f', paths.dir_conf_includes _ '/pre_virtualhost_global.conf') -%]
Include "[% paths.dir_conf_includes %]/pre_virtualhost_global.conf"
[% END -%]
[% IF file_test('f', paths.dir_conf_includes _ '/pre_virtualhost_2.conf') -%]
Include "[% paths.dir_conf_includes %]/pre_virtualhost_2.conf"
[% END -%]

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

[%- FOREACH nvh IN namevirtualhosts -%]
NameVirtualHost [% nvh %]
[% END -%]
NameVirtualHost *

[%- FOREACH vh IN sharedips -%]
# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

<VirtualHost [% vh %]>
    ServerName [% parsed_ip(vh) %]
    DocumentRoot [% paths.dir_docroot %]
    ServerAdmin [% serveradmin %]
    [%- IF supported.mod_suphp %]
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
    [%- END %]
    [%- IF supported.mod_userdir && userdirprotect_enabled && defaultvhost.userdirprotect != '-1' %]
    UserDir disabled
    [%- IF defaultvhost.userdirprotect != '' && !supported.itk && !supported.mod_ruid2 %]
    UserDir enabled [% defaultvhost.userdirprotect %]
    [%- END -%]
    [%- END %]
</VirtualHost>

[% END -%]

# Default vhost for unbound IPs

<VirtualHost *>
    ServerName [% wildcard_safe(servername) %]
    DocumentRoot [% paths.dir_docroot %]
    ServerAdmin [% serveradmin %]
    [%- IF supported.mod_suphp %]
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
    [%- END %]
    [%- IF supported.mod_userdir && userdirprotect_enabled && defaultvhost.userdirprotect != '-1' %]
    UserDir disabled
    [%- IF defaultvhost.userdirprotect != '' && !supported.itk && !supported.mod_ruid2 %]
    UserDir enabled [% defaultvhost.userdirprotect %]
    [%- END -%]
    [%- END %]
</VirtualHost>

[%- FOREACH vhost IN vhosts -%]

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

[%- IF vhost.custom_vhost_template_ap2 != '' -%]
    [%- INCLUDE $vhost.custom_vhost_template_ap2 -%]
[%- ELSE -%]
    [%- INCLUDE $includes.vhost -%]
[%- END -%]
[%- END -%]

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

# SSL
[%- FOREACH vhost IN ssl_vhosts -%]

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

[%- IF vhost.custom_vhost_template_ap2 != '' -%]
    [%- INCLUDE $vhost.custom_vhost_template_ap2 -%]
[%- ELSE -%]
    [%- INCLUDE $includes.ssl_vhost -%]
[%- END -%]
[%- END -%]

[% ips_in_use.push("127.0.0.1") %]
[% SET copy_of_ips_in_use = ips_in_use.slice(0) %]
[% WHILE (ip_block = copy_of_ips_in_use.splice(0, 50)) AND ip_block.size %]
[% IF proxysubdomains && supported.mod_proxy && supported.mod_rewrite %]
[% IF autodiscover_proxy_subdomains %]
# CPANEL/WHM/WEBMAIL/WEBDISK/AUTOCONFIG PROXY SUBDOMAINS
[% ELSE %]
# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
[% END %]
<VirtualHost[% FOREACH server_ip IN ip_block %] [% "${server_ip}:${configured.main_port}" %][% END %]>
    ServerName [% wildcard_safe(servername) %]
[% IF autodiscover_proxy_subdomains %]
    ServerAlias cpanel.* whm.* webmail.* webdisk.* cpcalendars.* cpcontacts.* autodiscover.* autoconfig.*
[% ELSE %]
    ServerAlias cpanel.* whm.* webmail.* webdisk.* cpcalendars.* cpcontacts.*
[% END %]
    DocumentRoot [% paths.dir_docroot %]
    ServerAdmin [% serveradmin %]
    [%- IF supported.mod_suphp %]
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
    [%- END %]
    [%- IF supported.mod_security2 %]
    <IfModule mod_security2.c>
        SecRuleEngine Off
    </IfModule>
    [%- END %]
    [%- IF supported.mod_userdir && userdirprotect_enabled && defaultvhost.userdirprotect != '-1' %]
    UserDir disabled
    [%- IF defaultvhost.userdirprotect != '' && !supported.itk && !supported.mod_ruid2 %]
    UserDir enabled [% defaultvhost.userdirprotect %]
    [%- END -%]
    [%- END %]
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^cpanel.
    RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^webmail.
    RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^whm.
    RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^webdisk.
    RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^cpcalendars.
    RewriteRule ^/(.*) http://127.0.0.1:2079/$1 [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^cpcontacts.
    RewriteRule ^/(.*) http://127.0.0.1:2079/$1 [P]
[% IF autodiscover_proxy_subdomains %]
    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^autodiscover.
    RewriteRule ^[^?]*(\?.*)? http://127.0.0.1/cgi-sys/autodiscover.cgi [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^autoconfig.
    RewriteRule ^[^?]*(\?.*)? http://127.0.0.1/cgi-sys/autoconfig.cgi [P]
[% END %]
    UseCanonicalName Off
    [%- IF supported.mod_security2 %]
    <IfModule mod_security2.c>
        SecRuleEngine On
    </IfModule>
    [%- END %]
</VirtualHost>
[% END %]
[% END %]

[% WHILE (ip_block = ips_in_use.splice(0, 50)) AND ip_block.size %]
[% IF proxysubdomains && supported.mod_proxy && supported.mod_rewrite %]
[% IF autodiscover_proxy_subdomains %]
# CPANEL/WHM/WEBMAIL/WEBDISK/AUTOCONFIG PROXY SUBDOMAINS
[% ELSE %]
# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
[% END %]
<VirtualHost[% FOREACH server_ip IN ip_block %] [% "${server_ip}:${configured.main_port_ssl}" %][% END %]>
    ServerName [% wildcard_safe(servername) %]
[% IF autodiscover_proxy_subdomains %]
    ServerAlias cpanel.* whm.* webmail.* webdisk.* cpcalendars.* cpcontacts.* autodiscover.* autoconfig.*
[% ELSE %]
    ServerAlias cpanel.* whm.* webmail.* webdisk.* cpcalendars.* cpcontacts.*
[% END %]
    DocumentRoot [% paths.dir_docroot %]
    ServerAdmin [% serveradmin %]
    [%- IF supported.mod_suphp %]
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
    [%- END %]
    [%- IF supported.mod_security2 %]
    <IfModule mod_security2.c>
        SecRuleEngine Off
    </IfModule>
    [%- END %]
    [%- IF supported.mod_userdir && userdirprotect_enabled && defaultvhost.userdirprotect != '-1' %]
    UserDir disabled
    [%- IF defaultvhost.userdirprotect != '' && !supported.itk && !supported.mod_ruid2 %]
    UserDir enabled [% defaultvhost.userdirprotect %]
    [%- END -%]
    [%- END %]
    RewriteEngine On
    <IfModule mod_ssl.c>
        SSLEngine on
        SSLProxyEngine On
    [% IF file_test('f', '/var/cpanel/ssl/cpanel/mycpanel.pem') -%]
        SSLCertificateFile /var/cpanel/ssl/cpanel/mycpanel.pem
        SSLCertificateKeyFile /var/cpanel/ssl/cpanel/mycpanel.pem
        SSLCertificateChainFile /var/cpanel/ssl/cpanel/mycpanel.pem
    [% ELSIF file_test('f', '/var/cpanel/ssl/cpanel/cpanel.pem') -%]
        SSLCertificateFile /var/cpanel/ssl/cpanel/cpanel.pem
        SSLCertificateKeyFile /var/cpanel/ssl/cpanel/cpanel.pem
        SSLCertificateChainFile /var/cpanel/ssl/cpanel/cpanel.pem
    [% ELSIF file_test('f', '/var/cpanel/ssl/cpanel/cpanel.crt') && file_test('f', '/var/cpanel/ssl/cpanel/cpanel.key') %]
        SSLCertificateFile /var/cpanel/ssl/cpanel/cpanel.crt
        SSLCertificateKeyFile /var/cpanel/ssl/cpanel/cpanel.key
        [% IF file_test('f', '/var/cpanel/ssl/cpanel/cpanel.cab') %]
        SSLCertificateChainFile /var/cpanel/ssl/cpanel/cpanel.cab
        [% END %]
    [% ELSE %]
        # No service SSL installed for cPanel
    [% END %]
    </IfModule>
    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^cpanel.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^webmail.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^whm.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^webdisk.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^cpcalendars.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2080/$1 [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^cpcontacts.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2080/$1 [P]
[% IF autodiscover_proxy_subdomains %]
    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^autodiscover.
    RewriteCond %{HTTPS} on
    RewriteRule ^[^?]*(\?.*)? https://127.0.0.1/cgi-sys/autodiscover.cgi [P]

    RewriteCond %{HTTP_HOST} !^[% wildcard_safe(servername) %]$
    RewriteCond %{HTTP_HOST} ^autoconfig.
    RewriteCond %{HTTPS} on
    RewriteRule ^[^?]*(\?.*)? https://127.0.0.1/cgi-sys/autoconfig.cgi [P]
[% END %]
    UseCanonicalName Off
    [%- IF supported.mod_security2 %]
    <IfModule mod_security2.c>
        SecRuleEngine On
    </IfModule>
    [%- END %]
</VirtualHost>
[% END %]
[% END %]

[% IF file_test('f', paths.dir_conf_includes _ '/post_virtualhost_global.conf') -%]
Include "[% paths.dir_conf_includes %]/post_virtualhost_global.conf"
[% END -%]
[% IF file_test('f', paths.dir_conf_includes _ '/post_virtualhost_2.conf') -%]
Include "[% paths.dir_conf_includes %]/post_virtualhost_2.conf"
[% END -%]

[% IF file_test('f', '/var/cpanel/domainfwdip') -%]
# WHM DOMAIN FORWARDING VHOST
<VirtualHost [% domainfwdip %]>
    ServerName [% wildcard_safe(domainfwdip) %]
    ServerAdmin [email protected]
    DocumentRoot /dev/null
    ScriptAliasMatch .* /usr/local/cpanel/cgi-sys/domainredirect.cgi
</VirtualHost>
[% END -%]

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Try reviewing the individual files within the /var/cpanel/userdata/nobody/ directory (not the .cache files). EX:

Code:
vi /var/cpanel/userdata/nobody/main
vi /var/cpanel/userdata/nobody/IP
Do you see any of the invalid names entered in these files? If so, you can edit the files to remove those entries, and then remove the ".cache" files.

Thank you.
 
  • Like
Reactions: Nurs1927

Nurs1927

Well-Known Member
Nov 22, 2015
93
7
58
Spain
cPanel Access Level
Root Administrator
Hello, in my
/var/cpanel/userdata/nobody/main
file I have
Code:
---
addon_domains: {}

main_domain: centos-66-64-cpanel.localdomain
parked_domains: []

sub_domains:
  - my IP
  - my hostname
And in
/var/cpanel/userdata/nobody/IP
Code:
---
documentroot: /usr/local/apache/htdocs
group: nobody
ifmodulemodsuphpc:
  group: nobody
ifmodulemoduserdirc: {}

ip: my IP
phpopenbasedirprotect: 1
port: 80
serveradmin: my email
serveralias: www.my IP
servername: my IP
usecanonicalname: 'Off'
user: nobody
userdirprotect: ''
What changes should I do?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
main_domain: centos-66-64-cpanel.localdomain
I suggest removing the .cache entries in this directory, and then updating your hostname via:

"WHM >> Change Hostname"

See if this changes the entry for "main_domain" in the referenced file.

Thank you.
 
  • Like
Reactions: Nurs1927

Nurs1927

Well-Known Member
Nov 22, 2015
93
7
58
Spain
cPanel Access Level
Root Administrator
Hello, I deleted .cache files.
Then I selected the option WHM >> Change hostname. The hostname is correct in this option but I press the button "Change"

This is the message when finished
Code:
Changing hostname......Done

Hostname set to: myhostname
Altered hostname in /etc/sysconfig/network
Stopping cPHulkd during hostname change
Waiting for “cphulkd” to stop ………finished.

cphulkd stopped successfully.
Stopping MySQL during hostname change
Changing hostname in kernel to myhostname
Updating cPHulkd
hulkdsetup: database schema is up to date.
Starting cPHulkd
Waiting for “cphulkd” to start ……waiting for “cphulkd” to initialize ………finished.

cphulkd started successfully.
Updating Apache configuration
Updating cPanel license...Done. Update succeeded. Building global cache for cpanel...Done
The system has queued the hostname changes for the Horde and DAV services. Users cannot access the Horde or DAV features that use these services until the system has finished updates to the hostname. After the system adjusts a specific user’s database, it restores their access to the Horde and DAV services. You will receive a notification when the system completes the update for all users.
Waiting for “mysql” to start ……waiting for “mysql” to initialize ………finished.

Startup Log
Starting MySQL..[ OK ]

Log Messages
160323 23:48:36 [Note] /usr/sbin/mysqld: ready for connections.
160323 23:48:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160323 23:48:34 mysqld_safe mysqld from pid file /var/lib/mysql/myhostname.pid ended
160323 23:48:34 [Note] /usr/sbin/mysqld: Shutdown complete
160323 23:48:32 [Warning] /usr/sbin/mysqld: Forcing close of thread 4389966 user: 'eximstats'
160323 23:48:32 [Warning] /usr/sbin/mysqld: Forcing close of thread 4506752 user: 'leechprotect'
160323 23:48:30 [Note] /usr/sbin/mysqld: Normal shutdown

mysql started successfully.
The hostname was already set to myhostname, syncing configuration only.


You should probably "Add an A Entry for your Hostname" if you don't already have one.
The main file don´t change

Code:
---
addon_domains: {}

main_domain: centos-66-64-cpanel.localdomain
parked_domains: []

sub_domains:
  - my IP
  - my hostname
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Have you tried manually updating that entry to your actual hostname, and then saving the file?

Thank you.
 

Nurs1927

Well-Known Member
Nov 22, 2015
93
7
58
Spain
cPanel Access Level
Root Administrator
Ok, I changed
Code:
main_domain: centos-66-64-cpanel.localdomain
to
Code:
main_domain: myhostname
Now I have similar error with /scripts/rebuildhttpdconf
Code:
info [rebuildhttpdconf] Missing IP for domain myhostname, using 188.40.118.130
info [rebuildhttpdconf] Missing ServerName for domain myhostname, using myhostname
info [rebuildhttpdconf] Missing port for domain myhostname, using 80
info [rebuildhttpdconf] Missing user for domain myhostname, using nobody
info [rebuildhttpdconf] Missing owner for domain myhostname, force lookup to root
info [rebuildhttpdconf] Missing group for domain myhostname, using nobody
info [rebuildhttpdconf] 'local' template in use (/var/cpanel/templates/apache2_2/main.local)
Built /usr/local/apache/conf/httpd.conf OK
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
You can also run "/usr/local/cpanel/bin/userdata_update" to ensure the cache files are generated after you manually remove them if you do not want to wait for them to populate automatically. Please keep in mind that the messages you see are simply informational and do not indicate an actual problem with your Apache configuration.

Thank you.