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!
subdomain creation
Moderator: General Moderators
-
reverend_ink
- Forum Contributor
- Posts: 151
- Joined: Sun Apr 20, 2003 1:18 am
- Location: Las Vegas | London
-
reverend_ink
- Forum Contributor
- Posts: 151
- Joined: Sun Apr 20, 2003 1:18 am
- Location: Las Vegas | London
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
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
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
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.
You then need to restart apache for it to read the new config - and you have your sub-domain.
-
reverend_ink
- Forum Contributor
- Posts: 151
- Joined: Sun Apr 20, 2003 1:18 am
- Location: Las Vegas | London
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
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