Restored a few accounts to a new server with no errors reported, but found one small issue. When I visit the dedicated IP for one of the accounts, it loads one of that domain's addon domain's sites instad of the main domain site. I would like visiting the dedicated IP to show the contents of the accounts primary domain not the addon or subdomain.
Looking at /etc/apache2/conf/httpd.conf I see the order of the VirtualHost is:
If I simply edit that and move the primary domain above the addondomain.domain.com so that the domain.com section is the first to appear for the VirtualHost 1.2.3.4 then visiting 1.2.3.4 loads the domain.com content correctly.
However, will this corrected order directly in the /etc/apache2/conf/httpd.conf be overwritten?
Is there a more correct way to correct this order of the VirtualHost sections in the httpd.conf file?
Looking at /etc/apache2/conf/httpd.conf I see the order of the VirtualHost is:
Code:
<VirtualHost 1.2.3.4:80>
ServerName addondomain.domain.com
ServerAlias addondomain.com
... (73 lines total)
# To customize this VirtualHost use an include file at the following location
# Include "/etc/apache2/conf.d/userdata/std/2_4/username/addondomain.com.domain.com/*.conf"
</VirtualHost>
<VirtualHost 1.2.3.4:80>
ServerName domain.com
ServerAlias www.domain.com
... (73 lines total)
# To customize this VirtualHost use an include file at the following location
# Include "/etc/apache2/conf.d/userdata/std/2_4/username/domain.com/*.conf"
</VirtualHost>
Code:
<VirtualHost 1.2.3.4:80>
ServerName domain.com
ServerAlias www.domain.com
... (73 lines total)
# To customize this VirtualHost use an include file at the following location
# Include "/etc/apache2/conf.d/userdata/std/2_4/username/domain.com/*.conf"
</VirtualHost>
<VirtualHost 1.2.3.4:80>
ServerName addondomain.domain.com
ServerAlias addondomain.com
... (73 lines total)
# To customize this VirtualHost use an include file at the following location
# Include "/etc/apache2/conf.d/userdata/std/2_4/username/addondomain.com.domain.com/*.conf"
</VirtualHost>
Is there a more correct way to correct this order of the VirtualHost sections in the httpd.conf file?
Last edited by a moderator: