The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to create a new account with wordpress on it ?

Discussion in 'General Discussion' started by Interdit, Mar 29, 2007.

  1. Interdit

    Interdit Well-Known Member

    Joined:
    May 27, 2003
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    A reseller customer wants to install for students an account with a default installation of Wordpress ?

    Any idea on how to do that ?

    Thanks a lot,
    Francois
     
  2. Interdit

    Interdit Well-Known Member

    Joined:
    May 27, 2003
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Anyone ?

    Thanks,
    Francois
     
  3. _Sam_

    _Sam_ Well-Known Member

    Joined:
    Feb 24, 2007
    Messages:
    79
    Likes Received:
    0
    Trophy Points:
    6
    Get your reseller to put the contents of the wordpress install in the "cpanel3-skel" folder, you will find it in his accuonts root :)
     
  4. Interdit

    Interdit Well-Known Member

    Joined:
    May 27, 2003
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    Thanks for your answer,

    But this won't install the database of wordpress. I would like a site ready to be used with something like admin, admin the default pass.

    Thanks,
    Francois
     
  5. Interdit

    Interdit Well-Known Member

    Joined:
    May 27, 2003
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Any 3rd party script on the market could do that ?
     
  6. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    you should put the wordpress files in the cpanel3-skel as was suggested below, then you can make a script called "/scripts/postwwwacctuser" which cpanel executes after creating a new user account... in there you can run whatever you want.. the configuration below is simple and just runs an external "addwordpress" script.

    in the addwordpress script, create a database user and database for this account:
    I have NOT tested the below, but I grabbed some code from the cpanel scripts and I reasonably believe this should do what you want.. if you find you need to tweak it... post your modifications back here for people
    --also, you may want to add some checks in postwwwacctuser to make sure this account SHOULD have the wordpress db created, otherwise, you'll be creating this for every new account. (if you use /scripts/postwwacct instead of postwwwacctuser, you get more information including, I believe, the reseller, so you can put in a check for that and just add the wordpress for particular reseller accounts)


    /scripts/postwwwacctuser:
    #!/bin/sh
    /scripts/postwwwacctuser $1

    /scripts/addwordpress:
    #!/bin/sh
    #
    # this will create a DB user similar to: username_wordpress with the
    # admin user: username_wpadmin with password: admin
    # this naming convention is required in order for the user to properly use
    # phpmyadmin and for cpanel to manage the proper databases when backing
    # up and deleting users
    #
    user=$1;
    hostname=`hostname`;
    if [ -e "/usr/bin/mysql" ]; then
    mysql='/usr/bin/mysql'
    mysqladmin='/usr/bin/mysqladmin'
    else
    mysql='/usr/local/bin/mysql'
    mysqladmin='/usr/local/bin/mysqladmin'
    fi

    /scripts/mysqladduserdb $user_wpadmin 'admin'
    $mysqladmin-u root <<END_OF_DATA
    create database $user_wordpress
    GRANT ALL ON $user_wordpress.* TO $user_wpadmin@localhost
    GRANT ALL ON $user_wordpress.* TO $user_wpadmin@$hostname
    END_OF_DATA
    $mysqladmin -u root reload <<EOM
    EOM
     
Loading...

Share This Page