tags:

views:

39

answers:

2

Hi, im currently trying to create a php script that when a new user register, a script (eg:wordpress,blog etc..) will install for them.

I'm currently got the code below for just single setup, but how can i setup a form for multi user? which only allowing them to input the username (subdomain) and password.

<?php
class scriptname_Config {

    public static $title = 'new_script_title';

    // Domain name and path where new script will installed in
    public static $domain = 'username.domain.com';
    public static $absolutePath = '/new_register_username/';

    // Settings for general mysql database
    public static $db = array(
        'host' => 'localhost',
        'database' => 'scriptname',
        'user' => 'root',
        'password' => '',
        'prefix' => 'scriptname_'
    );

}

define( 'scriptname_BASE_URL',      'http://'.scriptname_Config::$domain.scriptname_Config::$absolutePath );
?>

Or any tutorial that will help is appreciate! Thanks!

A: 

I guess by subdomains you want something like, user1.wordpress.com; user2.wordpress.com; user3.wordpress.com ?

Well, actually creating subdomains is not really as complicated as it sounds

1, you need to configure your DNS Records to accept wild card entries. this is a good read that might help. wildcard-dns-and-sub-domains

2, define / design your application to support it; where you can filter every incoming request based on the url accessed, and take appropriate actions; display theme; or fetch data; etc.

you might also want to look at opensource, wordpress-mu and status.net both in PHP or the Jaiku.com written in Python on Google AppEngine.

3, configure your webserver appropriately, to accept anyname.mysite.com; and send it your app.

phoenix24
A: 

Checkout Puppet.

You can use it to automate the installation of software, setting up virtual hosts, users, etc.

Example wordpress install via puppet manifest

simplemotives