Prevent IP browsing as it does with the server's primary IP address

elderf

Member
May 11, 2010
5
0
51
I have created a new user in cpanel that uses one of the extra IP addresses of the server as IP address Not shared (xx.xx.xx.xxx) and I see that besides being able to navigate with the domain example.com also You can browse the IP.

How can I prevent IP browsing as it does with the server's primary IP address?
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello,

You can follow the steps referenced below (partly taken from our SSL FAQ document):

1. Navigate to WHM's Include Editor interface (WHM Home >> Service Configuration >> Apache Configuration >> Include Editor).

2. Select the Pre Virtual Host Include option.

3. Select the Apache version from the menu. We recommend that you select All Versions.

4. Enter the following text in the available text box:

Code:
<VirtualHost IPADDRESS:80>
  ServerName HOSTNAME
  DocumentRoot /usr/local/apache/htdocs
  ServerAdmin EMAIL
  <IfModule mod_suphp.c>
    suPHP_UserGroup nobody nobody
  </IfModule>
 </VirtualHost>

<VirtualHost IPADDRESS:443>
  ServerName HOSTNAME
  DocumentRoot /usr/local/apache/htdocs
  ServerAdmin EMAIL
  <IfModule mod_suphp.c>
    suPHP_UserGroup nobody nobody
  </IfModule>
    SSLEngine on
    SSLCertificateFile SSLCERTIFICATEFILE
    SSLCertificateKeyFile YOUR-SSLCERTIFICATEKEYFILE
 </VirtualHost>
Note:

This example uses the following values:
  • IPADDRESS represents your account's dedicated IP address.
  • HOSTNAME represents your server's hostname.
  • EMAIL represents your contact email address.
  • SSLCERTIFICATEFILE represents the full file path to your SSL certificate.
  • SSLCERTIFICATEKEYFILE represents the full file path to your SSL certificate's key.
5. Click Proceed
6. Click Update.

Thank you.