Page 1 of 1
subdomain creation
Posted: Tue Mar 30, 2004 6:07 pm
by reverend_ink
I am wordering if anyone here knows how to automate the creation of a subdomain with a php script?
I am using apache as well.
I am running linux on the server with php 4.3X
Thanks all!
Posted: Tue Mar 30, 2004 6:28 pm
by reverend_ink
I am thinking I might have to edit the DNS zone, but what I want to do is create a subdomain based on a user's new folder within the domain...
so user's new domain WOULD be
http://www.mydomain.com/userfolder and what I need to do is create a subdomain automatically at userfolder.mydomain.com
Posted: Tue Mar 30, 2004 6:58 pm
by kettle_drum
Just get the php script to add a virtualhost to the httpd config. Its probably best to have a seperate file for all users, and then in the httpd.conf file, simply include these files - that way your not writting to the conf file directly.
You then need to restart apache for it to read the new config - and you have your sub-domain.
Posted: Tue Mar 30, 2004 7:02 pm
by reverend_ink
to expand I am making a script for someone to add users, may not be predefined names...
think I could right this into a "subdomain".conf file?
and then in httpd.conf have include "subdomain".conf?
and when they make a new user the "subdomain".conf is appended with
<virutal host=$subdomain.mydomain.com> and then restart apache?
Or something pretty similar