HostOnNet Blog

Customer Domain Showing up on Cpanel Server Host Name

On one of our cpanel server, when visiting servers host name.

hostname_customer_site

This is because this web site is first site hosted on this IP. This happened because we don’t set which IP reseller can use when setting up reseller account, so he is free to use any available IP on the server.

To fix this, edit file

vi /usr/local/apache/conf/includes/pre_virtualhost_2.conf

Add

<VirtualHost SERVER_IP_1:80 SERVER_IP_2:80 SERVER_IP_3:80 SERVER_IP_X:80>
    ServerName server48.hosthat.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin servers@hostonnet.com
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
    UserDir disabled
</VirtualHost>

Replace SERVER_IP_1, SERVER_IP_2, SERVER_IP_3 etc.. with server IP available on your server. You can find it with command

ifconfig | grep inet

For server48, i added

<VirtualHost 50.22.41.224:80 50.22.41.226:80 50.22.41.227:443 50.22.41.227:80 50.22.59.66:80>
    ServerName server48.hosthat.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin servers@hostonnet.com
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
    UserDir disabled
</VirtualHost>

Now restart web server

service httpd restart

After restart, visiting host name shows cpanel default page.

hostname_cpanel_default_page


Posted in Cpanel Server