Skip to content

Instantly share code, notes, and snippets.

View rockdrigo's full-sized avatar

Rodrigo Satch rockdrigo

View GitHub Profile
; configuration for php Xcache module
[xcache-common]
;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
zend_extension = /usr/lib/php5/20090626/xcache.so
[xcache.admin]
xcache.admin.auth = On
xcache.admin.user = "appadmin"
;xcache.admin.pass = md5(yourpassword)

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
#### Magento Hosting Performance Benchmarks
#### Executed by: JeroenVermeulen.eu / MagentoHosting.pro
## Example test command for 5 concurrent users hitting as fast as possible:
## siege --concurrent=5 --file=urls.txt --log=log.txt --time=60s --quiet --benchmark --internet
## The file urls.txt contains 5029 URLs based on sitemap.xml.
## Magento contains 5933 Total products.
## Magento has 4697 Enabled products.
##
#!/bin/sh
find . -type f -exec chmod 664 {} \;
find . -type d -exec chmod 775 {} \;
find var/ -type f -exec chmod 777 {} \;
find media/ -type f -exec chmod 777 {} \;
find var/ -type d -exec chmod 777 {} \;
find media/ -type d -exec chmod 777 {} \;
chmod 770 includes
chmod 660 includes/config.php
chmod +x cron.sh
@rockdrigo
rockdrigo / gist:0ffa5b89af049ee42adb
Last active July 12, 2019 19:59
Sublime User Preferences
{
"font_size": 12,
"bold_folder_labels": true,
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
@rockdrigo
rockdrigo / gist:f72a957dc92cd5eeb18f
Created July 18, 2015 02:49
permisos wordpress
#!/bin/bash
echo "comenzamos con la asignacion de permisos, no tardamos"
echo "asignando permisos 664 a archivos"
find . -type f -exec chmod 664 {} \;
echo "asignando permisos 775 a carpetas"
find . -type d -exec chmod 775 {} \;
echo "be happy litle pinguin"
@rockdrigo
rockdrigo / MandelbrotColor.java
Created September 20, 2015 05:29
Programa que genera imagen con fractal de Mandelbrot
import java.awt.Color;
import java.io.File;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
public class MandelbrotColor {
public static void main(String[] args) throws Exception {
int width = 1920, height = 1080, max = 1000;
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
int black = 0;
@rockdrigo
rockdrigo / mysql.txt
Created November 4, 2015 16:17 — forked from johnantoni/mysql.txt
mysql + vagrant + remote access
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
@rockdrigo
rockdrigo / MexEstados.sql
Created February 4, 2016 00:16
Magento Mexico Estados de la Republica
INSERT INTO `directory_country_region` VALUES (NULL , "MX", "AGS","Aguascalientes"),(NULL , "MX", "BCN","Baja California Norte"),(NULL , "MX", "BCS","Baja California Sur"),(NULL , "MX", "CAM","Campeche"),(NULL , "MX", "CHIS","Chiapas"),(NULL , "MX", "CHIH","Chihuahua"),(NULL , "MX", "COAH","Coahuila"),(NULL , "MX", "COL","Colima"),(NULL , "MX", "DF","Distrito Federal"),(NULL , "MX", "DGO","Durango"),(NULL , "MX", "GTO","Guanajuato"),(NULL , "MX", "GRO","Guerrero"),(NULL , "MX", "HGO","Hidalgo"),(NULL , "MX", "JAL","Jalisco"),(NULL , "MX", "MICH","Michoacan"),(NULL , "MX", "MOR","Morelos"),(NULL , "MX", "MEX","Estado de Mexico"),(NULL , "MX", "NAY","Nayarit"),(NULL , "MX", "NL","Nuevo Leon"),(NULL , "MX", "OAX","Oaxaca"),(NULL , "MX", "PUE","Puebla"),(NULL , "MX", "QRO","Queretaro"),(NULL , "MX", "QROO","Quintana Roo"),(NULL , "MX", "SLP","San Luis Potosi"),(NULL , "MX", "SIN","Sinaloa"),(NULL , "MX", "SON","Sonora"),(NULL , "MX", "TAB","Tabasco"),(NULL , "MX", "TAMPS","Tamaulipas"),(NULL , "MX", "TLAX","Tlaxc
@rockdrigo
rockdrigo / gist:d25b40f8a808de6a42532d73831495b7
Created May 19, 2016 22:13
Move all files to upper folder linux
mv * .[^.]* ..