Skip to content

Instantly share code, notes, and snippets.

View centminmod's full-sized avatar

George Liu (eva2000) centminmod

View GitHub Profile
@centminmod
centminmod / gist:8773625
Created February 2, 2014 19:40
Testing PHP Int / ICU extension and general PHP extension support in Jailkit chrooted Centmin Mod Nginx vhost user account
jk_cp -j /home/chroot_shell/ /etc/centminmod/php.d
/home
Copying /etc/centminmod/php.d/memcache.ini to /home/chroot_shell/etc/centminmod/php.d/memcache.ini
Copying /etc/centminmod/php.d/imagick.ini to /home/chroot_shell/etc/centminmod/php.d/imagick.ini
Copying /etc/centminmod/php.d/apc.ini to /home/chroot_shell/etc/centminmod/php.d/apc.ini
Copying /etc/centminmod/php.d/memcached.ini to /home/chroot_shell/etc/centminmod/php.d/memcached.ini
Copying /etc/centminmod/php.d/igbinary.ini to /home/chroot_shell/etc/centminmod/php.d/igbinary.ini
jk_cp -j /home/chroot_shell/ /usr/local/lib/php/extensions
/home
@centminmod
centminmod / php_apc_
Created February 11, 2014 08:23
APC Cache munin plugin
#!/usr/bin/perl
#
# Magic markers:
#%# family=auto
#%# capabilities=autoconf
use strict;
use Munin::Plugin;
need_multigraph();
@centminmod
centminmod / apc_info.php
Created February 11, 2014 08:24
APC Cache Munin plugin php file
<?php
/**
* TODO: File header.
* TODO: Code comments.
*/
if(function_exists("apc_cache_info") && function_exists("apc_sma_info")) {
$time = time();
@centminmod
centminmod / gist:8935394
Created February 11, 2014 14:04
Nginx vhost for Ghost blog 0.4+ with Ghost Blog installed as a subdirectory at domain.com/blog
server {
server_name yourghostdomain.com www.yourghostdomain.com;
access_log /home/nginx/domains/yourghostdomain.com/log/access.log combined buffer=32k;
error_log /home/nginx/domains/yourghostdomain.com/log/error.log;
root /home/nginx/domains/yourghostdomain.com/public;
location /blog {
include /home/nginx/domains/yourghostdomain.com/proxy.conf;
include /home/nginx/domains/yourghostdomain.com/proxycache.conf; }
@centminmod
centminmod / readme.txt
Last active August 29, 2015 13:56
Instructions to switch from Centmin Mod Nginx based Wordpress WP-FFPC plugin configuration to Wordpress Super Cache plugin configuration. This is a quick and rough how to until the full auto installer outlined at https://blog.centminmod.com/194 is ready for release.
Just deactivate WP-FFPC like any WP plugin and delete it. Then need to adjust your Nginx domain's Nginx vhost domain.conf file to format for WP Super Cache. Quick manual method for WP Super Cache install are the following commands via WP-CLI tool.
Assuming /home/nginx/domains/domainname.com/public/wp is your Wordpress install directory. If you haven't installed Wordpress yet follow only step #2 outlined at http://centminmod.com/nginx_configure_wordpress_ffpc_plugin.html
then type following commands in SSH window editing just your WPDIR variabvle to point to your domainname.com path where wordpress is installed.
WPDIR='/home/nginx/domains/domainname.com/public/wp'
CHOWNDFT='nginx:nginx'
cd $WPDIR
@centminmod
centminmod / btsync
Last active August 29, 2015 13:56
btsync init.d for CentminMod.com installations
#! /bin/sh
##########################################
# /etc/init.d/btsync
# btsync init.d for CentminMod.com installs
##########################################
DEBUG='n'
##########################################
SERVICE=btsync
BITDIR='/usr/bin'
##########################################
@centminmod
centminmod / gist:9003270
Last active August 29, 2015 13:56
centmin mod 1.2.3-eva2000.06 quick fix to properly disable ngx_pagespeed download process when centmin.sh has NGINX_PAGESPEED=n set
nginxpgspeedtarball() {
if [[ "$NGINX_PAGESPEED" = [yY] ]]; then
cd $DIR_TMP
# official github master zip renamed
if [[ "$NGINX_PAGESPEEDGITMASTER" = [yY] ]]; then
cecho "Download release-${NGXPGSPEED_VER}.tar.gz ..." $boldyellow
@centminmod
centminmod / gist:9088754
Created February 19, 2014 09:29
addons/linfo.sh quick fix for changed tarball
quick fix would be to edit linfo.sh and replace this line
tar -xzf linfo-${LINFO_VER}.tar.gz
with these 2 lines
mkdir -p linfo-${LINFO_VER}
tar -xzf linfo-${LINFO_VER}.tar.gz -C linfo-${LINFO_VER}
edit and change version number to 1.10
@centminmod
centminmod / downloadlinks.inc
Created February 19, 2014 12:14
downloadlinks.inc - extracted all inc/downloads.inc download links to their own file for easier management
@centminmod
centminmod / changelog.txt
Created February 19, 2014 13:17
preview of Centmin Mod v1.2.3-eva2000.07 change log
v1.2.3-eva2000.07 change log
- Moved all downloads links themselves out of the download functions at inc/downloads.inc to their own file at inc/downloadlinks.inc for easier management
- Changed PHP's default config scan directory variable path (CONFIGSCANDIR) from /root/centminmod/php.d to /etc/centmimod/php.d. centmin.sh will auto detect this and create the necessary directory and copy over any existing PHP extension .ini files from the old path. This is preparation for when chrooted user SSH/SFTP/SCP user account support comes https://blog.centminmod.com/194 to allow chrooted users PHP binary access to PHP extensions.
- Updated PHP upgrade routine to auto reinstall previously installed PHP extensions such as APC Cache, Xcache, Memcache/Memcached, igbinary and ImagicK. No longer will users need to manually reinstall these PHP extensions after each PHP upgrade. The script will detect what .ini files are in /root/centminmod/php.d (.07 release will be /etc/centminmod/php.d) when PHP upgrade is ran. Then at en