Browse Source

Created Common Functions

old-stable
Mitesh Shah 12 years ago
parent
commit
e107ed8344
  1. 161
      usr/local/sbin/easyengine

161
usr/local/sbin/easyengine

@ -537,7 +537,7 @@ EEPERMISSION()
} }
# NGINX Configuration Function # NGINX Configuration Function
BASICNGINX() SETUPDOMAIN()
{ {
# Check SITENAME Is Empty Or Not # Check SITENAME Is Empty Or Not
EESITENAME EESITENAME
@ -548,6 +548,11 @@ BASICNGINX()
# Setup WordPress Webroot & Database # Setup WordPress Webroot & Database
EEWPSETUP EEWPSETUP
EEWPDBSETUP EEWPDBSETUP
}
PERMISSIONANDGIT()
{
# Change Webroot Permission
EEPERMISSION EEPERMISSION
# Take Nginx Configuration In Git Version Control # Take Nginx Configuration In Git Version Control
@ -558,115 +563,35 @@ BASICNGINX()
TOTALCACHENGINX() TOTALCACHENGINX()
{ {
# Check SITENAME Is Empty Or Not
EESITENAME
# Creating Website $DOMAIN
EEDOMAINSETUP
# Setup WordPress Webroot & Database
EEWPSETUP
EEWPDBSETUP
# Installing W3 Total Cache # Installing W3 Total Cache
cd /var/www/$DOMAIN/htdocs/ cd /var/www/$DOMAIN/htdocs/
wp plugin install w3-total-cache || OwnError "Unable To Install W3 Total Cache Plugin" wp plugin install w3-total-cache || OwnError "Unable To Install W3 Total Cache Plugin"
# Activate W3 Total Cache # Activate W3 Total Cache
wp plugin activate w3-total-cache || OwnError "Unable To Activate W3 Total Cache Plugin" wp plugin activate w3-total-cache || OwnError "Unable To Activate W3 Total Cache Plugin"
# Change Webroot Permission
EEPERMISSION
# Take Nginx Configuration In Git Version Control
EEGITDIR=/etc/nginx
EEGITMESSAGE="Created New $3 $4 Website: $DOMAIN"
EEGITCOMMIT
# Display WordPress Plugin Configuration Message
echo
echo -e "\033[34m Please Configure The Following Settings... \e[0m"
echo -e "\033[34m Permalink Settings: http://$DOMAIN/wp-admin/options-permalink.php \e[0m"
echo -e "\033[34m W3 Total Cache: http://$DOMAIN/wp-admin/admin.php?page=w3tc_general \e[0m"
} }
SUPERCACHENGINX() SUPERCACHENGINX()
{ {
# Check SITENAME Is Empty Or Not
EESITENAME
# Creating Website $DOMAIN
EEDOMAINSETUP
# Setup WordPress Webroot & Database
EEWPSETUP
EEWPDBSETUP
# Installing WP Super Cache # Installing WP Super Cache
cd /var/www/$DOMAIN/htdocs/ cd /var/www/$DOMAIN/htdocs/
wp plugin install wp-super-cache || OwnError "Unable To Install WP Super Cache Plugin" wp plugin install wp-super-cache || OwnError "Unable To Install WP Super Cache Plugin"
# Activate WP Super Cache # Activate WP Super Cache
wp plugin activate wp-super-cache || OwnError "Unable To Activate WP Super Cache Plugin" wp plugin activate wp-super-cache || OwnError "Unable To Activate WP Super Cache Plugin"
# Change Webroot Permission
EEPERMISSION
# Take Nginx Configuration In Git Version Control
EEGITDIR=/etc/nginx
EEGITMESSAGE="Created New $3 $4 Website: $DOMAIN"
EEGITCOMMIT
# Display WordPress Plugin Configuration Message
echo
echo -e "\033[34m Please Configure The Following Settings... \e[0m"
echo -e "\033[34m Permalink Settings: http://$DOMAIN/wp-admin/options-permalink.php \e[0m"
echo -e "\033[34m WP Super Cache: http://$DOMAIN/wp-admin/options-general.php?page=wpsupercache \e[0m"
} }
FASTCGINGINX() NGINXHELPER()
{ {
# Check SITENAME Is Empty Or Not
EESITENAME
# Creating Website $DOMAIN
EEDOMAINSETUP
# Setup WordPress Webroot & Database
EEWPSETUP
EEWPDBSETUP
# Installing WordPress Plugins
cd /var/www/$DOMAIN/htdocs/
# Installing Nginx Helper # Installing Nginx Helper
cd /var/www/$DOMAIN/htdocs/
wp plugin install nginx-helper || OwnError "Unable To Install Nginx Helper" wp plugin install nginx-helper || OwnError "Unable To Install Nginx Helper"
# Activate Nginx Helper # Activate Nginx Helper
wp plugin activate nginx-helper || OwnError "Unable To Activate Nginx Helper Plugin" wp plugin activate nginx-helper || OwnError "Unable To Activate Nginx Helper Plugin"
# Installing W3 Total Cache
wp plugin install w3-total-cache || OwnError "Unable To Install W3 Total Cache Plugin"
# Activate W3 Total Cache
wp plugin activate w3-total-cache || OwnError "Unable To Activate W3 Total Cache Plugin"
# Change Webroot Permission
EEPERMISSION
# Take Nginx Configuration In Git Version Control
EEGITDIR=/etc/nginx
EEGITMESSAGE="Created New $3 $4 Website: $DOMAIN"
EEGITCOMMIT
# Display WordPress Plugin Configuration Message
echo
echo -e "\033[34m Please Configure The Following Settings... \e[0m"
echo -e "\033[34m Permalink Settings: http://$DOMAIN/wp-admin/options-permalink.php \e[0m"
echo -e "\033[34m Nginx Helper: http://$DOMAIN/wp-admin/options-general.php?page=nginx \e[0m"
echo -e "\033[34m W3 Total Cache: http://$DOMAIN/wp-admin/admin.php?page=w3tc_general \e[0m"
} }
# Setup Wordpress Network # Setup Wordpress Network
WPSUBDIRNETWORK() WPSUBDIRNETWORK()
{ {
@ -674,16 +599,12 @@ WPSUBDIRNETWORK()
cd /var/www/$DOMAIN/htdocs || OwnError "Unable To Change Directory" cd /var/www/$DOMAIN/htdocs || OwnError "Unable To Change Directory"
wp core install-network --title="$SITETITLE" || OwnError "Unable To Setup WordPress SubDirectory Network" wp core install-network --title="$SITETITLE" || OwnError "Unable To Setup WordPress SubDirectory Network"
# Remove index.php from http://$DOMAIN/wp-admin/options-permalink.php
# Install Nginx Helper
wp plugin install nginx-helper || OwnError "Unable To Install Nginx Helper Plugin"
# Activate Nginx Helper
wp plugin activate nginx-helper || OwnError "Unable To Activate Nginx Helper Plugin"
sed -i "/WP_DEBUG/a \define('WP_ALLOW_MULTISITE', true);" /var/www/$DOMAIN/wp-config.php sed -i "/WP_DEBUG/a \define('WP_ALLOW_MULTISITE', true);" /var/www/$DOMAIN/wp-config.php
sed -i "/WP_ALLOW_MULTISITE/a \define('WPMU_ACCEL_REDIRECT', true);" /var/www/$DOMAIN/wp-config.php sed -i "/WP_ALLOW_MULTISITE/a \define('WPMU_ACCEL_REDIRECT', true);" /var/www/$DOMAIN/wp-config.php
# Remove index.php from permalink
# Install Nginx Helper
NGINXHELPER
} }
WPSUBDOMAINNETWORK() WPSUBDOMAINNETWORK()
@ -692,16 +613,12 @@ WPSUBDOMAINNETWORK()
cd /var/www/$DOMAIN/htdocs || OwnError "Unable To Change Directory" cd /var/www/$DOMAIN/htdocs || OwnError "Unable To Change Directory"
wp core install-network --title="$SITETITLE" --subdomains || OwnError "Unable To Setup WordPress SubDirectory Network" wp core install-network --title="$SITETITLE" --subdomains || OwnError "Unable To Setup WordPress SubDirectory Network"
# Remove index.php from http://$DOMAIN/wp-admin/options-permalink.php
# Install Nginx Helper
wp plugin install nginx-helper || OwnError "Unable To Install Nginx Helper Plugin"
# Activate Nginx Helper
wp plugin activate nginx-helper || OwnError "Unable To Activate Nginx Helper Plugin"
sed -i "/WP_DEBUG/a \define('WP_ALLOW_MULTISITE', true);" /var/www/$DOMAIN/wp-config.php sed -i "/WP_DEBUG/a \define('WP_ALLOW_MULTISITE', true);" /var/www/$DOMAIN/wp-config.php
sed -i "/WP_ALLOW_MULTISITE/a \define('WPMU_ACCEL_REDIRECT', true);" /var/www/$DOMAIN/wp-config.php sed -i "/WP_ALLOW_MULTISITE/a \define('WPMU_ACCEL_REDIRECT', true);" /var/www/$DOMAIN/wp-config.php
# Remove index.php from permalink
# Install Nginx Helper
NGINXHELPER
} }
@ -1204,7 +1121,8 @@ then
echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF" echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF"
# Setup Basic Nginx # Setup Basic Nginx
BASICNGINX SETUPDOMAIN
PERMISSIONANDGIT
# Display Success Message # Display Success Message
echo echo
@ -1219,7 +1137,15 @@ then
echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF" echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF"
# Setup W3 Total Cahe Nginx # Setup W3 Total Cahe Nginx
SETUPDOMAIN
TOTALCACHENGINX TOTALCACHENGINX
PERMISSIONANDGIT
# Display WordPress Plugin Configuration Message
echo
echo -e "\033[34m Please Configure The Following Settings... \e[0m"
echo -e "\033[34m Permalink Settings: http://$DOMAIN/wp-admin/options-permalink.php \e[0m"
echo -e "\033[34m W3 Total Cache: http://$DOMAIN/wp-admin/admin.php?page=w3tc_general \e[0m"
# Display Success Message # Display Success Message
echo echo
@ -1234,7 +1160,15 @@ then
echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF" echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF"
# Setup WP Super Cahe Nginx # Setup WP Super Cahe Nginx
SETUPDOMAIN
SUPERCACHENGINX SUPERCACHENGINX
PERMISSIONANDGIT
# Display WordPress Plugin Configuration Message
echo
echo -e "\033[34m Please Configure The Following Settings... \e[0m"
echo -e "\033[34m Permalink Settings: http://$DOMAIN/wp-admin/options-permalink.php \e[0m"
echo -e "\033[34m WP Super Cache: http://$DOMAIN/wp-admin/options-general.php?page=wpsupercache \e[0m"
# Display Success Message # Display Success Message
echo echo
@ -1249,7 +1183,17 @@ then
echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF" echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF"
# Setup WP Super Cahe Nginx # Setup WP Super Cahe Nginx
FASTCGINGINX SETUPDOMAIN
NGINXHELPER
TOTALCACHENGINX
PERMISSIONANDGIT
# Display WordPress Plugin Configuration Message
echo
echo -e "\033[34m Please Configure The Following Settings... \e[0m"
echo -e "\033[34m Permalink Settings: http://$DOMAIN/wp-admin/options-permalink.php \e[0m"
echo -e "\033[34m Nginx Helper: http://$DOMAIN/wp-admin/options-general.php?page=nginx \e[0m"
echo -e "\033[34m W3 Total Cache: http://$DOMAIN/wp-admin/admin.php?page=w3tc_general \e[0m"
# Display Success Message # Display Success Message
echo echo
@ -1269,10 +1213,11 @@ then
echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF" echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF"
# Setup Basic Nginx # Setup Basic Nginx
BASICNGINX SETUPDOMAIN
# Setup WordPress SubDirectory Network # Setup WordPress SubDirectory Network
WPSUBDIRNETWORK WPSUBDIRNETWORK
PERMISSIONANDGIT
# Setup phpMyAdmin # Setup phpMyAdmin
ln -s /usr/share/phpmyadmin /var/www/$DOMAIN/htdocs/ ln -s /usr/share/phpmyadmin /var/www/$DOMAIN/htdocs/
@ -1290,14 +1235,22 @@ then
echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF" echo "SITENAMECHECK = $SITENAMECHECK AND NGINXCONF = $NGINXCONF"
# Setup W3 Total Cahe Nginx # Setup W3 Total Cahe Nginx
TOTALCACHENGINX SETUPDOMAIN
# Setup WordPress SubDirectory Network # Setup WordPress SubDirectory Network
WPSUBDIRNETWORK WPSUBDIRNETWORK
TOTALCACHENGINX
PERMISSIONANDGIT
# Setup phpMyAdmin # Setup phpMyAdmin
ln -s /usr/share/phpmyadmin /var/www/$DOMAIN/htdocs/ ln -s /usr/share/phpmyadmin /var/www/$DOMAIN/htdocs/
# Display WordPress Plugin Configuration Message
echo
echo -e "\033[34m Please Configure The Following Settings... \e[0m"
echo -e "\033[34m Permalink Settings: http://$DOMAIN/wp-admin/options-permalink.php \e[0m"
echo -e "\033[34m W3 Total Cache: http://$DOMAIN/wp-admin/admin.php?page=w3tc_general \e[0m"
# Display Success Message # Display Success Message
echo echo
echo -e "\033[34m Successfully Created New $3 $4 Website: http://$DOMAIN \e[0m" echo -e "\033[34m Successfully Created New $3 $4 Website: http://$DOMAIN \e[0m"

Loading…
Cancel
Save