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.

Automatically generated folders acting as subdomains?

Discussion in 'cPanel Developers' started by crinte, Mar 26, 2010.

  1. crinte

    crinte Member

    Joined:
    Feb 17, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I have a system that creates website to a specific location ie.
    /home/free/free_sites (domain is free.com)

    User comes, creates a site called demo and then the system generates demo site into /home/free/free_sites/demo where are all necessary files for a free site.

    how do I set my apache to automatically respond to the right location, when user's site will be at demo.free.com.

    I've tried, but it's not working. I do have mod_vhost_alias installed..

    Code:
    <VirtualHost *:80>
    VirtualDocumentRoot /home/free/free_sites/%1
    ServerAlias *.free.com
    </VirtualHost> 
    
    Thank you!
    Crinte
     
  2. leefrom

    leefrom Active Member

    Joined:
    May 27, 2008
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Without knowing much more, I can only guess that you are actuall editing httpd.conf with your script?

    It would be much simpler (and more reliable) to use the cpanel api to add the domain as an Addon domain. It will simultaneously create the directory you specify and set up httpd.conf to work properly.
     
  3. crinte

    crinte Member

    Joined:
    Feb 17, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    A great idea, thanks, it's working just perfect now :)
     
  4. leefrom

    leefrom Active Member

    Joined:
    May 27, 2008
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
Loading...
Similar Threads - Automatically generated folders
  1. NTar
    Replies:
    1
    Views:
    445

Share This Page