Current location: Hot Scripts Forums » Programming Languages » PHP » subdoamin creation in php


subdoamin creation in php

Reply
  #1 (permalink)  
Old 09-11-03, 08:31 AM
majumder_sanjay majumder_sanjay is offline
New Member
 
Join Date: Sep 2003
Location: kolkata
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
subdoamin creation in php

Hello everybody

How can I create a subdoamin dynamiccaly using php .
After subdomain creation user homepage will be redirected to the user subdoamin .


Regards

Sanjay
Reply With Quote
  #2 (permalink)  
Old 09-11-03, 08:13 PM
optix's Avatar
optix optix is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Your script would need to be able to access your httpd.conf file on the server and create a virtual host entry. Something like....

<VirtualHost *:80>
DocumentRoot /home/optix/www
DirectoryIndex index.php
ServerAdmin optix@email.com
ServerName sub.mydomain.com
ServerSignature email
</VirtualHost>

OR

under the domain name's Virtual Host entry, just keep adding server aliases....

<VirtualHost *:80>
DocumentRoot /home/optix/www
DirectoryIndex index.php
ServerAdmin optix@email.com
ServerName mydomain.com
ServerAlias sub2.mydomain.com
ServerAlias sub3.mydomain.com
ServerAlias sub4.mydomain.com
ServerAlias sub5.mydomain.com
ServerAlias sub6.mydomain.com
ServerAlias sub7.mydomain.com
ServerSignatureemail
</VirtualHost>


Then close and save the httpd.conf file.

It looks like you'd also need to have the script create a user first, so you, your script would need to be able to execute a few commands, example.....

PHP Code:



exec
("adduser $user"); 

exec("passwd $user");
exec("$userpass");
exec("$userpass"); 
I'm sure there's a more efficient way to do that but you should get what I mean.
__________________
[B] ModernConspiracy.com - Conspiracy Theory Forums (Talk Conspiracy)
DIYAutoForum.com - DIY Auto Forum
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
PHP Dudes - Hi All stuart New Members & Introductions 4 05-03-04 01:22 PM
Custom PHP Scripts BdSBB Job Offers & Assistance 3 12-07-03 09:49 AM
PHP Triad/Upload form eddyvlad PHP 6 10-06-03 11:17 PM
managing linux users from php asinclair PHP 0 09-22-03 06:08 AM


All times are GMT -5. The time now is 07:01 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.