Forum archive
TKLPatch for Magento
If you're thinking on launching an online store, Magento is one of the most popular options out there. This TKLPatch will convert turnkey core into a complete, feature-rich ecommerce platform ready to begin working on your online store!
Features
Latest version of Magento (1.4.1.1)
http and https access configured (admin areas uses https)
setupdomain script to easily set up your domain once you are ready to go live. (Convenience)
Default user: admin
Default password: turnkey123
To change default settings used during installation, once you got your appliance running, just go to https://your-ip/admin. Log in and you can change the settings in:
System->My Account (User and password)
System->Configuration->General->Locale options (For locale options)
System->Configuration->Currency Setup->Currency Options (For default currency)
What it does
1. Sets Hostname to magento
HOSTNAME=magento echo "$HOSTNAME" > /etc/hostname sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts hostname magento
2.Update package information
apt-get update
3. Install required packages
install apache2 php5 mysql-server php5-curl php5-gd php5-mcrypt php5-mysql php-apc postfix php5-cli
4. Extract magento from the previously overlayed tar.gz. (I couldn't find a direct download url for this one). Move it to /var/www
cd /usr/local/src/ tar xzf magento-1.4.1.1.tar.gz mv magento/ /var/www
5. Create database and user
mysqladmin -u root create magento mysql -u root <<-END_PRIVS GRANT ALL PRIVILEGES ON magento.* TO magento@localhost IDENTIFIED BY "magento"; flush privileges; END_PRIVS
6. Set some permissions required for installation
chmod 777 /var/www/magento/app/etc/ chmod 777 /var/www/magento/var/ chmod -R 777 /var/www/magento/media/
7. Sets cron job required for some magento features.
echo "*/5 * * * * root /usr/bin/php /var/www/magento/cron.php > /dev/null 2>&1" > /etc/cron.d/magento
8. Configure apache sites and modules
a2dissite default default-ssl a2ensite magento magento-ssl a2enmod rewrite ssl
9. Stop services
service apache2 stop service mysql stop
So, when is magento installed?
On firstboot, the server will run a script that installs magento. This is done this way because we leave the installation to generate an encryption key that is used to encrypt passwords and credit card information. So it's important that each installation has it's unique key. If you later need to migrate this installation to other server, you'll need to copy this key to the other server. See magento's documentation for details. To know what's your generated key, just log via ssh and issue the following command:
cat /var/www/magento/app/etc/local.xml | grep key
setupdomain script
The setupdomain script is a script that sets the domain on apache's virtual hosts files so that your installation start working using a FQDN. It also updates the required settings in the magento database. The following is the content of the script:
#!/bin/bash # Script to setup site domain for magento # By Adrian Moya if [ $# != 1 ]; then echo "Usage: setupdomain DOMAINNAME" echo "Example: setupdomain www.example.com" else DOMAIN="http://$1/" SDOMAIN="https://$1/" sed -r -i "s|ServerName .*|ServerName $1|" /etc/apache2/sites-available/magento sed -r -i "s|ServerName .*|ServerName $1|" /etc/apache2/sites-available/magento-ssl mysql -u root -e "UPDATE core_config_data SET value='$DOMAIN' WHERE path='web/unsecure/base_url';" magento mysql -u root -e "UPDATE core_config_data SET value='$SDOMAIN' WHERE path='web/secure/base_url';" magento service apache2 reload echo "Done!" fi
Known issues:
There seems to be a know issue in magento's admin panel that prevents you from loggin with some browsers. It only happened once in my tests, and the workaround was use firefox to log in. Then I was able to login with chromium (which is my default browser). If you get into this issue, please comment your experience.
Enjoy!
As a checkout leaves undesired .svn directories in each directory. But this method is not recommended as they can commit changes to the repo that can break the patch. Also, they can have some settings targeting the development environment. So its preferably a release file as we can be sure that it won't be changing. But they have some annoying javascript in place preventing to get a direct download url.