Tag Archives: nsa310

Compiling google’s mod_pagespeed for nginx

This post is intended mainly to Zyxel NSA310 users.

Prerequisites
See first https://adrhc.go.ro/blog/common-commands-when-building/ for building environment, x.sh script and other things not defined here.
Before starting do declare the environment variables specified to the link above.

Environment & other preparations
NEW_BUILD_NAME=ngx_pagespeed
NEW_BUILD_VER=20150317
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0

wget -O ngx_pagespeed-$NEW_BUILD_VER.zip https://github.com/pagespeed/ngx_pagespeed/archive/master.zip
unzip ngx_pagespeed-$NEW_BUILD_VER.zip
mv ngx_pagespeed-master/ ngx_pagespeed-$NEW_BUILD_VER

Build procedure
Read then do first https://adrhc.go.ro/blog/install-configure-googles-mod_pagespeed-for-apache/
cd ~/compile/mod_pagespeed/src/net/instaweb/automatic
~/x.sh ffpg1
make BUILDTYPE=Release AR.host="$PWD/../../../build/wrappers/ar.sh" AR.target="$PWD/../../../build/wrappers/ar.sh" all

Other considerations
See also https://github.com/pagespeed/ngx_pagespeed/wiki/Building-PSOL-From-Source

NSA310: phpMyAdmin setup

#start configuration
mkdir $HOME/apache-htdocs/myadmin/config
chown -R nobody:nobody ~/apache-htdocs/myadmin
Access https://adrhc.go.ro/myadmin/setup.
#you'll then have $HOME/apache-htdocs/myadmin/config/config.inc.php which you must move to $HOME/apache-htdocs/myadmin/config.inc.php
#then delete $HOME/apache-htdocs/myadmin/config

#bzopen and bzcompress functions required
This means you don't have extension=bz2.so somehow enabled into php.

#Enable Features -> Security -> Force SSL connection.

Using zyxel utils hooks

#you can't apply/stop one hook; you start/stop all of them with:
/ffp/start/zyxel_utils.sh start/stop

#you enable/disable hook by uncommenting/commenting entries in /ffp/start/zyxel_utils.sh
#e.g. enable nfs hooking:
#uncomment hook_nfs entry in /ffp/start/zyxel_utils.sh

#see zyxel_utils.sh log
cat /tmp/intercept.log

#see active zyxel_utils.sh hooks
cat /tmp/.ffpstick/zyxelutils

#/etc/exports (link to /usr/local/zy-pkgs/etc/exports or /ffp/etc/exports) content:
/i-data/60cb70cf 192.168.1.0/24(ro,sync,no_subtree_check,wdelay,no_root_squash) #hdd1
#mount NFS share to windows 7 (next drive letter available):
mount 192.168.1.31:/i-data/60cb70cf *
#mount NFS share to windows 7 the Z drive:
mount 192.168.1.31:/i-data/60cb70cf z:
#unmount NFS share (–a Unmounts all NFS network drives):
umount z:

#manually start/stop NFS
/usr/local/zy-pkgs/etc/init.d/NFS start
/usr/local/zy-pkgs/etc/init.d/NFS stop

NSA310 FFP patches

wget -O /ffp/bin/config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
wget -O /ffp/bin/config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
chmod +x /ffp/bin/config.guess
chmod +x /ffp/bin/config.sub
 
sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/g /ffp/bin/roff2text
sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/g /ffp/bin/pprof
sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/g /ffp/bin/grog
sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/g /ffp/bin/roff2x
sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/g /ffp/bin/roff2ps
sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/g /ffp/bin/gdbus-codegen
sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/g /ffp/bin/chem
sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/g /ffp/bin/roff2html
sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/g /ffp/bin/groffer
sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/g /ffp/bin/roff2pdf

sed -i s/"\/usr\/local\/bin"/"\/ffp\/bin"/g /ffp/bin/cpan
sed -i s/"\/usr\/local\/bin"/"\/ffp\/bin"/g /ffp/bin/pstruct
sed -i s/"\/usr\/local\/bin"/"\/ffp\/bin"/g /ffp/bin/chkdupexe
sed -i s/"\/usr\/local\/bin"/"\/ffp\/bin"/g /ffp/bin/c2ph
sed -i s/"\/usr\/local\/bin"/"\/ffp\/bin"/g /ffp/bin/enc2xs
sed -i s/"\/usr\/local\/bin"/"\/ffp\/bin"/g /ffp/bin/enc2xs

NSA310, FFP, lddd (missing libraries)

#see http://forum.nas-central.org/viewtopic.php?f=249&t=14699&hilit=lddd&start=0#p82527
wget http://downloads.zyxel.nas-central.org/Users/barmalej2/ffp/0.7/arm/scripts/lddd -O /ffp/sbin/lddd
chmod 755 /ffp/sbin/lddd
lddd

#Do NOT solve like below the missing libraries reported by lddd:
ln -s /lib/libc.so.6 /ffp/lib/
ln -s /usr/lib/libdb-5.2.so /ffp/lib/
ln -s /usr/lib/libffi.so.5 /ffp/lib/
ln -s /lib/ld-linux.so.3 /ffp/lib/