SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict SirAdrian's Avatar
    Join Date
    Jul 2005
    Location
    Kelowna, BC
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Launching Web Service

    I'm going to be launching a new web application within the next few weeks (hopefully), and the server side is a bit more complicated than what I'm used to.

    I'm currently on a CentOS VPS, which runs on cPanel. Each client in this application will use their own domain name. I'm using PHP's $_SERVER['SERVER_NAME'] to determine which site the application is being requested on.

    Anyway, this is mostly fine and dandy when testing locally. It's very easy to add virtual hosts manually. So, when moving this into the cPanel environment, I have a few questions:

    1) How can I have it point all domains not already created as accounts, to a catch-all address? How do I set up the DNS for this?

    2) If one of the customers would like email and etc. set up for them, how do I handle that? Do I need to end up creating an account in WHM for them and then set up their email. Can I do that at the DNS level only? If it's the former, how can I easily point their web stuff to the catch-all account so I don't have to mess with file permissions and other account differences? My host briefly mentioned add-on domains, but I'd really like to keep this entirely automated/transparent if at all possible.

    If anyone has any general feedback for this type of application their advice would also be appreciated.

    Thanks!
    Adrian Schneider - Web Developer

  2. #2
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also use $_SERVER['HTTP_HOST']

    1. To do this, you need to set up wildcard DNS. I think you can add a subdomain with the name * to do this. Although I don't remember exactly. Just google "cpanel wildcard dns"
    2. If a customer needs an email, you can very easily add it from the CPanel of whatever domain they need the email for. If you want to do it from your own app, check out the cpanel api, it's very easy to use.


Bookmarks

Posting Permissions

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