ngx_pagespeed 安装问题

使用官方自动安装的命令
https://modpagespeed.com/doc/...

bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
     --nginx-version latest

最后一步显示

`
About to build nginx. Do you have any additional ./configure
arguments you would like to set? For example, if you would like
to build nginx with https support give --with-http_ssl_module
If you don't have any, just press enter.

About to configure nginx with:

./configure --add-module=/root/ngx_pagespeed-latest-stable
Does this look right? [Y/n] y
checking for OS

    • Linux 4.4.0-75-generic x86_64

    1. for C compiler ... not found

    ./configure: error: C compiler cc is not found

    Error: Failure running './configure --add-module=/root/ngx_pagespeed-latest-stable', exiting.
    `

    我这里没有其他额外的模块安装,所以选择y, 但是不成功。
    我使用的是ubuntu 16.0.4
    pkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev unzip 这些包我都安装成功了。

    网上其他的方法,我也试过,包括
    https://zyf.im/2017/05/10/ins...
    https://rezhajulio.id/how-to-...
    https://www.howtoforge.com/tu...

    阅读 2.5k
    1 个回答

    建议手动安装不用自动安装
    https://www.modpagespeed.com/...
    然后注意下载POSL

    NPS_VERSION=1.12.34.2-stable
    cd
    wget https://github.com/pagespeed/ngx_pagespeed/archive/v${NPS_VERSION}.zip
    unzip v${NPS_VERSION}.zip
    cd ngx_pagespeed-${NPS_VERSION}/
    NPS_RELEASE_NUMBER=${NPS_VERSION/beta/}
    NPS_RELEASE_NUMBER=${NPS_VERSION/stable/}
    psol_url=https://dl.google.com/dl/page-speed/psol/${NPS_RELEASE_NUMBER}.tar.gz
    [ -e scripts/format_binary_url.sh ] && psol_url=$(scripts/format_binary_url.sh PSOL_BINARY_URL)
    wget ${psol_url}
    tar -xzvf $(basename ${psol_url})  # extracts to psol/

    POSL要在解压之后的pagespeed包里面下载,然后编译nginx

    撰写回答
    你尚未登录,登录后可以
    • 和开发者交流问题的细节
    • 关注并接收问题和回答的更新提醒
    • 参与内容的编辑和改进,让解决方法与时俱进
    推荐问题