Results 1 to 3 of 3

Thread: Hosting multiple dynamic sites

  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    2
    cPanel/WHM Access Level

    Root Administrator

    Default Hosting multiple dynamic sites

    Hi everyone,

    I have a CMS that uses one database and selects different data for different websites simply by using a column called CUST_NO in every table. Now I need to set this up on cpanel. I have a WHM and can create cpanel accounts if needed. The database is also imported and ready to serve.
    After many hours trying to figure out where to start I was hoping to get some startup help here.

    My questions: Is it possible to forward domain1.com to the same PHP files and the same database as domain2.com and somehow get the correct data for the correct site?

    I.E: A user browsing domain1.com would trigger the sql query SELECT COMPANY_NAME FROM TABLE WHERE CUST_NO=1.

    Can someone point me in the right direction?

    EDIT: The domains are external domains forwarded/redirected to my cpanel.
    Last edited by NewFolder; 07-17-2012 at 08:37 AM.

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Hosting multiple dynamic sites

    It should be possible for all to use the same database, but I'd suggest putting all domains on the same account and have each as an addon domain instead of using different accounts. This way all have access to the same cPanel database on that one account.

    As for how to reference which files to use, does whoever created the CMS have any guide on doing it? It seems the files will need to call the correct data from the CMS. The files themselves have to be coded to call the right data. That itself would be a coding issue for grabbing the right data.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Registered User
    Join Date
    Jul 2012
    Posts
    2
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Hosting multiple dynamic sites

    I have created this CMS myself. So I can do whatever I would like.

    The problem is not technical but more practical. I could create a simple text file with a customer number in a specific folder for every customer that gets included in the database query. I guess this would be possible somehow in cpanel.

    Another way would be to select data based on the url the request is coming from, if it is possible to send this url to the database somehow.

    The Addon suggestion looks really interesting i will defenetly check it out.

Similar Threads

  1. Multiple sites per IP
    By KHeadley in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 10-31-2011, 07:18 AM
  2. JSP dynamic website hosting
    By nasix in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 03-22-2010, 03:26 PM
  3. Multiple sites on one IP
    By merera in forum New User Questions
    Replies: 2
    Last Post: 04-07-2008, 11:08 AM
  4. Multiple dynamic sites in one virtual directory (Apache Questions)
    By 1EightT in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 03-31-2007, 10:24 AM
  5. Multiple sites on same IP
    By benNICHOLAS in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 03-24-2007, 02:10 PM