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.

Automation of WHM setup

Discussion in 'cPanel Developers' started by aingeal, Feb 18, 2011.

  1. aingeal

    aingeal Member
    PartnerNOC

    Joined:
    Dec 12, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ann Arbor, Michigan
    I was placed in charge of setting up the automation of cPanel VPS setup. The problem I am having is not with the cPanel setup side of a VPS. The problem I am having is with the initial WHM setup process. I looked through the forums but couldn't seem to find anything related to automating that initial setup (setting the nameservers, A records, IP's, etc.). Currently we do that process manually but looking to move it to a more automated process.

    Could someone point me in the direction of either a script or module that would help with that initial setup?
     
  2. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  3. aingeal

    aingeal Member
    PartnerNOC

    Joined:
    Dec 12, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ann Arbor, Michigan
    Thanks for the link. I ran across that about 2 hours after I made my post. I would not mind some suggestions on how to properly go about doing this. Let me lay out what I am trying to do and see what you think would be a good process.

    The VPS's I need to automate are going to be running on SolusVM (openvz).
    Users will only have cPanel access, no WHM access or sudo/root access of any kind.
    WHMCS will be creating the VPS's through the SolusVM WHMCS module.
    WHM setup will need to be done (which I now know can be done through the wwwacct.conf file)
    cPanel will need to be setup for the user.
    We want to do this in as automated, non-hands on way as we can.

    I'm figuring we setup the VPS template to have cPanel base installed, but not configured.
    A script will update the wwwacct.conf file with the needed "ADDR CONTACTEMAIL HOST NS NS2" information for this user.
    The a script will run passing the information needed to the wwwacct script and create the cpanel account.

    Is there anything I am either missing, or some way that would be a easier process to automate this? If you think this might be better in PM depending on how much detail you might need to get a good idea on how to best try and make this work, thats fine with me as well.
     
  4. bryyyon

    bryyyon Member

    Joined:
    Mar 1, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Pre-installing a template with cPanel is not a good idea.

    You can use the file `/etc/rc.d/rc.local' to execute upon system initialization (boot). Create a designated SolusVM template with an rc.local that performs system package updates, installs cPanel, automates the Getting Started Wizard, creates whatever cPanel account(s) using the XML/JSON API, then removes itself.

    It will only take an hour or two upon provisioning to set itself up.
     
  5. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  6. aingeal

    aingeal Member
    PartnerNOC

    Joined:
    Dec 12, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ann Arbor, Michigan
    That script helped out with getting a lot set. Thank you. However I have one problem I haven't be able to get to work without manually disabling it in WHM. Anonymous FTP. Its disabled in the pure-ftp.conf file, but when the VPS is created, (even though the conf file says not to) its enabled under ftp server configuration, and is available in the users cPanel. How can I make this disabled by default and actually have it disabled?
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    I'm not certain if this is what you are needing, but the template file that determines the settings for the pure-ftpd.conf file is set at /var/cpanel/conf/pureftpd/main location. The settings in that file will be used whenever pure-ftpd is built.
     
  8. aingeal

    aingeal Member
    PartnerNOC

    Joined:
    Dec 12, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ann Arbor, Michigan
    Looks like what I needed was:

    touch /var/cpanel/noanonftp
     
Loading...

Share This Page