Created
February 28, 2017 18:46
-
-
Save evaisse/6e2b08a0d213f67b1d090a387df908c4 to your computer and use it in GitHub Desktop.
debian jessie varnish5 + mod page speed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "" >> /etc/apt/sources.list | |
echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list | |
apt-get update | |
apt-get install -y \ | |
build-essential apt-transport-https automake autotools-dev libedit-dev \ | |
libjemalloc-dev libncurses-dev libpcre3-dev \ | |
libtool pkg-config python-docutils python-sphinx graphviz \ | |
git curl fail2ban wget | |
# VARNISH | |
git clone https://github.com/varnishcache/varnish-cache | |
cd varnish-cache | |
sh autogen.sh | |
sh configure | |
make | |
make install | |
# cat > /etc/default/varnish << EOF | |
# DAEMON_OPTS="-a :80 \ | |
# -T localhost:6082 \ | |
# -f /etc/varnish/default.vcl \ | |
# -S /etc/varnish/secret \ | |
# -s malloc,256m" | |
# EOF | |
mkdir -p /etc/systemd/system/varnish.service.d | |
cat > /etc/systemd/system/varnish.service.d/customexec.conf << EOF | |
[Service] | |
ExecStart= | |
ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m | |
EOF | |
# APACHE + MOD PHP + PHP | |
apt-get install -y \ | |
libapache2-mod-php5 php5-pgsql php5-gd \ | |
php5-curl php5-imap php5-mysql php5-memcached php5-mcrypt \ | |
php5-imagick php5-cgi php5-cli | |
sed -e 's/Listen 80/Listen 127.0.0.1:8880/g' /etc/apache2/ports.conf > /etc/apache2/ports.conf | |
service apache2 restart | |
# MODE PAGESPEED | |
rm -f mod-pagespeed.deb | |
curl "https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_amd64.deb" -o mod-pagespeed.deb | |
dpkg -i mod-pagespeed.deb | |
apt-get -f install | |
service apache2 restart | |
# LET'S ENCRYPT | |
apt-get install python-certbot-apache -t jessie-backports | |
certbot --apache | |
# @todo push in crontab | |
#certbot renew --dry-run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment