Skip to content

Instantly share code, notes, and snippets.

@JeremyMorgan
Last active December 25, 2015 19:49
Show Gist options
  • Save JeremyMorgan/7030833 to your computer and use it in GitHub Desktop.
Save JeremyMorgan/7030833 to your computer and use it in GitHub Desktop.
Single Script to install Magento from a base Ubuntu 13.04 install. Works on Azure VM. Does require minimal interaction.
#!/bin/sh
# These are for creation of the database
DBNAME="yourdbname"
DBUSER="yourdbuser"
DBPASS="yourdbpassword"
# Setup stuff for MariaDB
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu raring main'
sudo apt-get update
#Install Web Server
sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5
sudo apt-get install php5-mysql
sudo apt-get install mariadb-server
sudo apt-get install php5-mysql php5-curl php5-mcrypt php5-gd php5-common php-apc
#Get and install Magento
cd /var/www
sudo wget http://www.jeremymorgan.com/hosted/magento-1.8.0.0.tar.gz
sudo tar -zxvf magento-1.8.0.0.tar.gz
sudo mv magento/* magento/.htaccess .
# set the permissions
sudo chmod -R o+w media var
sudo chmod o+w app/etc
#create our database
sudo mysql_secure_installation
echo "CREATE DATABASE $DBNAME; CREATE USER $DBUSER identified by '$DBPASS'; GRANT SELECT, INSERT, CREATE, ALTER, UPDATE, DELETE, LOCK TABLES on $DBNAME.* to $DBUSER;" > create.sql
mysql -u root -p < create.sql
#restart
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart
sudo rm index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment