Last active
June 13, 2017 05:11
-
-
Save ellipsonic/4a4e3af09302b0d10271 to your computer and use it in GitHub Desktop.
Magento
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
apt-get update | |
apt-get -y install sudo | |
apt-get -y install nano | |
sudo apt-get update | |
#Apache, Php, MySQL and required packages installation | |
sudo apt-get -y install apache2 | |
sudo apt-get -y install php5 | |
sudo apt-get -y install libapache2-mod-php5 | |
sudo apt-get -y install php5-mcrypt | |
sudo apt-get -y install php5-curl | |
sudo apt-get -y install php5-mysql | |
sudo apt-get -y install php5-gd | |
sudo apt-get -y install php5-cli | |
sudo apt-get -y install php5-dev | |
sudo apt-get -y install mysql-client | |
sudo apt-get -y install php5enmod | |
sudo apt-get -y install php5-mcrypt | |
sudo apt-get -y install curl | |
sudo apt-get -y install git | |
#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 mysql-server | |
# Create DB | |
echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION" | mysql -u root -proot | |
echo "GRANT PROXY ON ''@'' TO 'root'@'%' WITH GRANT OPTION" | mysql -u root -proot | |
mysql -u root -e "CREATE DATABASE IF NOT EXISTS magento_5" -proot | |
mysql -u root -e "GRANT ALL PRIVILEGES ON magento_5.* TO 'root'@'localhost' IDENTIFIED BY 'root'" -proot | |
mysql -u root -e "FLUSH PRIVILEGES" -proot | |
sleep 15s | |
# Git all mysql files | |
cd /tmp | |
git clone https://github.com/ellipsonic/magekart_db.git . | |
mysql -u root magento_5 < /tmp/magento_5.sql -proot | |
# Cleanup the default HTML file created by Apache | |
rm -f /usr/share/apache2/default-site/index.html | |
rm -f /var/www/index.html | |
# Git all php files | |
git clone https://github.com/ellipsonic/magekart_app.git . | |
chmod -R o+w media | |
chmod 755 mage | |
cd errors | |
mv local.xml.sample local.xml | |
sudo -y apt-get install php5-gd php5-mysql | |
sudo service apache2 restart | |
cd /var/www/errors | |
mv local.xml local.xml.sample | |
# Publish result | |
a2enmod rewrite | |
sudo service apache2 restart | |
#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 | |
arch_add=$(hostname -i) | |
echo "USE magento_5;update core_config_data set value = 'http://$arch_add/' where path = 'web/unsecure/base_url';" | mysql -u root -proot | |
echo "USE magento_5;update core_config_data set value = 'https://$arch_add/' where path = 'web/secure/base_url';" | mysql -u root -proot | |
clear | |
echo "All set, please check the below URL on your browser" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apache, Mysql Installation without intervention. git clone's the sql and php files and uploads the database...