Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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 access website via IP

Discussion in 'General Discussion' started by Vasanthjan, Apr 4, 2017.

Tags:
  1. Vasanthjan

    Vasanthjan Member

    Joined:
    Mar 8, 2017
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    I can view my website or primary domain through the IP address like below format.


    The Files are showing under
    Location: /home/cpanelusername/public_html

    URL:
    http://1xx.2xx.1xx.1/~cpanelusername/

    If sub-domain is created under the public_html/somesub-domain/

    URL: http://1xx.2xx.1xx.1/~cpanelusername/somesub-domain/ it is working fine.

    But I'm not able to view the folder which is created under the /home/somesub-domain/ (or) /home/someaddon-domain

    Can anyone help on it? How to view the website through the IP address for sub-domain or addon domain.

    Note: My addon and sub-domains is working fine through the domainname.com and addondomainname.com also.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Is mod_userdir protection enabled via "WHM >> Home » Security Center » Apache mod_userdir Tweak"? If so, have you excluded protection for the specific addon and subdomain names you want to allow access to?

    Thank you.
     
  3. Vasanthjan

    Vasanthjan Member

    Joined:
    Mar 8, 2017
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Can you help me how to achieve it? Is there any documentation available.

    and please specify the URL pattern to view the sub-domain which under home directory.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You should see a list of domain names when accessing the option in Web Host Manager:

    "WHM >> Home » Security Center » Apache mod_userdir Tweak"

    The option is documented at:

    Apache mod_userdir Tweak - Documentation - cPanel Documentation

    Is this tweak enabled on your system, and if so, are the domain names in-question excluded from protection?

    Thank you.
     
  5. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    832
    Likes Received:
    12
    Trophy Points:
    168
    As the OP says, can you please clarify the method (if it is possible) to access an addon domain when it is inside the homedir instead of under the public_html directory?

    By default, using /~username will point you to the public_html directory of that user.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Access attempts through Mod_Userdir outside of the account's public_html directory will fail. You'd need to move the addon domain names document root to the public_html directory, or consider an alternate method of temporarily accessing the domain name. Generally, the better approach is to simply edit the hosts file on the computer accessing the domain name:

    How to Modify your hosts File - cPanel Knowledge Base - cPanel Documentation

    Thank you.
     
  7. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    832
    Likes Received:
    12
    Trophy Points:
    168
    In these cases we often recommend to the customer to access their addon domain via the subdomain - i.e http://addon.maindomain.com.

    Another option is to give the addon domain a dedicated IP address...
    Edit /var/cpanel/userdata/username/addon.com to change the IP to a spare IP on the server, then run /scripts/rebuildhttpdconf
    You can now navigate to the IP in a browser and see whatever you have uploaded there.
     
Loading...

Share This Page