├── Apache ├── clear-pagespeed-cache.sh ├── create-apache2-site.sh └── install-apache2-mods.sh ├── LICENSE.txt ├── Linux ├── change-dns.sh ├── install-essntials.sh ├── install-lamp.sh ├── install-oh-my-zsh.sh └── install-webmin.sh ├── Mysql ├── create-new-db.sh ├── create-new-user.sh └── full-backup.sh ├── Php └── install_modules.sh ├── README.md └── lazy-lamp.sh /Apache/clear-pagespeed-cache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Clears the Google Apache Mod-PageSpeed cache automtically 4 | # 5 | # @aymanrb - 2015 / 01 / 10 6 | # Inspired by: http://benohead.com/mod_pagespeed-clear-the-cache/ 7 | # 8 | 9 | sudo -v 10 | 11 | if apache2ctl -M | grep "pagespeed"; then 12 | 13 | sudo touch `grep "^ *ModPagespeedFileCachePath" /etc/apache2/mods-enabled/pagespeed.conf | awk ' { print $2; } ' | sed 's/"//g'`/cache.flush 14 | 15 | echo "Done, Pagespeed caches have been flushed and will be recreated on your next web access" 16 | 17 | else 18 | 19 | echo "Pagespeed Apache Module is not loaded. Visit: https://developers.google.com/speed/pagespeed/module for more info" 20 | 21 | fi 22 | -------------------------------------------------------------------------------- /Apache/create-apache2-site.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Script to automate creating new apache2 site on a linux server with LAMP configurations 4 | # 5 | # @aymanrb - 2014 / 07 / 01 6 | # 7 | 8 | sudo -v 9 | 10 | read -p "Enter the domain name you would like to use to access the new site (e.g. example.local): " DomainName 11 | 12 | if [[ ! $DomainName ]]; then 13 | echo "Error: Apache needs a domainname to configure your website"; 14 | exit 15 | fi 16 | 17 | read -p "Enter path to the document root of the new site (e.g. $HOME/www/$DomainName):" SiteDirectory 18 | 19 | if [[ ! $SiteDirectory ]]; then 20 | SiteDirectory="$HOME/www/$DomainName" 21 | fi 22 | 23 | read -p "Enter ServerAdmin email (Optional): " ServerAdminMail 24 | 25 | if [[ ! $ServerAdminMail ]]; then 26 | ServerAdminMail="info@$DomainName" 27 | fi 28 | 29 | if [ -d /etc/apache2/sites-available/$DomainName ]; then 30 | echo "Error: This site is already configured using $DomainName"; 31 | exit 32 | fi 33 | 34 | echo "Creating Apache Site Configuration File" 35 | echo " 36 | ServerName $DomainName 37 | ServerAlias www.$DomainName 38 | DocumentRoot $SiteDirectory 39 | LogLevel warn 40 | ErrorLog /var/log/apache2/$DomainName/error.log 41 | CustomLog /var/log/apache2/$DomainName/access.log combined 42 | ServerAdmin $ServerAdminMail 43 | 44 | Options FollowSymLinks 45 | AllowOverride All 46 | Require all granted 47 | 48 | " | sudo tee /etc/apache2/sites-available/$DomainName.conf > /dev/null 49 | 50 | echo "Creating Log File Directory" 51 | sudo mkdir /var/log/apache2/$DomainName 52 | 53 | if [ ! -d $SiteDirectory ]; then 54 | mkdir $SiteDirectory; 55 | echo "

Welcome to $DomainName

" > $SiteDirectory/index.php 56 | fi 57 | 58 | echo "Creating Hosts Localhost value" 59 | sudo echo "127.0.0.1 $DomainName" | sudo tee -a /etc/hosts > /dev/null 60 | 61 | echo "Enabling Site & Reloading Apache (edit /etc/apache2/sites-available/$DomainName.conf for more options)" 62 | sudo a2ensite $DomainName.conf 63 | sudo /etc/init.d/apache2 reload 64 | 65 | echo "Done, please browse to http://$DomainName to access your new site :)" 66 | -------------------------------------------------------------------------------- /Apache/install-apache2-mods.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Installs few apache2 modules we usually need (Mod-ReWrite / ModPageSpeed) 4 | # 5 | # @aymanrb - 2015 / 04 / 07 6 | # 7 | 8 | sudo -v 9 | 10 | echo "Installing Apache2 ReWrite Module" 11 | sudo a2enmod rewrite 12 | 13 | 14 | echo "Download Apache2 Google Mod-PageSpeed" 15 | cd /usr/local/src 16 | wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb 17 | apt-get -f install 18 | dpkg -i mod-pagespeed-*.deb 19 | 20 | echo "Restarting Apache2 Service" 21 | sudo service apache2 restart 22 | 23 | 24 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Ayman R. Bedair (aymanrb.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Linux/change-dns.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | #Script to automate the DNS server changes to a list of Free & Public DNS Servers 4 | # 5 | # @aymanrb - 2014 / 12 / 25 6 | # 7 | declare -A servers 8 | 9 | servers["Google.primary"]="8.8.8.8" 10 | servers["Google.secondary"]="8.8.4.4" 11 | 12 | servers["DnsWatch.primary"]="84.200.69.80" 13 | servers["DnsWatch.secondary"]="84.200.70.40" 14 | 15 | servers["OpenDNS.primary"]="208.67.222.222" 16 | servers["OpenDNS.secondary"]="208.67.220.220" 17 | 18 | servers["OpenDNSFamilyShield.primary"]="208.67.222.123" 19 | servers["OpenDNSFamilyShield.secondary"]="208.67.220.123" 20 | 21 | servers["ComodoSecure.primary"]="8.26.56.26" 22 | servers["ComodoSecure.secondary"]="8.20.247.20" 23 | 24 | servers["Cloudflare.primary"]="1.1.1.1" 25 | servers["Cloudflare.secondary"]="1.0.0.1" 26 | 27 | 28 | declare -A serverIndex 29 | serverIndex[1]="Google" 30 | serverIndex[2]="DnsWatch" 31 | serverIndex[3]="OpenDNS" 32 | serverIndex[4]="OpenDNSFamilyShield" 33 | serverIndex[5]="ComodoSecure" 34 | serverIndex[6]="Cloudflare" 35 | 36 | 37 | for i in "${!serverIndex[@]}" 38 | do 39 | echo "Code: '$i' from ${serverIndex[$i]}" 40 | done 41 | 42 | echo " 43 | ===================================================== 44 | " 45 | 46 | read -p "Select a server from the list above to apply its settings [1-5] (e.g. 3): " applyServer 47 | 48 | echo " 49 | 50 | Applying your selection. (${serverIndex[$applyServer]} Server(s)) 51 | 52 | ......................... 53 | " 54 | 55 | echo "nameserver ${servers["${serverIndex[$applyServer]}.primary"]}" | sudo tee /etc/resolvconf/resolv.conf.d/head 56 | echo "nameserver ${servers["${serverIndex[$applyServer]}.secondary"]}" | sudo tee -a /etc/resolvconf/resolv.conf.d/head 57 | 58 | sudo resolvconf -u 59 | 60 | echo "DNS Changes applied successfully !" 61 | 62 | 63 | -------------------------------------------------------------------------------- /Linux/install-essntials.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Script to automate the installation of few essential tools for Linux (Vim / CURL / GIT / Composer) 4 | # 5 | # @aymanrb - 2014 / 07 / 21 6 | # 7 | 8 | sudo -v 9 | 10 | echo "Installing VIM ..." 11 | sudo apt-get install vim 12 | 13 | echo "Installing CURL ..." 14 | sudo apt-get install curl 15 | 16 | echo "Installing GIT ..." 17 | sudo apt-get install git 18 | 19 | read -p "Enter the email address of the Global GIT User: " MainUserMail 20 | read -p "Enter the User name of the Global GIT User: " MainUserName 21 | 22 | sudo git config --global user.email $MainUserMail 23 | sudo git config --global user.name $MainUserName 24 | 25 | echo "Installing Composer ..." 26 | sudo apt-get install php5-cli 27 | curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer 28 | 29 | echo "Done !" 30 | -------------------------------------------------------------------------------- /Linux/install-lamp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Script to automate the installation of Apache, PHP5, MySQl and PhpMyAdmin 4 | # 5 | # @aymanrb - 2014 / 07 / 01 6 | # 7 | sudo -v 8 | 9 | read -p "Enter the password you desire for the root MySQL username (e.g. root): " MySqlPass 10 | 11 | echo "Installing apache2 ..." 12 | sudo apt-get update 13 | sudo apt-get -y install apache2 14 | 15 | echo "Installing PHP5 ..." 16 | sudo apt-get -y install php7.0 libapache2-mod-php7.0 17 | 18 | echo "Restarting Apache2 Server ..." 19 | sudo /etc/init.d/apache2 restart 20 | 21 | echo "Installing MySQL Server" 22 | echo mysql-server-5.1 mysql-server/root_password password $MySqlPass | debconf-set-selections 23 | echo mysql-server-5.1 mysql-server/root_password_again password $MySqlPass | debconf-set-selections 24 | sudo apt-get install -y mysql-server 25 | 26 | echo "Installing PhpMyAdmin ..." 27 | sudo apt-get install phpmyadmin 28 | 29 | echo "#Phpmyadmin 30 | Include /etc/phpmyadmin/apache.conf" | sudo tee -a /etc/apache2/apache2.conf > /dev/null 31 | 32 | echo "Restarting Apache2 Server ..." 33 | sudo /etc/init.d/apache2 restart 34 | 35 | echo "You can now access your local apache server @ http://localhost & PhpMyadmin @ http://localhost/phpmyadmin" 36 | -------------------------------------------------------------------------------- /Linux/install-oh-my-zsh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Script to install oh-my-zsh shell 4 | # 5 | # @aymanrb - 2015 / 04 / 07 6 | # 7 | 8 | sudo -v 9 | 10 | echo "Installing prerequisites ..." 11 | sudo apt-get install zsh git-core curl 12 | 13 | echo "Installing ohmyzsh" 14 | sudo curl -L http://install.ohmyz.sh | sh 15 | 16 | sudo chsh -s /usr/bin/zsh $(whoami) 17 | 18 | echo "Done ! Oh-my-zsh will be your default shell on your next reboot" 19 | -------------------------------------------------------------------------------- /Linux/install-webmin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Script to automate the installation of webmin (http://www.webmin.com) for lazy devs 4 | # 5 | # @aymanrb - 2014 / 07 / 01 6 | # 7 | 8 | # Set up a repo and install 9 | echo "Beginning Installation of Webmin" 10 | 11 | echo "deb http://download.webmin.com/download/repository sarge contrib" >> /etc/apt/sources.list 12 | echo "deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib" >> /etc/apt/sources.list 13 | wget -q http://www.webmin.com/jcameron-key.asc 14 | apt-key add jcameron-key.asc > /dev/null 2>&1 15 | rm -f jcameron-key.asc 16 | apt-get -q update > /dev/null 2>&1 17 | apt-get -q -y install webmin > /dev/null 2>&1 18 | ufw allow 10000 > /dev/null 2>&1 19 | 20 | echo "Webmin installation complete" 21 | echo "Webmin is using the same username and password you are currently logged in with to linux" 22 | echo "You can access it by visiting http://localhost:10000" 23 | -------------------------------------------------------------------------------- /Mysql/create-new-db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Script to create a new database 4 | # @aymanrb - 2014 / 08 / 02 5 | # 6 | 7 | read -p "Enter the new database name (e.g. test): " DbName 8 | 9 | echo "-----ROOT Access Required--------" 10 | echo -n "Enter the password for the root MySQL username (e.g. AdminPsswd): " 11 | read -s MySqlRootPass 12 | 13 | echo "" 14 | 15 | echo "CREATE DATABASE $DbName;" | mysql --user=root --password=$MySqlRootPass mysql 16 | 17 | echo "Done: $DbUserName was successfylly created" 18 | -------------------------------------------------------------------------------- /Mysql/create-new-user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Script to create a new database user 4 | # @aymanrb - 2014 / 08 / 02 5 | 6 | read -p "Enter the new database user name (e.g. dbuser): " DbUserName 7 | 8 | if [[ ! $DbUserName ]]; then 9 | echo "Error: A username must be specified. Aren't you creating a new user after all :S !"; 10 | exit 11 | fi 12 | 13 | echo -n "Enter a password to use for the MySQL username[$DbUserName] (e.g. UsrPsswd):" 14 | read -s Psswd 15 | 16 | echo "" 17 | 18 | echo -n "Confirm '$DbUserName' password (Retype the password):" 19 | read -s ConfPsswd 20 | 21 | echo "" 22 | 23 | if [ $Psswd != $ConfPsswd ]; then 24 | echo "Error: Password for user $DbUserName didn't match" 25 | exit 26 | fi 27 | 28 | echo "-----ROOT Access Required--------" 29 | echo -n "Enter the password for the root MySQL username (e.g. AdminPsswd): " 30 | read -s MySqlRootPass 31 | 32 | echo "" 33 | 34 | echo "CREATE USER '$DbUserName'@'localhost' IDENTIFIED BY '$Psswd'; GRANT ALL PRIVILEGES ON * . * TO '$DbUserName'@'localhost'; FLUSH PRIVILEGES;" | mysql --user=root --password=$MySqlRootPass mysql 35 | 36 | echo "Done creating new user $DbUserName" 37 | -------------------------------------------------------------------------------- /Mysql/full-backup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Script to automate the Sql dumping of all MySQL databases 4 | # 5 | # @aymanrb - 2014 / 07 / 03 6 | # 7 | 8 | sudo -v 9 | 10 | read -p "Enter the username of your MySQL Database (e.g. admin): " MySqlUsername 11 | echo -n "Enter the password for the MySQL user[$MySqlUsername] (e.g. AdminPsswd): " 12 | read -s MySqlPass 13 | 14 | 15 | # LOG FILE 16 | BACKUP_LOG_DIR=/var/log 17 | BACKUP_LOG_FILE=$BACKUP_LOG_DIR/mysql_backup.log 18 | if [ ! -d $BACKUP_LOG_DIR ]; then 19 | sudo mkdir $BACKUP_LOG_DIR 20 | touch BACKUP_LOG_FILE 21 | fi 22 | 23 | # Backup Dir 24 | BACKUP_DIR=/var/mysql_backup/ 25 | if [ ! -d $BACKUP_DIR ]; then 26 | sudo mkdir $BACKUP_DIR 27 | fi 28 | 29 | echo "------------------------------------" | sudo tee -a $BACKUP_LOG_FILE > /dev/null 30 | echo "Starting daily backup at `date`" | sudo tee -a $BACKUP_LOG_FILE > /dev/null 31 | 32 | # Backup databases 33 | for db in $(mysql -u$MySqlUsername -p$MySqlPass -N -e 'show databases' | grep -Ev "mysql|information_schema|performance_schema") 34 | do 35 | mysqldump -u$MySqlUsername -p$MySqlPass --single-transaction $db | sudo gzip -1 | sudo tee $BACKUP_DIR$db-`date +%y%m%d%H%M`.sql.gz 2 | sudo tee -a $BACKUP_LOG_FILE > /dev/null 36 | done 37 | 38 | sudo echo "Daily backup done at `date`." | sudo tee -a $BACKUP_LOG_FILE > /dev/null 39 | -------------------------------------------------------------------------------- /Php/install_modules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Script to automate the installation of few essential PHP5 modules 4 | # 5 | # @aymanrb - 2014 / 07 / 20 6 | # 7 | sudo -v 8 | 9 | sudo apt-get update 10 | 11 | echo "Installing Curl for PHP ..." 12 | sudo apt-get install php-curl 13 | 14 | echo "Installing IMAP function for PHP ..." 15 | sudo apt-get install php-imap 16 | 17 | echo "Installing Mcrypt" 18 | sudo apt-get install mcrypt php-mcrypt 19 | sudo phpenmod mcrypt 20 | 21 | echo "Restarting Apache2 Server ..." 22 | sudo /etc/init.d/apache2 restart 23 | 24 | echo "Done !" 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Linux, Apache, MySQL, PHP (LAMP) tasks automation scripts 2 | 3 | If you are a "Lazy LAMP" developer who wants to run few script to get things done with no pain, then this repository is for you. This is a collection of few scripts (that I'll keep adding to) that automates few installation commands and tasks for your LAMP environment. 4 | 5 | These script assumes few things up: 6 | 7 | 1. You have root access to the server / machine you are running the scripts on (You will be asked for the root password when needed) 8 | 2. You are running these scripts on a Debian Linux distribution (Eg. Ubuntu) 9 | 10 | 11 | ### Install: 12 | 13 | 1. Check a clone of this repo: `git clone https://github.com/aymanrb/lazy-lamp.git` 14 | 2. Run `echo "alias lazy-lamp=\"sudo bash $PWD/lazy-lamp/lazy-lamp.sh\"" | tee -a ~/.bashrc` (To create an easy access alias of the main script, if you are using ZSH instead of bash you should replace the file with `~/.zshrc` instead of ~/.bashrc) 15 | 3. Run `lazy-lamp` or `bash /path/to/lazy-lamp/lazy-lamp.sh` and select your desired script from the index list to run. 16 | 17 | ### Usage: 18 | Run `lazy-lamp` and select the script you wish to run from the list of available scripts. 19 | 20 | # Lazy Lamp Scripts Overview: 21 | 22 | ## [L]inux 23 | ### L1. Install Lamp Server: 24 | 25 | If you don't have the LAMP server components installed yet and is lazy to manually install each of the components running this script will only prompt you to enter the root MySQL password you wish to use and will do the rest for for you. It'll also install Phpmyadmin for your convenience. 26 | 27 | 28 | ### L2. Install Webmin Script: 29 | 30 | If you are familiar with Webmin (http://www.webmin.com) and would like to have it installed for easier management of your server you can run the following script 31 | 32 | ### L3. Install Linux Handy Tools: 33 | 34 | A script that automates the installation of Vim, Curl, Composer and GIT. 35 | 36 | ### L4. Change DNS Server: 37 | 38 | A script that helps in changing the machine's DNS server to a list of Free ones. (Google, OpenDNS, DnsWatch, etc ...) 39 | 40 | ### L5. Install oh-my-zsh shell: 41 | 42 | A script that helps in installing oh-my-zsh shell (http://www.ohmyz.sh/) 43 | 44 | 45 | 46 | ## [A]pache 47 | ### A1. New Site Creation: 48 | 49 | Automates the process of adding new sites by creating virtual hosts in your apache2 server configurations, activates it and adds the new site's domain to the hosts file of your system. 50 | 51 | ### A2. Install and Enable Basic Modules 52 | 53 | A script that automates the process of installing the basic apache2 modules 54 | 55 | ### A3. Clear Pagespeed Cache 56 | 57 | Automates the process of flushing up the cache directories of the Google PageSpeed apache module. 58 | 59 | ## [M]ySQL 60 | ### M1. Full MySQL Database Backup: 61 | 62 | Automates the dumping of the whole MySQL database in one since command and stores the dumped files on a local directory 63 | 64 | ### M2. Create a New Database: 65 | 66 | Creates a new empty MySQL database 67 | 68 | ### M3. Create a New User: 69 | 70 | Creates a new MySQL user and grants this user global 'ALL PRIVILEGES' 71 | 72 | ## [P]HP 73 | ### P1. Install Useful PHP5 Modules: 74 | 75 | Installs PHP modules like Curl and Imap 76 | -------------------------------------------------------------------------------- /lazy-lamp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # All scripts accessible from one single script execution. The whole Lazy Lamp thing 4 | # 5 | # @aymanrb - 2014 / 07 / 21 6 | # 7 | sudo -v 8 | 9 | ScriptBaseDir=`dirname "$BASH_SOURCE"` 10 | 11 | echo " 12 | 13 | ** Welcome to the Lazy-LAMP for Lazy Developers ! ** 14 | 15 | LAMP Scripts to Choose From: 16 | 17 | [L]inux: 18 | 1- Install Environment (Apache2 | PHP5 | MySQL) 19 | 2- Install Webmin Panel 20 | 3- Install Essntial Tools (VIM | GIT) 21 | 4- Change Machine's DNS Server 22 | 5- Install 'Oh-my-Zsh' 23 | 24 | [A]pache: 25 | 1- Create a new website 26 | 2- Install / Enable Essential Modules 27 | 3- Clear Google Pagespeed Module Cache 28 | 29 | [M]ySQL: 30 | 1- Create a Full Backup 31 | 2- Create a New MySQL Database 32 | 3- Create a New MySQL User 33 | 34 | [P]hp: 35 | 1- Install Handy Modules (CURL | IMAP) 36 | " 37 | 38 | read -p "Choose an action to do from the index above (e.g. A1): " UserChoice 39 | 40 | 41 | if [[ $UserChoice ]]; then 42 | echo "Running $UserChoice script(s)..." 43 | fi 44 | 45 | case "$UserChoice" in 46 | 47 | L1) echo ".$ScriptBaseDir/Linux/install-lamp.sh" 48 | sudo bash $ScriptBaseDir/Linux/install-lamp.sh 49 | ;; 50 | L2) echo ".$ScriptBaseDir/Linux/install-webmin.sh" 51 | sudo bash $ScriptBaseDir/Linux/install-webmin.sh 52 | ;; 53 | L3) echo ".$ScriptBaseDir/Linux/install-essntials.sh" 54 | sudo bash $ScriptBaseDir/Linux/install-essntials.sh 55 | ;; 56 | L4) echo ".$ScriptBaseDir/Linux/change-dns.sh" 57 | sudo bash $ScriptBaseDir/Linux/change-dns.sh 58 | ;; 59 | 60 | L5) echo ".$ScriptBaseDir/Linux/install-oh-my-zsh.sh" 61 | sudo bash $ScriptBaseDir/Linux/install-oh-my-zsh.sh 62 | ;; 63 | A1) echo ".$ScriptBaseDir/Apache/create-apache2-site.sh" 64 | sudo bash $ScriptBaseDir/Apache/create-apache2-site.sh 65 | ;; 66 | A2) echo ".$ScriptBaseDir/Apache/install-apache2-mods.sh" 67 | sudo bash $ScriptBaseDir/Apache/install-apache2-mods.sh 68 | ;; 69 | A3) echo ".$ScriptBaseDir/Apache/clear-pagespeed-cache.sh" 70 | sudo bash $ScriptBaseDir/Apache/clear-pagespeed-cache.sh 71 | ;; 72 | M1) echo ".$ScriptBaseDir/Mysql/full-backup.sh" 73 | sudo bash $ScriptBaseDir/Mysql/full-backup.sh 74 | ;; 75 | M2) echo ".$ScriptBaseDir/Mysql/create-new-db.sh" 76 | sudo bash $ScriptBaseDir/Mysql/create-new-db.sh 77 | ;; 78 | M3) echo ".$ScriptBaseDir/Mysql/create-new-user.sh" 79 | sudo bash $ScriptBaseDir/Mysql/create-new-user.sh 80 | ;; 81 | P1) echo ".$ScriptBaseDir/Php/create-apache2-site.sh" 82 | sudo bash $ScriptBaseDir/Php/install_modules.sh 83 | ;; 84 | *) echo "Unknown or missing Lazy-LAMP script '$UserChoice'" 85 | ;; 86 | esac 87 | --------------------------------------------------------------------------------