Skip to content

Instantly share code, notes, and snippets.

View andreferraro's full-sized avatar
🎯
Focusing

Andre Ferraro andreferraro

🎯
Focusing
  • Brazil
  • 20:32 (UTC -03:00)
View GitHub Profile
TEMPLATE_CONFIG_FILE = """
#AUTOMATICALLY GENERATED - DO NO EDIT!
user %(user)s %(user)s;
pid /var/run/nginx.pid;
worker_processes %(workers)s;
worker_rlimit_nofile 100000;
events {
worker_connections 4096;
#/bin/bash
cd
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
apt-get update
apt-get install ajenti -y
apt-get install ajenti-v ajenti-v-nginx ajenti-v-mysql ajenti-v-php-fpm php5-mysql ajenti-v-ftp-pureftpd -y
service ajenti restart
vcl 4.0;
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# Configurações de performance
sub vcl_recv {
if (req.url ~ "(?i)\.(css|js|jpg|jpeg|gif|png|ico)(\?.*)?$") {
unset req.http.Cookie;
}
#[...]
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-p thread_pool_add_delay=2 \
-p thread_pools=2 \
-p thread_pool_min=400 \
-p thread_pool_max=4000 \
#/bin/bash
apt-get install apt-transport-https -y
curl https://repo.varnish-cache.org/GPG-key.txt | apt-key add -
echo "deb https://repo.varnish-cache.org/ubuntu/ trusty varnish-4.0" >> /etc/apt/sources.list.d/varnish-cache.list
echo "deb-src https://repo.varnish-cache.org/ubuntu/ trusty varnish-4.0" >> /etc/apt/sources.list.d/varnish-cache.list
apt-get update
apt-get install varnish -y
extension=memcache.so
[memcache]
memcache.allow_failover=1
memcache.archivememlim=0
memcache.chunk_size=32768
memcache.dbpath="/var/lib/memcache"
memcache.default_port=0
memcache.hash_strategy="consistent"
memcache.maxfiles=0
#/bin/bash
apt-get install software-properties-common -y
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
add-apt-repository 'deb http://dl.hhvm.com/ubuntu trusty main'
apt-get update
apt-get install hhvm -y
/usr/share/hhvm/install_fastcgi.sh
/etc/init.d/hhvm restart
update-rc.d hhvm defaults
#!/usr/bin/make -f
#export DH_VERBOSE=1
CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS ?= $(shell dpkg-buildflags --get LDFLAGS)
WITH_SPDY := $(shell printf "Source: nginx\nBuild-Depends: libssl-dev (>= 1.0.1)\n" | \
dpkg-checkbuilddeps - >/dev/null 2>&1 && \
echo "--with-http_spdy_module")
%:
#/bin/bash
# INSTALAÇÃO HEADERS MORE
cd /home/sysadm/
mkdir -p /home/sysadm/tmp/ngx_headers
cd /home/sysadm/tmp/ngx_headers
wget https://github.com/openresty/headers-more-nginx-module/archive/master.zip
unzip master.zip
mv headers-more-nginx-module-master/ headers-more-nginx-module/
#/bin/bash
apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
echo deb http://repo.percona.com/apt trusty main >> /etc/apt/sources.list
echo deb-src http://repo.percona.com/apt trusty main >> /etc/apt/sources.list
apt-get update
apt-get install percona-server-server-5.6 percona-server-client-5.6 -y
sed -i "s/key_buffer/key_buffer_size/g" /etc/mysql/my.cnf
sed -i "s/\[mysqld\]/\[mysqld\]\nexplicit_defaults_for_timestamp = 1/g" /etc/mysql/my.cnf
sed -i "s/127.0.0.1/172.16.0.200/g" /etc/mysql/my.cnf
service mysql stop && sudo service mysql start