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.

Problem with IP shared and hostname

Discussion in 'General Discussion' started by sergio2004, Jun 21, 2009.

  1. sergio2004

    sergio2004 Well-Known Member

    Joined:
    Feb 28, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Rio de Janeiro
    Hi,

    When a type the shared IP of my dedicated server in the browser, it is showing the first account that I created in the server and it`s begining with the letter "a".

    I think that the shared IP in the browser must show the apache/cpanel page and not a customer page.

    The begining of the history is in last year, when I bought a SSL and install it in my domain account without any problem.

    This year when I went renew the SSL, the WHM shows error because my domain is with shared IP, then the datacenter support said to me put my domain with a dedicated IP and the install of SSL is ok. But the dedicated IP that the DC said to me use is the IP of the ns2. of my domain.

    The problem is that the hostname of the server is a subdomain of my domain. Then now the configuration of the server is like the example below.

    The hostname: srv.mydomain.com
    But srv is a subdomain of my domain
    The shared IP is: 74.XXX.XXX.369
    The nameservers are:
    ns1.mydomain.com with IP 74.XXX.XXX.369
    ns2.mydomain.com with IP 74.XXX.XXX.400

    The dedicated IP of my domain with SSL is 74.XXX.XXX.400, but in the DNS zone the srv appears like a subdomain with the A entry with the shared IP 74.XXX.XXX.369

    All accounts of customers were created with the root owner and with shared IP 74.XXX.XXX.369. My domain is not configured like reseller.

    Please, how can I solve this confusion problem?

    Thank you.
     
  2. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Apache displays the first site it comes to reading the httpd.conf file
    down from top to bottom for the IP that you are trying to access.

    Whatever site is listed first in the httpd.conf file for the given IP
    is the site that is shown which is generally the "default page"
    for Cpanel unless your default page has gotten deleted from
    the Apache configuration for any reason (or moved)

    Just move whatever site you want to be the default to be
    the first one read by Apache or better yet create a new
    virtualhost section for that site and put it in to one of the
    include files that is run before the virtualhost sections.
     
  3. sergio2004

    sergio2004 Well-Known Member

    Joined:
    Feb 28, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Rio de Janeiro
    Hi,

    Thank you for your anwser.

    The httpd.conf before I put the dedicated IP for my domain is like below. Remember that IP with final number 369 is the shared IP and the IP with final 400 is the dedicated of my domain now and the IP of the ns2.mydomain.com too.

    <VirtualHost 74.XXX.XXX.369:80>
    <IfModule mod_userdir.c>
    UserDir disabled
    </IfModule>
    ServerName srv.mydomain.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin suport@mydomain.com
    <IfModule mod_suphp.c>
    suPHP_UserGroup nobody nobody
    </IfModule>
    </VirtualHost>


    # Default vhost for unbound IPs

    <VirtualHost *>
    <IfModule mod_userdir.c>
    UserDir disabled
    </IfModule>
    ServerName srv.mydomain.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin suport@mydomain.com
    <IfModule mod_suphp.c>
    suPHP_UserGroup nobody nobody
    </IfModule>
    </VirtualHost>

    Then after I install the SSL and put a dedicated IP for my domain like I said, the httpd.conf is like below.

    NameVirtualHost 74.XXX.XXX.400:80
    <VirtualHost 74.XXX.XXX.400:80>
    ServerName srv.mydomain.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin suport@mydomain.com
    <IfModule mod_suphp.c>
    suPHP_UserGroup nobody nobody
    </IfModule>
    </VirtualHost>


    # Default vhost for unbound IPs


    NameVirtualHost 74.XXX.XXX.400:80
    <VirtualHost 74.XXX.XXX.400:80>
    ServerName srv.mydomain.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin suport@mydomain.com
    <IfModule mod_suphp.c>
    suPHP_UserGroup nobody nobody
    </IfModule>
    </VirtualHost>

    For solve the problem related, must I edit and change the NameVirtualHost 74.XXX.XXX.400:80 and put the number of shared IP? Is it?

    In the old file was
    # Default vhost for unbound IPs

    <VirtualHost *>


    and now is
    # Default vhost for unbound IPs


    NameVirtualHost 74.XXX.XXX.400:80


    Thanks for your help
     
  4. sergio2004

    sergio2004 Well-Known Member

    Joined:
    Feb 28, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Rio de Janeiro
    Hi,

    But when I created an account, it appears in the end of file. Must I move the files of this new account manually by ssh? Is it?

    Thank you
     
Loading...

Share This Page