The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to change site visible when WHM hostname is opened in web browser?

Discussion in 'General Discussion' started by postcd, Nov 2, 2016.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    653
    Likes Received:
    11
    Trophy Points:
    68
    Hello,

    currently when i open WHM server hostname or IP in the web browser, it redirected to the website of the cpanel that was added as the first cpanel to the shared IP in WHM.

    When i moved this cPanel to secondary IP, then another website taken place.

    But how can i please set website/domain/URL of my choice to open when WHM hostname or IP is opened in web browser?

    Thank you

    -----
    update: i had to change IP of my WHM/cpanel VPS; i modified IP in "Basic cPanel & WHM Setup" but seems that my old IP is still 4 times in /usr/local/apache/conf/httpd.conf :

    But seems that was not enough, where i should modify IP so it propagate httpd.conf ?
     
    #1 postcd, Nov 2, 2016
    Last edited: Nov 2, 2016
    sandra lynn likes this.
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    653
    Likes Received:
    11
    Trophy Points:
    68
    @Michael
    thx for a reply on that page i found this post of yours, it worked, BUT i would like not to "hardcode" IP into the configuration as IP may change. How can i do it?

    Also i wish you can reply also regarding the issue (i described above) where old IP was not replaced by new in httpd.conf
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    How do you plan on making a change to the IP address? It should be replaced with the new IP address automatically if you use "WHM >> IP Migration Wizard" when making the change.

    Regarding the old IP address, did you take any steps to remove the old IP address from the server? Does it exist in the /etc/ips file, or within any files under the /var/cpanel/userdata/$username/ directories?

    Thank you.
     
  5. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    653
    Likes Received:
    11
    Trophy Points:
    68
    Thx, i just changed IP in "Basic cPanel & WHM Setup" and then did "Multi Account Functions" > Change Multiple site's IP addresses
    So as you suggested now i ran that "IP Migration Wizard". It completed without error:
    Old IPs in /usr/local/apache/conf/httpd.conf was replaced by new, but it is there twice on many lines:
    <VirtualHost NEWIP:443 NEWIP:443>
    <VirtualHost NEWIP:80 NEWIP:80>

    I think it may be result that i ran this Wizard while cpanels had already been assigned new IP (by doing mentioned "Change multiple site's IP addresses" from within WHM). Is that problem? If yes, how should i fix that? Is enough to do replacement just in this file or fix in WHM anyhow? PS: shouldn't cPanel try to configure Wizard so this do not happen?

    Update: i clicked button to finish migration and after it restarted apache, all sites was showing Error 500, then when i run "/scripts/rebuildhttpdconf" from within command line and restarting apache (service httpd restart), sites started working again.

    Yet there is still the question of this topic regarding hostname/WHM IP, how to define custom site/redirect without hardcoding present IP into httpd.conf virtualhost include?
     
    #5 postcd, Nov 2, 2016
    Last edited: Nov 3, 2016
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    It's normal to see two VirtualHost entries for an IP address. One is for port 80 (Non-SSL), and the other is for port 443 (SSL).

    Thank you.
     
  7. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    653
    Likes Received:
    11
    Trophy Points:
    68
    i know, but i think (may be wrong) problem is when IP is two times on same line:
    GOOD: <VirtualHost NEWIP:443>
    BAD: <VirtualHost NEWIP:443 NEWIP:443>

    there is still the question of this topic regarding hostname/WHM IP, how to define custom site/redirect without hardcoding present IP into httpd.conf virtualhost include?
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Could you verify if your system uses EasyApache 3, or EasyApache 4?

    Thank you.
     
  9. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    653
    Likes Received:
    11
    Trophy Points:
    68
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket using the link in my signature if you'd like us to take a closer look. You can post the ticket number here and we will update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page