Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save ryaan-anthony/8992e09d13c64eb3c074 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/8992e09d13c64eb3c074 to your computer and use it in GitHub Desktop.
Provisioning a "Magento prepped" Rackspace server. For multi-site instance, duplicate magento.conf files for each domain (more granular configurations) or add to server aliases (share config for all domains).

Prerequisites

  • nginx
  • php-fpm
  • percona
  • redis

Important: Start off as account user NOT ROOT.

Set up public root (as user)

mkdir ~/public_html

chmod 750 ~/public_html

echo "hello world > ~/public_html/index.php

Log in as root

su -

Set hostname to domain of site, must be non-www

HOSTNAME=example.com

Set linux account name

USERNAME=user

Set up nginx

cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.default

curl -O https://gist.githubusercontent.com/ryaan-anthony/6761ad405a3c8464d347/raw/a6611263452f3566bcc92f6ec2c72d56890620bf/nginx.conf

cat ~/nginx.conf > /etc/nginx/nginx.conf

curl -O https://gist.githubusercontent.com/ryaan-anthony/4162ad40f15e57e7ccdf/raw/05493e2f04ec12f0262468ded0fd60c4da324210/nginx-website.conf

sed -i.bk "s/_HOSTNAME_/$HOSTNAME/g" ~/nginx-website.conf

cat ~/nginx-website.conf > /etc/nginx/conf.d/magento.conf

rm ~/nginx*

Set up php-fpm

cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.conf.default

echo "; placeholder so php-fpm updates don't break this config" > /etc/php-fpm.d/www.conf

curl -O https://gist.githubusercontent.com/ryaan-anthony/ac43a364961d4da80043/raw/0604b32a090f6c4094e715506e1d2a73c1ada0c8/php-fpm.conf

sed -i.bk "s/_HOSTNAME_/$HOSTNAME/g" ~/php-fpm.conf

sed -i.bk "s/_USERNAME_/$USERNAME/g" ~/php-fpm.conf

cat ~/php-fpm.conf > /etc/php-fpm.d/magento.conf

rm ~/php-fpm.conf

Restart services

service nginx restart

service php-fpm restart

That's it!

exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment