Skip to content

Instantly share code, notes, and snippets.

@ellipsonic
Last active September 19, 2015 16:57
Show Gist options
  • Save ellipsonic/807f87ce2bd40d0f4539 to your computer and use it in GitHub Desktop.
Save ellipsonic/807f87ce2bd40d0f4539 to your computer and use it in GitHub Desktop.
Unattended Lampp Ubuntu 14.04 LTS
#!/bin/bash
#Instructions to use this script
#
#chmod +x SCRIPTNAME.sh
#
#sudo ./SCRIPTNAME.sh
echo "###################################################################################"
echo "Please be Patient: Installation will start now.......and it will take some time :)"
echo "###################################################################################"
#Update the repositories
sudo apt-get update
#Apache, Php, MySQL and required packages installation
sudo apt-get -y install apache2 php5 libapache2-mod-php5 php5-mcrypt php5-curl php5-mysql php5-gd php5-cli php5-dev mysql-client
php5enmod mcrypt
#The following commands set the MySQL root password to root when you install the mysql-server package.
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get -y install git
sudo apt-get -y install mysql-server
mysql -u root -e "CREATE DATABASE IF NOT EXISTS orangehrm2" -proot
# Git all mysql files
cd /tmp
git clone https://github.com/ellipsonic/orangehrm_db.git .
mysql -u root orangehrm2 < /tmp/orangehrm_mysql.sql -proot
# Allow any server to connect
sed -i "s/bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION" | mysql -u root -proot
#Restart all the installed services to verify that everything is installed properly
echo -e "\n"
service apache2 restart && service mysql restart > /dev/null
echo -e "\n"
if [ $? -ne 0 ]; then
echo "Please Check the Install Services, There is some $(tput bold)$(tput setaf 1)Problem$(tput sgr0)"
else
echo "Installed Services run $(tput bold)$(tput setaf 2)Sucessfully$(tput sgr0)"
fi
echo -e "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment