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!

Two sites sharing the same application

Discussion in 'General Discussion' started by Overflow, Nov 2, 2014.

  1. Overflow

    Overflow Registered

    Joined:
    Nov 2, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    We just started using WHM where I work and we love it.

    However, we have a question regarding the hosting of two sites, with two different IPs, sharing the same application.

    For example:

    a.domain1.com
    b.domain2.com

    They are running the same web application. We are maintaining only one version of the application, so each website should use the same sources. However, they both have a dedicated IP address, so they can have their own SSL and reputation.

    The question is: how can we share the same sources on the same server? The application is developped in PHP.

    We tried creating a symlink between the two accounts, but it does not work because of the permissions.

    How can this situation be handled in WHM? We know we could simply add an Alias and the IP address directly in the apache configuration, but it seems this configuration is overwritten at some point.

    Thank you!
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,962
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    This is no longer the case if you are using an OS that supports SNI (CentOS/RHEL/Cloud Linux 6 or higher). You should add one of these domain names as an addon domain to the other so they can utilize the same file paths. Note that you can also assign dedicated IP addresses to addon domain names using the instructions here:

    Dedicated IP Address for Addon Domains

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Overflow

    Overflow Registered

    Joined:
    Nov 2, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you!

    I finally created a custom VirtualHost before your answer in : /usr/local/apache/conf/includes/post_virtualhost_global.conf

    I will definitely try your way.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice