{"id":64,"date":"2014-10-14T05:28:27","date_gmt":"2014-10-14T05:28:27","guid":{"rendered":"http:\/\/adrhc.go.ro\/wordpress\/?p=64"},"modified":"2017-05-10T23:48:52","modified_gmt":"2017-05-10T21:48:52","slug":"install-configure-googles-mod_pagespeed-for-apache","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/install-configure-googles-mod_pagespeed-for-apache\/","title":{"rendered":"Install &#038; configure google&#8217;s mod_pagespeed for apache"},"content":{"rendered":"<pre class=\"brush:bash shell\">\r\n#See https:\/\/adrhc.go.ro\/blog\/common-commands-when-building\/ for building environment, x.sh script and other things not defined here.\r\n#Before starting do declare the environment variables specified to the link above.\r\n\r\n#mod_pagespeed (see depot_tools and modpagespeed-patch.sh below)\r\nrm -r ~\/compile\/mod_pagespeed\r\nmkdir ~\/compile\/mod_pagespeed\r\ncd ~\/compile\/mod_pagespeed\r\n#export PATH=\/ffp\/sbin:\/usr\/sbin:\/sbin:\/ffp\/bin:\/usr\/bin:\/bin:\/ffp\/opt\/ejre1.7.0_60\/bin:\/ffp\/home\/root\/compile\/depot_tools\/\r\nexport PATH=$PATH:\/ffp\/home\/root\/compile\/depot_tools\/\r\nexport GIT_SSL_NO_VERIFY=true\r\ngclient config http:\/\/modpagespeed.googlecode.com\/svn\/trunk\/src\r\n#Ignore the warning: Running depot tools as root is sad; this means that depot tools won't update itself.\r\n#gclient config http:\/\/modpagespeed.googlecode.com\/svn\/branches\/latest-beta\/src\r\ngclient sync --force --jobs=1\r\nrenice -14 `pidof python` -p `pidof svn` -p `pidof git`\r\n\r\n#ERROR1\r\n\t________ running '\/ffp\/bin\/python src\/tools\/clang\/scripts\/update.py --mac-only' in '\/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/mod_pagespeed'\r\n\tTraceback (most recent call last):\r\n\t  File \"src\/tools\/clang\/scripts\/update.py\", line 193, in <module>\r\n\t\tsys.exit(main())\r\n\t  File \"src\/tools\/clang\/scripts\/update.py\", line 183, in main\r\n\t\tstderr=os.fdopen(os.dup(sys.stdin.fileno())))\r\n\t  File \"\/ffp\/lib\/python2.7\/subprocess.py\", line 522, in call\r\n\t\treturn Popen(*popenargs, **kwargs).wait()\r\n\t  File \"\/ffp\/lib\/python2.7\/subprocess.py\", line 710, in __init__\r\n\t\terrread, errwrite)\r\n\t  File \"\/ffp\/lib\/python2.7\/subprocess.py\", line 1335, in _execute_child\r\n\t\traise child_exception\r\n\tOSError: [Errno 2] No such file or directory\r\n\tError: Command \/ffp\/bin\/python src\/tools\/clang\/scripts\/update.py --mac-only returned non-zero exit status 1 in \/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/mod_pagespeed\r\n#SOLUTION1\r\n\tfind . -type f -name \"DEPS\" -exec sed -i s\/\"https\"\/\"http\"\/ {} \\;\r\n\tfind . -type f -name \"DEPS\" -exec sed -i s\/\"http:\\\/\\\/boringssl\"\/\"https:\\\/\\\/boringssl\"\/ {} \\;\r\n\tsed -i s\/\"256281\"\/\"262880\"\/ ~\/compile\/mod_pagespeed\/src\/DEPS\r\n\tsed -i s#,\\ \\\"\\\\--mac-only\\\"## ~\/compile\/mod_pagespeed\/src\/DEPS\r\n\tgclient sync --force --jobs=1\r\n\r\n#ERROR2\r\n\t________ running '\/ffp\/bin\/python src\/tools\/clang\/scripts\/update.py' in '\/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/mod_pagespeed'\r\n\tTraceback (most recent call last):\r\n\t  File \"src\/tools\/clang\/scripts\/update.py\", line 197, in <module>\r\n\t\tsys.exit(main())\r\n\t  File \"src\/tools\/clang\/scripts\/update.py\", line 183, in main\r\n\t\tstderr=os.fdopen(os.dup(sys.stdin.fileno())))\r\n\t  File \"\/ffp\/lib\/python2.7\/subprocess.py\", line 522, in call\r\n\t\treturn Popen(*popenargs, **kwargs).wait()\r\n\t  File \"\/ffp\/lib\/python2.7\/subprocess.py\", line 710, in __init__\r\n\t\terrread, errwrite)\r\n\t  File \"\/ffp\/lib\/python2.7\/subprocess.py\", line 1335, in _execute_child\r\n\t\traise child_exception\r\n\tOSError: [Errno 2] No such file or directory\r\n\tError: Command \/ffp\/bin\/python src\/tools\/clang\/scripts\/update.py returned non-zero exit status 1 in \/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/mod_pagespeed\r\n#SOLUTION2\r\n\tsed -i s\/\"https\"\/\"http\"\/ ~\/compile\/mod_pagespeed\/src\/tools\/clang\/scripts\/update.*\r\n\tsed -i s\/\"\\\/usr\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ ~\/compile\/mod_pagespeed\/src\/tools\/clang\/scripts\/update.*\r\n\t#also do solutions for errors listed till TO DO BEFORE \"make AR.host ...\" section\r\n\tgclient sync --force --jobs=1\r\n\r\n#ERROR3:\r\n\tgyp: Undefined variable deb_arch in \/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/mod_pagespeed\/src\/build\/install.gyp\r\n\tError: Command \/ffp\/bin\/python src\/build\/gyp_chromium -Dchromium_revision=256281 returned non-zero exit status 1 in \/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/mod_pagespeed\r\n#SOLUTION3:\r\n\tModify manually ~\/compile\/mod_pagespeed\/src\/build\/install.gyp:\r\n        'conditions': [\t\t\t\t-&gt; existing line\r\n          ['target_arch==\"ia32\"', {\t-&gt; existing line\r\n            'deb_arch': 'i386',\t\t-&gt; existing line\r\n            'rpm_arch': 'i386',\t\t-&gt; existing line\r\n          }],\t\t\t\t\t\t-&gt; existing line\r\n\t\t  ['target_arch==\"arm\"', {\r\n\t\t\t'deb_arch': 'arm',\r\n\t\t\t'rpm_arch': 'arm',\r\n\t\t  }],\r\n\tor simply run this:\r\n\tsed -i s\/\"target_arch==\\\"x64\"\/\"target_arch==\\\"arm\"\/ ~\/compile\/mod_pagespeed\/src\/build\/install.gyp\t \t \r\n\tsed -i s\/\"deb_arch':\\s'amd64\"\/\"deb_arch': 'arm\"\/ ~\/compile\/mod_pagespeed\/src\/build\/install.gyp\t \t \r\n\tsed -i s\/\"rpm_arch':\\s'x86_64\"\/\"rpm_arch': 'arm\"\/ ~\/compile\/mod_pagespeed\/src\/build\/install.gyp\r\n\t#continue to ERROR4 (step 1) without running 'gclient sync'\r\n\r\n#ERROR4 (step 1):\r\n\tHook '\/ffp\/bin\/python src\/build\/gyp_chromium -Dchromium_revision=262880' took 301.05 secs\r\n\t________ running 'src\/third_party\/closure\/download.sh' in '\/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/mod_pagespeed'\r\n\tfind: 'src\/tools\/closure': No such file or directory\r\n\t  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\n\t\t\t\t\t\t\t\t\t Dload  Upload   Total   Spent    Left  Speed\r\n\t100 5522k  100 5522k    0     0  1709k      0  0:00:03  0:00:03 --:--:-- 1709k\r\n\tArchive:  src\/tools\/closure\/compiler-latest.zip\r\n#SOLUTION4:\r\n\tsed -i s\/\"curl\\s-\"\/\"curl -k -\"\/ src\/tools\/clang\/scripts\/update.sh\r\n\tsed -i s\/\"curl\\shttp\"\/\"curl -k http\"\/ src\/third_party\/closure\/download.sh\r\n\tsed -i s\/\"\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ src\/third_party\/closure\/download.sh\r\n\tgclient sync --force --jobs=1\r\n\r\n#ERROR4 (step 2):\r\n\tHook '\/ffp\/bin\/python src\/build\/gyp_chromium -Dchromium_revision=262880' took 301.05 secs\r\n\t________ running 'src\/third_party\/closure\/download.sh' in '\/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/mod_pagespeed'\r\n\tTraceback (most recent call last):\r\n\t  File \"\/ffp\/home\/root\/compile\/depot_tools\/gclient.py\", line 2264, in &lt;module>\r\n\t\tsys.exit(Main(sys.argv[1:]))\r\n\t  File \"\/ffp\/home\/root\/compile\/depot_tools\/gclient.py\", line 2252, in Main\r\n\t\treturn dispatcher.execute(OptionParser(), argv)\r\n\t  File \"\/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/depot_tools\/subcommand.py\", line 245, in execute\r\n\t\treturn command(parser, args[1:])\r\n\t  File \"\/ffp\/home\/root\/compile\/depot_tools\/gclient.py\", line 2009, in CMDsync\r\n\t\tret = client.RunOnDeps('update', args)\r\n\t  File \"\/ffp\/home\/root\/compile\/depot_tools\/gclient.py\", line 1528, in RunOnDeps\r\n\t\tself.RunHooksRecursively(self._options)\r\n\t  File \"\/ffp\/home\/root\/compile\/depot_tools\/gclient.py\", line 983, in RunHooksRecursively\r\n\t\thook, cwd=self.root.root_dir, always=True)\r\n\t  File \"\/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/depot_tools\/gclient_utils.py\", line 293, in CheckCallAndFilterAndHeader\r\n\t\treturn CheckCallAndFilter(args, **kwargs)\r\n\t  File \"\/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/depot_tools\/gclient_utils.py\", line 488, in CheckCallAndFilter\r\n\t\t**kwargs)\r\n\t  File \"\/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/depot_tools\/subprocess2.py\", line 253, in __init__\r\n\t\t% (str(e), kwargs.get('cwd'), args[0]))\r\n\tOSError: Execution failed with error: [Errno 2] No such file or directory.\r\n\tCheck that \/usr\/local\/zy-pkgs\/ffproot\/ffp\/home\/root\/compile\/mod_pagespeed or src\/third_party\/closure\/download.sh exist and have execution permission.\r\n#SOLUTION4 (it's same solution applied second time):\r\n\tsed -i s\/\"curl\\s-\"\/\"curl -k -\"\/ src\/tools\/clang\/scripts\/update.sh\r\n\tsed -i s\/\"curl\\shttp\"\/\"curl -k http\"\/ src\/third_party\/closure\/download.sh\r\n\tsed -i s\/\"\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ src\/third_party\/closure\/download.sh\r\n\tgclient sync --force --jobs=1\r\n\r\n#TO DO BEFORE \"make AR.host ...\":\r\n\tcd ~\/compile\/mod_pagespeed\r\n\t\/ffp\/opt\/apache-htdocs\/public\/modpagespeed-patch.sh\r\n\t#BUG1 (~\/compile\/mod_pagespeed\/src\/pagespeed\/kernel\/base\/stdio_file_system.cc):\r\n\t\tbug: https:\/\/bugs.uclibc.org\/2089\r\n\t\tpatch: https:\/\/github.com\/mat-c\/uClibc\/commit\/328d392c54aa5dc2b8e7f398a419087de497de2b\r\n\t\tgrep -r -I \"hidden_\\w.*errno_\" .\r\n\t#SOLUTION-BUG1:\r\n\t\tgrep -i -I -r --include=*.cc \"set_error()\" ~\/compile\/mod_pagespeed\/src\r\n\t\tModify ~\/compile\/mod_pagespeed\/src\/pagespeed\/kernel\/base\/stdio_file_system.cc:\r\n\t\t1) BoolOrError StdioFileSystem::Exists(const char* path, MessageHandler* handler) {\r\n\t\t\t\/\/if (ret.is_false() &amp;&amp; errno != ENOENT) {  \/\/ Not error if file doesn't exist.\r\n\t\t\tif (ret.is_false()) {\r\n\t\t\t\thandler-&gt;Message(kError, \"[adr, Exists] Failed to stat %s: %s\", path, strerror(errno));\r\n\t\t\t\t\/\/ ret.set_error();\r\n\t\t2) BoolOrError StdioFileSystem::IsDir(const char* path, MessageHandler* handler) {\r\n\t\t\tif (stat(path, &amp;statbuf) == 0) {\r\n\t\t\t\tret.set(S_ISDIR(statbuf.st_mode));\r\n\t\t\t\/\/} else if (errno != ENOENT) {  \/\/ Not an error if file doesn't exist.\r\n\t\t\t} else {\r\n\t\t\t\thandler-&gt;Message(kError, \"[adr, IsDir] Failed to stat %s: %s\", path, strerror(errno));\r\n\t\t\t\t\/\/ ret.set_error();\r\n\t\tModify (optional) ~\/compile\/mod_pagespeed\/src\/pagespeed\/apache\/apr_file_system.cc:\r\n\t\tSee ~\/compile\/mod_pagespeed\/src\/third_party\/apr\/src\/include\/apr_file_info.h for definition of apr_stat(...).\r\n\t\t1) BoolOrError AprFileSystem::Exists(const char* path, MessageHandler* handler) {\r\n\t\t\t\/\/if (ret != APR_SUCCESS &amp;&amp; ret != APR_ENOENT) {\r\n\t\t\tif (ret != APR_SUCCESS) {\r\n\t\t\t\tAprReportError(handler, path, 0, \"[adr:Exists:apr_stat] failed to stat\", ret);\r\n\t\t\t\t\/\/exists.set_error();\r\n\t\t2) BoolOrError AprFileSystem::IsDir(const char* path, MessageHandler* handler) {\r\n\t\t\t\/\/if (ret != APR_SUCCESS &amp;&amp; ret != APR_ENOENT) {\r\n\t\t\tif (ret != APR_SUCCESS) {\r\n\t\t\t\tAprReportError(handler, path, 0, \"[adr:IsDir:apr_stat] failed to stat\", ret);\r\n\t\t\t\t\/\/is_dir.set_error();\r\n#ERROR5:\r\n\tmissing ContainsOnlyWhitespaceASCII\r\n#SOLUTION5:\r\n\tI modified mod_pagespeed\/src\/pagespeed\/kernel\/base\/string_util.cc and added:\r\n\t\tbool ContainsOnlyWhitespaceASCII(const std::string&amp; str) {\r\n\t\t  for (std::string::const_iterator i(str.begin()); i != str.end(); ++i) {\r\n\t\t\tif (!IsAsciiWhitespace(*i))\r\n\t\t\t  return false;\r\n\t\t  }\r\n\t\t  return true;\r\n\t\t}\r\n\t\tinsert it before the line below (last line in string_util.cc):\r\n\t\t}  \/\/ namespace net_instaweb   \t\t\t-&gt; this line already existed the rest above I added\r\n\tI modified mod_pagespeed\/src\/pagespeed\/kernel\/base\/string_util.h and added:\r\n\t\tvoid LowerString(GoogleString* str);\t-&gt; this line already existed the rest below I added\r\n\t\tbool ContainsOnlyWhitespaceASCII(const std::string&amp; str);\r\n#ERROR21 (not always):\r\n    out\/Release\/obj.target\/pagespeed_automatic_test\/net\/instaweb\/rewriter\/split_html_filter_test.o: In function `net_instaweb::(anonymous namespace)::SplitHtmlFilterTest_SplitHtmlWithDriverHavingCriticalLineInfo_Test::TestBody()':\r\n    split_html_filter_test.cc:(.text._ZN12net_instaweb12_GLOBAL__N_166SplitHtmlFilterTest_SplitHtmlWithDriverHavingCriticalLineInfo_Test8TestBodyEv+0x364): relocation truncated to fit: R_ARM_THM_CALL against symbol `operator delete(void*)@@GLIBCXX_3.4' defined in .plt section in \/ffp\/bin\/..\/lib\/gcc\/arm-ffp-linux-uclibcgnueabi\/4.6.2\/..\/..\/..\/crt1.o\r\n    collect2: ld returned 1 exit status\r\n    make: *** [out\/Release\/pagespeed_automatic_test] Error 1\r\n#SOLUTION21:\r\n    Modify ~\/compile\/mod_pagespeed\/src\/build\/All.target.mk:\r\n    $(obj).target\/build\/All.stamp: $(obj).target\/build\/mod_pagespeed.stamp $(obj).target\/build\/test.stamp $(obj).target\/build\/js_minify.stamp FORCE_DO_CMD\r\n    Modify ~\/compile\/mod_pagespeed\/src\/Makefile:\r\n    comment any ifeq using *pagespeed_automatic*.mk\r\n#ERROR22 (not always):\r\n\tIn file included from .\/pagespeed\/kernel\/base\/string_util.h:28:0,\r\n\t\t\t\t\t from .\/net\/instaweb\/rewriter\/public\/js_replacer.h:30,\r\n\t\t\t\t\t from net\/instaweb\/rewriter\/js_replacer.cc:17:\r\n\tthird_party\/chromium\/src\/base\/logging.h: In function 'std::string* logging::CheckGEImpl(const t1&, const t2&, const char*) [with t1 = unsigned int, t2 = int, std::string = std::basic_string&lt;char>]':\r\n\tnet\/instaweb\/rewriter\/js_replacer.cc:157:3:   instantiated from here\r\n\tthird_party\/chromium\/src\/base\/logging.h:560:1: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]\r\n\tcc1plus: all warnings being treated as errors\r\n#SOLUTION22:\r\n\tCompile again the line producing the error modifying -Werror with -Wsign-compare (below is the corrected g++ command):\r\n\tg++ '-DCHROMIUM_REVISION=262880' '-DV8_DEPRECATION_WARNINGS' '-DBLINK_SCALE_FILTERS_AT_RECORD_TIME' '-D_FILE_OFFSET_BITS=64' '-DPAGESPEED_SUPPORT_POSIX_SHARED_MEM' '-DGTEST_HAS_RTTI=1' '-DCHROMIUM_BUILD' '-DTOOLKIT_VIEWS=1' '-DUI_COMPOSITOR_IMAGE_TRANSPORT' '-DUSE_AURA=1' '-DUSE_CAIRO=1' '-DUSE_GLIB=1' '-DUSE_DEFAULT_RENDER_THEME=1' '-DUSE_LIBJPEG_TURBO=1' '-DUSE_X11=0' '-DUSE_CLIPBOARD_AURAX11=1' '-DENABLE_ONE_CLICK_SIGNIN' '-DUSE_XI2_MT=2' '-DENABLE_REMOTING=1' '-DENABLE_WEBRTC=1' '-DENABLE_PEPPER_CDMS' '-DENABLE_CONFIGURATION_POLICY' '-DENABLE_INPUT_SPEECH' '-DENABLE_NOTIFICATIONS' '-DUSE_UDEV' '-DENABLE_EGLIMAGE=1' '-DENABLE_TASK_MANAGER=1' '-DENABLE_EXTENSIONS=1' '-DENABLE_PLUGIN_INSTALLATION=1' '-DENABLE_PLUGINS=1' '-DENABLE_SESSION_SERVICE=1' '-DENABLE_THEMES=1' '-DENABLE_AUTOFILL_DIALOG=1' '-DENABLE_BACKGROUND=1' '-DENABLE_GOOGLE_NOW=1' '-DCLD_VERSION=2' '-DENABLE_FULL_PRINTING=1' '-DENABLE_PRINTING=1' '-DENABLE_SPELLCHECK=1' '-DENABLE_CAPTIVE_PORTAL_DETECTION=1' '-DENABLE_APP_LIST=1' '-DENABLE_SETTINGS_APP=1' '-DENABLE_MANAGED_USERS=1' '-DENABLE_MDNS=1' '-DENABLE_SERVICE_DISCOVERY=1' '-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' '-DUSE_NSS=1' '-D__STDC_CONSTANT_MACROS' '-D__STDC_FORMAT_MACROS' '-DNDEBUG' '-DNVALGRIND' '-DDYNAMIC_ANNOTATIONS_ENABLED=0' '-D_FORTIFY_SOURCE=2' -Ithird_party\/chromium\/src -I. -Ithird_party\/css_parser\/src -Ithird_party\/google-sparsehash\/gen\/arch\/linux\/ia32\/include -Ithird_party\/google-sparsehash\/src -Iout\/Release\/obj\/gen\/protoc_out\/instaweb -Ithird_party\/protobuf\/src -Ithird_party\/re2\/src -Ithird_party\/protobuf  -fno-stack-protector -march=armv5te -mtune=xscale -mfloat-abi=soft -mabi=aapcs-linux -mthumb -O2 --param=ssp-buffer-size=4 -Wsign-compare -pthread -fno-exceptions -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -fexceptions -fasynchronous-unwind-tables -Wno-unused-but-set-variable -march=armv5te -mtune=xscale -mfloat-abi=soft -mabi=aapcs-linux -mthumb -O2 -mfpu=vfp -mfloat-abi=soft -mthumb -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -fno-threadsafe-statics -fvisibility-inlines-hidden -frtti -Wno-abi -MMD -MF out\/Release\/.deps\/out\/Release\/obj.target\/instaweb_rewriter\/net\/instaweb\/rewriter\/js_replacer.o.d.raw -march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -pthread -O2 -lintl -Wall -I\/ffp\/include -c -o out\/Release\/obj.target\/instaweb_rewriter\/net\/instaweb\/rewriter\/js_replacer.o net\/instaweb\/rewriter\/js_replacer.cc\r\n\tFind the *.mk: \r\n\tgrep -I -r \"js_replacer.o\" .\r\n\tsed -i s\/\"-Werror\"\/\"\"\/ .\/net\/instaweb\/instaweb_rewriter.target.mk\r\n\tsed -i s\/\"-Werror\"\/\"\"\/ .\/third_party\/css_parser\/css_parser.target.mk\r\n\r\n#START BULDING (check error and apply patch before make):\r\n\tcd ~\/compile\/mod_pagespeed\/src\r\n\trm -r ~\/compile\/mod_pagespeed\/src\/out\r\n\trm nohup.out\r\n\techo -e \"X-Mod-Pagespeed:\\n`cat ~\/compile\/mod_pagespeed\/src\/net\/instaweb\/public\/VERSION`\" &gt; nohup.out\r\n\t#nohup \/ffp\/bin\/make AR.host=`pwd`\/build\/wrappers\/ar.sh AR.target=`pwd`\/build\/wrappers\/ar.sh BUILDTYPE=Release V=1 &amp;\r\n\tnohup \/ffp\/bin\/make AR.host=`pwd`\/build\/wrappers\/ar.sh AR.target=`pwd`\/build\/wrappers\/ar.sh APACHE_ROOT=\/ffp\/opt\/apache-2.2.29-worker APACHE_MODULES=\/ffp\/opt\/apache-2.2.29-worker\/modules APACHE_DOC_ROOT=\/ffp\/opt\/apache-htdocs APACHE_USER=nobody APACHE_GROUP=nobody BINDIR=\/ffp\/bin BUILDTYPE=Release V=1 &amp;\r\n\trenice -11 `pidof cc1plus` -p `pidof make` -p `pidof as` -p `pidof ld` -p `pidof configure` -p `pidof cc1` -p `pidof ccmake`\r\n\ttail -f nohup.out\r\n\tMPSB=\"2015-03-12 pagespeed trunk\"\r\n\tcd ~\/NSA310-backups &amp;&amp; mkdir \"$MPSB\"\r\n\tcd \"$MPSB\"\r\n\tmv -v ~\/compile\/mod_pagespeed\/src\/nohup.out build.log\r\n\r\n#TESTS:\r\n\t#Is the mozilla for python certificate:\r\n\twget -nv http:\/\/curl.haxx.se\/ca\/cacert.pem -O \/ffp\/etc\/ssl\/cert.pem\r\n\texport SSL_CERT_FILE=\/ffp\/etc\/ssl\/cert.pem\r\n\t#.\/out\/Release\/mod_pagespeed_test\r\n\t#.\/out\/Release\/pagespeed_automatic_test\r\n\tcd ~\/compile\/mod_pagespeed\/src\r\n\trm nohup.out\r\n\tnohup .\/out\/Release\/pagespeed_automatic_test &amp;\r\n\ttail -f nohup.out\r\n\tcd ~\/NSA310-backups &amp;&amp; cd \"$MPSB\"\r\n\tmv -v ~\/compile\/mod_pagespeed\/src\/nohup.out tests.log\r\n\r\n#INSTALLATION:\r\n\tModify \/ffp\/opt\/apache-2.2.29-worker\/conf\/httpd.conf for User and Group to be like in \/etc\/service_config\/httpd.conf.\r\n\tsed -i s\/\"User daemon\"\/\"User nobody\"\/ \/ffp\/opt\/apache-2.2.29-worker\/conf\/httpd.conf\r\n\tsed -i s\/\"Group daemon\"\/\"Group nobody\"\/ \/ffp\/opt\/apache-2.2.29-worker\/conf\/httpd.conf\r\n\tcd ~ &amp;&amp; .\/x.sh xstop\r\n\trm -v \/ffp\/opt\/apache-2.2.29-worker\/modules\/*pagespeed*.*\r\n\trm -v \/ffp\/opt\/apache-2.2.29-worker\/conf\/*pagespeed*.*\r\n\trm -v \/ffp\/bin\/pagespeed_js_minify\r\n\tchmod +x ~\/compile\/mod_pagespeed\/src\/install\/install_apxs.sh\r\n\tcd ~\/compile\/mod_pagespeed\/src\/install\r\n\tNO_SUDO=1 APXS_BIN=\/ffp\/opt\/apache-2.2.29-worker\/bin\/apxs ~\/compile\/mod_pagespeed\/src\/install\/install_apxs.sh\r\n\tcp -v \/ffp\/opt\/apache-2.2.29-worker\/modules\/*pagespeed*.so \/ffp\/opt\/apache-htdocs\/ffp_0.7_armv5\/packages\/\r\n\tcp -v \/ffp\/bin\/pagespeed_js_minify \/ffp\/opt\/apache-htdocs\/ffp_0.7_armv5\/packages\/\r\n\tmkdir -p \/ffp\/var\/cache\/mod_pagespeed\r\n\trm -r \/ffp\/var\/cache\/mod_pagespeed\/*\r\n\tmkdir -p \/ffp\/var\/log\/pagespeed\r\n\tchown nobody:nobody \/ffp\/var\/cache\/mod_pagespeed\r\n\tchmod 777 -R \/ffp\/var\/cache\/mod_pagespeed\r\n\tchown nobody:nobody \/ffp\/var\/log\/pagespeed\r\n\tchmod 777 -R \/ffp\/var\/log\/pagespeed\r\n\tcd ~\/NSA310-backups &amp;&amp; cd \"$MPSB\"\r\n\tcp -v \/ffp\/opt\/apache-2.2.29-worker\/modules\/*pagespeed*.* .\r\n\tcp -v \/ffp\/opt\/apache-2.2.29-worker\/conf\/*pagespeed*.* .\r\n\tcp -v \/ffp\/bin\/pagespeed_js_minify .\r\n\t#rm -r \/ffp\/var\/cache\/mod_pagespeed\/*\r\n\tcd ~ &amp;&amp; .\/x.sh hstart\r\n\tdu -sh --apparent-size \/ffp\/var\/cache\/mod_pagespeed\r\n<\/pre>\n<p><a title=\"modpagespeed-patch.sh\" href=\"http:\/\/adrhc.go.ro\/public\/modpagespeed-patch.sh\" target=\"_blank\">click to get modpagespeed-patch.sh<\/a><\/p>\n<pre class=\"brush:bash shell\">#depot_tools\r\ncd ~\/compile\r\nrm -r depot_tools\r\nsvn co http:\/\/src.chromium.org\/svn\/trunk\/tools\/depot_tools\r\ncd ~\/compile\/depot_tools\/\r\n~\/x.sh ffpg\r\n#Run this in order to allow depot_tools to auto-update (only when you're logged with root):\r\n#sed -i s#\\\"\\$USER\\\"\\ ==\\ \\\"root\\\"#\\\"\\$USER\\\"\\ ==\\ \\\"dont-let-me-run-as-root\\\"# ~\/compile\/depot_tools\/update_depot_tools\r\n#otherwise you'll get the message: Running depot tools as root is sad.\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#See 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. #mod_pagespeed (see depot_tools and modpagespeed-patch.sh below) rm -r ~\/compile\/mod_pagespeed mkdir ~\/compile\/mod_pagespeed cd ~\/compile\/mod_pagespeed #export PATH=\/ffp\/sbin:\/usr\/sbin:\/sbin:\/ffp\/bin:\/usr\/bin:\/bin:\/ffp\/opt\/ejre1.7.0_60\/bin:\/ffp\/home\/root\/compile\/depot_tools\/ [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/install-configure-googles-mod_pagespeed-for-apache\/#more-64\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Install &#038; configure google&#8217;s mod_pagespeed for apache<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6,44,11],"tags":[94,101,102],"class_list":["post-64","post","type-post","status-publish","format-standard","hentry","category-compiling-from-source","category-configuration","category-http-web-server","category-linux","tag-apache","tag-mod_pagespeed","tag-pagespeed"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=64"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/64\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}