Jump to content

Dynamic VirtualHost Problem - reading from DB or Flat File?


virtualpsm

Recommended Posts

Hello all.  I have been researching dynamic virtualhosts for about a month now and still can't seem to figure out the best solution to my problem. 

Basically, I want to be able to add subdomains & domains to Apache 2.0 dynamically, but I can't figure out how to get them into my VirtualHost. 

I understand apache can dynamically construct vhosts based on the directory structure, but the problem I see there is that I want each site to have the same code base/document root, not read from their individual directories.

I read on apache's docs that mod_rewrite can read in an external file, which may be a possibility.  I would just need to write the corresponding PHP script that would append to or delete from that file when hosts are added/deleted.

Can anyone help me here?  The ideal for me would be to have a directory of flat files (one for each vhost) to read with the vhost information or construct it from my SQL database.  I'm open to all ideas.

Thanks in advance.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.