Accessing websites via IP is not desirable and not supported by most good hosts.
It's considered a good practice for security savvy shared web hosts not to allow accessing content via the IP address of the server via mod_userdir, this is because mod_userdir has some security concerns. More information about this below.
SOURCE
The mod_userdir module that is responsible for this URL functioning is
quite insecure and increases the risks of attacks on your account. We
are concerned about users' security and use only the best security
practices. Due to this, mod_userdir as well as the temporary URL is
disabled on our shared servers.
SOURCE
mod_userdir allows accessing a user's homepage using the temporary URL
with the /~user/ syntax, like http://ipaddress/~user
where 'ipaddress'
may be replaced with the server's hostname or any domain name that is
resolved to the server you wish to check the content on.
Having mod_userdir enabled poses considerable security risks and
disadvantages:
Usernames are exposed - it is possible to access different websites hosted on the server via the same domain name (servers IP address or
server
s hostname) replacing the /~user/ part only (e.g.,
http://ipaddress/~user1
, http://ipaddress/~user2
,
http://ipaddress/~user3
, etc.) what makes hosted accounts more
vulnerable to hacking attacks.
When the mod_userdir module is used for accessing a website, the traffic is added to the total of the users through which visitors
access the website but not to the bandwidth usage of the user who is a
real website owner.
mod_userdir should be disabled for root access in order to make the server protected from modification by non-root users, thus, you need
to include a "UserDir disabled root" into your configuration.
As you may know, we tend to introduce the latest technology in order
to protect your account and data all the time. The mod_userdir module
is currently disabled on our shared servers that allows us to increase
the security level and decrease chances of your account as well as
server from being hacked. This is in line with our highest security
standards and lets us provide you with the level of security you
expect from us.
Also, if its shared hosting without a dedicated IP you would be you would be required to use /~username/addon-domain/
, or however that host has setup the process, assuming that they have it enabled in the first place.
The correct way...
The correct way would be to ensure that you have added the addon domain to the cPanel and then either update the DNS A record to the IP address of the server hosting the addon domain, or use the name servers recommended by the web host hosting that server. The rest, should work... but it can take 1 hour, or 72 hours for the internet to update the records... it's not instant. So, if you added, this and that, and have not waited for this long... then there may not be anything wrong, other the fact you haven't waited long enough.
If you want to check the server configuration without waiting for the DNS to propagate across the web, you can edit your operating systems host file.