SPDY ist das Protokoll, welches mittlerweile am breitesten unterstützt wird und quasi die Basis von http/2 ist. Nginx supportet SPDY mittlerweile schon relativ lange und Apache hinkt da noch etwas hinterher.
Da Plesk nginx (Version 1.6) als reverse Proxy anbietet, ist der Gedanke nicht weit doch SPDY zu aktivieren und die Geschwindigkeitsvorteile zu nutzen.
Das einzige Problem das man hat ist, dass nginx ohne das SPDY Modul kompiliert wurde.
Die einfache Lösung ist nginx selbst zu kompilieren (Beispiel Ubuntu, Adminrechte werden benötigt):
- Mögliche Abhängigkeiten laden
apt-get build-dep nginx
- Nginx Quelldateien laden (in dem Fall nginx 1.6.2 stable)
wget http://nginx.org/download/nginx-1.6.2.tar.gz
- Archiv entpacken
tar xf nginx-1.6.2.tar.gz
- Nginx compiler flags ermitteln
nginx -V
configure arguments: –prefix=/usr/share –sbin-path=/usr/sbin/nginx –conf-path=/etc/nginx/nginx.conf –error-log-path=/var/log/nginx/error.log –http-log-path=/var/log/nginx/access.log –lock-path=/var/lock/nginx.lock –pid-path=/var/run/nginx.pid –http-client-body-temp-path=/var/lib/nginx/body –http-fastcgi-temp-path=/var/lib/nginx/fastcgi –http-proxy-temp-path=/var/lib/nginx/proxy –http-scgi-temp-path=/var/lib/nginx/scgi –http-uwsgi-temp-path=/var/lib/nginx/uwsgi –user=nginx –group=nginx –with-ipv6 –with-file-aio –with-http_ssl_module –with-http_realip_module –with-http_sub_module –with-http_dav_module –with-http_gzip_static_module –with-http_stub_status_module
- Ins entpackte Verzeichnis wechseln und ./configure mit –with-http_spdy_module aufrufen
./configure –prefix=/usr/share –sbin-path=/usr/sbin/nginx –conf-path=/etc/nginx/nginx.conf –error-log-path=/var/log/nginx/error.log –http-log-path=/var/log/nginx/access.log –lock-path=/var/lock/nginx.lock –pid-path=/var/run/nginx.pid –http-client-body-temp-path=/var/lib/nginx/body –http-fastcgi-temp-path=/var/lib/nginx/fastcgi –http-proxy-temp-path=/var/lib/nginx/proxy –http-scgi-temp-path=/var/lib/nginx/scgi –http-uwsgi-temp-path=/var/lib/nginx/uwsgi –user=nginx –group=nginx –with-ipv6 –with-file-aio –with-http_ssl_module –with-http_realip_module –with-http_sub_module –with-http_dav_module –with-http_gzip_static_module –with-http_stub_status_module –with-http_spdy_module
- Anschließend nur noch kompilieren lassen
make && make install
- Nginx wird jetzt relativ schnell kompiliert und man muss nur noch das Plesk template anpassen. Dazu kopiert man das Template in den custom Ordner
cp /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
vim /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
- Man ändert folgende Zeilen
listen echo $OPT[‚ipAddress‘]->escapedAddress . ‚:‘ . $OPT[‚frontendPort‘] . ($OPT[’ssl‘] ? ‚ ssl‘ : “) ?>;
in
listen echo $OPT[‚ipAddress‘]->escapedAddress . ‚:‘ . $OPT[‚frontendPort‘] . ($OPT[’ssl‘] ? ‚ ssl spdy‘ : “) ?>;
- Optional ist (unter Zeile „if ($OPT[’ssl‘]): ?>“)
add_header Alternate-Protocol 443:npn-spdy/3;
- Abschließend nur noch die Domainkonfigurationen neu generieren
plesk sbin httpdmng –reconfigure-all
Nun sollten alle vhosts SPDY unterstützen und ich habe deutlich gemerkt, dass z.B. owncloud deutlich schneller lädt als mit HTTP/1.1!