Results 1 to 7 of 7
  1. #1

    * Trying to set up hosted solution - how to autodetect customer domains?

    I recently released a turnkey script (like WordPress) and am now looking to release a hosted solution.

    I would like customers to register the domain name themselves. Then, when they sign up w/ my hosted solution, they specify their domain name and point it to my server (through their domain registrar by setting the A-record and CNAME).

    i.e. something like this, though preferably simpler....
    tumblr.com/docs/en/custom_domains
    google.com/support/blogger/bin/static.py?page=ts.cs&ts=1233381

    Then, my service will automatically set up the site under their domain name. I would like all customer domains to point to the same set of script files, so that I will only have to push updates to a single install of the script and it will be reflected across all customer sites/domains.

    The script will detect the customer based on the domain and deliver the relevant content.

    So my question is...

    How do I set up my script or server to detect the customer domains?

    Can anyone shed some light on this? If you could provide tutorial links related to this, that would be awesome.

    Thanks.

  2. #2
    Join Date
    Aug 2002
    Location
    Milton Keynes
    Posts
    352
    The web server will pass the requested domain name as the SERVER_HOST variable.

    Apache's default behaviour is to serve requests for all and any domains requested from the web root specified in the default <VirtualHost> or DocumentRoot directive.

    Unless you mean - how do you point & click your way through doing this after CPanel has had it's wicked way with your config files.

  3. #3
    Thanks for your quick response.

    I just want to clarify my understanding, as this is unfamiliar territory to me...

    Let's say my script is installed at subdomain.domain.com. I will have my customers set their domains' A-records to my server IP and CNAME 'www' records to subdomain.mydomain.com.

    Then, I will need to modify the <VirtualHost> section associated with mydomain.com, such that it will redirect all unrecognized domains to subdomain.domain.com.

    Is that the gist?

    Thanks.

  4. #4
    Join Date
    Aug 2002
    Location
    Milton Keynes
    Posts
    352
    That'd work - yes, then you could extract the subdomain from SERVER_HOST.

    It should be pretty easy to setup everything through CPanel to handle *.mydomain.com

  5. #5
    Quote Originally Posted by dtang4 View Post
    Then, I will need to modify the <VirtualHost> section associated with mydomain.com, such that it will redirect all unrecognized domains to subdomain.domain.com
    Back with another question... so, how do I exactly do the above?

    It would be great if could you provide exact code that I can modify and insert into my VirtualHost section.

    FYI, here are the first 4 lines in the VirtualHost section associated with my IP:
    Code:
    ServerName mydomain.com
    ServerAlias www.mydomain.com
    ServerAdmin [email protected]
    DocumentRoot /home/myusername/public_html
    Right now, I'm playing around w/ a throw-away domain. I went into GoDaddy and set the A-record to my IP and created a 'www' CNAME to point to subdomain.mydomain.com. When I go to this domain without the 'www,' it loads up the default CPanel landing page. When I go to this domain with the 'www,' it loads up my subdomain.mydomain.com page (which is working as intended).
    Last edited by dtang4; 06-09-2011 at 05:18 AM.

  6. #6
    Join Date
    Aug 2002
    Location
    Milton Keynes
    Posts
    352
    This is because CPanel already has a default vhost setup. I don't use CPanel or have any intention of getting to know it better, but you should be able to do it by setting up an ip-based virtual host.

  7. #7
    Thanks, got it working!

Similar Threads

  1. Need a hosted RADIUS solution
    By jtwright in forum Hosting Security and Technology
    Replies: 4
    Last Post: 09-04-2012, 12:48 AM
  2. Need a hosted RADIUS solution
    By neonerd25 in forum Hosting Security and Technology
    Replies: 2
    Last Post: 02-10-2010, 11:35 PM
  3. UK Hosted Exim Solution
    By HostExchange in forum Dedicated Server
    Replies: 0
    Last Post: 03-04-2008, 06:45 AM
  4. How to set up default page for hosted domains?
    By thernes in forum VPS Hosting
    Replies: 5
    Last Post: 09-22-2006, 06:31 PM
  5. Hosted supportdesk Solution
    By Fatty in forum Hosting Software and Control Panels
    Replies: 0
    Last Post: 08-05-2006, 02:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •