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.

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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  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