logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Directive script for adding sub domains in DNS server
Author
Trey



Joined: 07 Aug 2006
Posts: 1

PostPosted: Mon 07 Aug '06 19:32    Post subject: Directive script for adding sub domains in DNS server Reply with quote

We have a new dedicated Apache virtual http server also running servers for mail and DNS.

I am trying to find out how to write, or find, a script that can be included in my PHP code that when a new "member" is added to the MySql database a sub domain is also created and put into the DNS server at the same time.

ie. www.Fred.sitename.com/ instead of www.sitename.com/? ID=Fred

I have a hint this can be done with an Apache directive script but don’t know. I am new to this side of the world.

Thanks,

Trey Hacker

Ps: I’m a dinosaur having been in the wonderful world of computers since the mid seventies and Hacker is really my last name. It has caused me a lot of grief over the years being in this business. I’m coming out of retirement to do it "one more time". Any & all help will be appreciated.

Trey
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3094
Location: Hilversum, NL, EU

PostPosted: Mon 07 Aug '06 23:17    Post subject: Reply with quote

Maybe you want to use mod_vhost_alias to map a part of a domain name to the document root:

<VirtualHost *:80>

VirtualDocumentRoot c:/www/%1/docs

</VirtualHost>

The '%1' means, include the first part of the server name in the filenames.

See http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html for details
Back to top


Reply to topic   Topic: Directive script for adding sub domains in DNS server View previous topic :: View next topic
Post new topic   Forum Index -> Apache