Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Dev Section 3rd Party Software
  • Search

Domain Script for VestaCP + WHMCS (deploy tool)

Section with additional software for Vesta
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
nosov
Posts: 2
Joined: Thu Oct 27, 2016 5:36 pm

Domain Script for VestaCP + WHMCS (deploy tool)
  • Quote

Post by nosov » Sun Aug 27, 2017 7:58 pm

Hello everyone.
I create tool for install custom wordpress or other cms from whmcs.

Image


First.
You need WHMCS and VestaCP.

Second
Install patched vesta module to whmcs

Code: Select all

cd /home/user/web/whmcs/public_html/modules/server
mkdir vesta
wget https://raw.githubusercontent.com/smlex/DomainScript/master/modules/servers/vesta/vesta.php -O vesta.php


And modify bin/v-add-web-domain. Pls paste this before # Preparing domain aliases

Code: Select all

# Run domain script
if [ -e "$VESTA/data/deploy/v_$domain.sh" ]; then
dos2unix "$VESTA/data/deploy/v_$domain.sh"
chmod +x "$VESTA/data/deploy/v_$domain.sh" 
source "$VESTA/data/deploy/v_$domain.sh" 
  deploy
fi
# Preparing domain aliases
OR replace

Code: Select all

cd /usr/local/vesta/bin/
wget https://raw.githubusercontent.com/smlex/DomainScript/master/vestacp/bin/v-add-web-domain -O v-add-web-domain
P/s. Maybe you need apt-get install dos2unix or yum install dos2unix

Third
Pls setup Module Settings in WHMCS Edit Product. Your script must have function deploy()

Code: Select all

#!/bin/bash
deploy(){
cp /home/robots.txt $HOMEDIR/$user/web/$domain/public_html/robots.txt
chown -R $user:$user $HOMEDIR/$user/web/$domain
chmod 777 $HOMEDIR/$user/web/$domain/public_html/
}
WordPressShow
You can install wp-cli by manual http://wp-cli.org and use in WHMCS DomainScript

Code: Select all

#!/bin/bash
deploy(){
cnpass=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13)
password=$(LC_CTYPE=C tr -dc A-Za-z0-9_\!\@\#\$\%\^\&\*\(\)-+= < /dev/urandom | head -c 12)
password=$cnpass
dbname=${domain//./}
dbname=`echo $dbname | cut -c1-4`
username=$user"_"$dbname
$BIN/v-add-database $user $dbname $dbname $cnpass mysql localhost

rm -rf $HOMEDIR/$user/web/$domain/public_html/*
WPATH=$HOMEDIR"/"$user"/web/"$domain"/public_html/"


WP_CLI="/usr/local/bin/wp --allow-root  --quiet --path="$WPATH
$WP_CLI core download
$WP_CLI core config --dbname=$username --dbuser=$username --dbpass=$cnpass
$WP_CLI db create
$WP_CLI core install --url="http://$domain/" --title="$domain" --admin_user="$user" --admin_password="$password" --admin_email="[email protected]"
$WP_CLI plugin install drafts-scheduler --activate
$WP_CLI plugin install cybersyn --activate
$WP_CLI plugin install rss-post-importer --activate

cp /home/robots.txt $HOMEDIR/$user/web/$domain/public_html/robots.txt
chown -R $user:$user $HOMEDIR/$user/web/$domain
chmod 777 $HOMEDIR/$user/web/$domain/public_html/

log_history "Install wp. <a target="_black" href="http://$domain/wp-admin">$domain</a>  $user:$password db $username  $cnpass  "
}

So, you can add more whmcs products for combination wp themes and plugins.


GitRepo: https://github.com/smlex/DomainScript
Top

Phogo
Posts: 60
Joined: Fri Dec 09, 2016 12:40 pm

Os: CentOS 6x
Web: nginx + php-fpm
Re: Domain Script for VestaCP + WHMCS (deploy tool)
  • Quote

Post by Phogo » Mon Aug 28, 2017 10:13 am

Looks great! Thank you will give it a go later.
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “3rd Party Software”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password