Ubuntu 卸下Nginx并安装带有Pagespeed模块的Nginx

Ubuntu 卸下Nginx并安装带有Pagespeed模块的Nginx,ubuntu,nginx,upgrade,pagespeed,Ubuntu,Nginx,Upgrade,Pagespeed,所以我刚刚用Ubuntu 16.04 LTS安装了一个新的Linode,并且安装了Nginx 1.10.0 nginx -v nginx version: nginx/1.10.0 (Ubuntu) 我按照google的指示安装了新版本的Nginx,并添加了Pagespeed模块,如下所述: 当我使用nginx-v时,仍然安装了以前的版本,并且我有一个带有nginx-nginx-1.11.8的新文件夹!如何删除以前的版本并安装pagespeed?非常困惑 更新 我尝试安装动态模块,但在重新编译

所以我刚刚用Ubuntu 16.04 LTS安装了一个新的Linode,并且安装了Nginx 1.10.0

nginx -v
nginx version: nginx/1.10.0 (Ubuntu)
我按照google的指示安装了新版本的Nginx,并添加了Pagespeed模块,如下所述:

当我使用nginx-v时,仍然安装了以前的版本,并且我有一个带有nginx-nginx-1.11.8的新文件夹!如何删除以前的版本并安装pagespeed?非常困惑

更新

我尝试安装动态模块,但在重新编译时得到以下结果:

  sudo make install
    make -f objs/Makefile install
    make[1]: Entering directory '/home/henri/nginx-1.10.0'
test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
test -d '/usr/local/nginx/sbin' \
    || mkdir -p '/usr/local/nginx/sbin'
test ! -f '/usr/local/nginx/sbin/nginx' \
    || mv '/usr/local/nginx/sbin/nginx' \
        '/usr/local/nginx/sbin/nginx.old'
cp objs/nginx '/usr/local/nginx/sbin/nginx'
test -d '/usr/local/nginx/conf' \
    || mkdir -p '/usr/local/nginx/conf'
cp conf/koi-win '/usr/local/nginx/conf'
cp conf/koi-utf '/usr/local/nginx/conf'
cp conf/win-utf '/usr/local/nginx/conf'
test -f '/usr/local/nginx/conf/mime.types' \
    || cp conf/mime.types '/usr/local/nginx/conf'
cp conf/mime.types '/usr/local/nginx/conf/mime.types.default'
test -f '/usr/local/nginx/conf/fastcgi_params' \
    || cp conf/fastcgi_params '/usr/local/nginx/conf'
cp conf/fastcgi_params \
    '/usr/local/nginx/conf/fastcgi_params.default'
test -f '/usr/local/nginx/conf/fastcgi.conf' \
    || cp conf/fastcgi.conf '/usr/local/nginx/conf'
cp conf/fastcgi.conf '/usr/local/nginx/conf/fastcgi.conf.default'
test -f '/usr/local/nginx/conf/uwsgi_params' \
    || cp conf/uwsgi_params '/usr/local/nginx/conf'
cp conf/uwsgi_params \
    '/usr/local/nginx/conf/uwsgi_params.default'
test -f '/usr/local/nginx/conf/scgi_params' \
    || cp conf/scgi_params '/usr/local/nginx/conf'
cp conf/scgi_params \
    '/usr/local/nginx/conf/scgi_params.default'
test -f '/usr/local/nginx/conf/nginx.conf' \
    || cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf'
cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf.default'
test -d '/usr/local/nginx/logs' \
    || mkdir -p '/usr/local/nginx/logs'
test -d '/usr/local/nginx/logs' \
    || mkdir -p '/usr/local/nginx/logs'
test -d '/usr/local/nginx/html' \
    || cp -R html '/usr/local/nginx'
test -d '/usr/local/nginx/logs' \
    || mkdir -p '/usr/local/nginx/logs'
test -d '/usr/local/nginx/modules' \
    || mkdir -p '/usr/local/nginx/modules'
test ! -f '/usr/local/nginx/modules/ngx_pagespeed.so' \
    || mv '/usr/local/nginx/modules/ngx_pagespeed.so' \
        '/usr/local/nginx/modules/ngx_pagespeed.so.old'
cp objs/ngx_pagespeed.so '/usr/local/nginx/modules/ngx_pagespeed.so'
make[1]: Leaving directory '/home/henri/nginx-1.10.0'

However I do not see the module!
nginx -V output:

nginx version: nginx/1.10.0 (Ubuntu)
built with OpenSSL 1.0.2g  1 Mar 2016
TLS SNI support enabled

配置参数:--使用cc opt='-g-O2-fPIE-fstack-protector-strong-Wformat-Werror=format security-Wdate time-D_FORTIFY_SOURCE=2'--使用ld opt='-Wl,-b符号函数-fPIE-pie-Wl,-z,relro-Wl,-z,现在'--prefix=/usr/share/nginx--conf path=/etc/nginx/nginx.conf--http log path=/var/log/nginx/access.log--error log path=/var/log/nginx/error.log--lock path=/var/lock/nginx.lock--pid path=/run/nginx.pid--http client body temp path=/var/lib nginx/body--http fastcgi temp path=/var/lib nginx/fastcgi--http-scgi-temp-path=/var/lib/nginx/scgi--http-uwsgi-temp-path=/var/lib/nginx/uwsgi--with-debug--pcre-jit--with-ipv6--with-http_-ssl_模块--with-http_存根_-status_模块--with-http_realip_模块--with-http_auth_请求_模块--with-http_添加_模块--http_-dav_模块--with-http_-geoip_模块----with-http_gzip_静态_模块——with-http_image_filter_模块——with-http_v2_模块——with-http_sub_模块——with-http_xslt_模块——with-stream——with-mail_ssl_模块——with线程——添加模块=/build/nginx-pzhfc2/nginx-1.10.0/debian/modules/nginx-auth-pam--add module=/build/nginx-pzhfc2/nginx-1.10.0/debian/modules/nginx-dav-ext-module--add module=/build/nginx-pzhfc2/nginx-1.10.0/debian/modules/nginx-echo--add module=/build/nginx-pzhfc2/nginx-1.10.0/debian/modules/nginx-upper-fair--add module=/build/nginx-pzhfc2/nginx-1.10.0/debian/modules/ngx\u http\u substitutions\u filter\u module

apt get remove nginx
应该从Ubuntu存储库中删除您安装的版本


作为替代方案,我建议使用
-m
选项将pagespeed安装为动态模块。这样,您就可以保留从Ubuntu安装的NGINX,只需以pagespeed编译和加载即可。完整的说明就在这里。

apt get remove nginx
应该删除您从Ubuntu存储库安装的版本


作为替代方案,我建议使用
-m
选项将pagespeed安装为动态模块。这样,您就可以保留从Ubuntu安装的NGINX,只需以pagespeed编译和加载即可。完整的说明都在这里。

两天后。。。我终于发现我做错了什么。按照说明操作时,您需要使用当前版本中相同的扩展重新验证nginx(nginx-V将提供所有已安装的扩展)。添加动态模块后,可以按照说明将其包含在文件中

两天后。。。我终于发现我做错了什么。按照说明操作时,您需要使用当前版本中相同的扩展重新验证nginx(nginx-V将提供所有已安装的扩展)。添加动态模块后,可以按照说明将其包含在文件中

要构建二进制兼容版本的ngx_pagespeed.so(动态模块),您可能需要将
--with cc opt=“-DNGX_HTTP_HEADERS”
添加到nginx的配置行中。 nginx-V的输出不会暗示这一点,但是官方的稳定ppa 似乎需要它(我选中了1.12.1)

有关更多上下文,请参见


Otto

要构建二进制兼容版本的ngx_pagespeed.so(动态模块),您可能需要将
--with cc opt=“-DNGX_HTTP_HEADERS”
添加到nginx的配置行中。 nginx-V的输出不会暗示这一点,但是官方的稳定ppa 似乎需要它(我选中了1.12.1)

有关更多上下文,请参见


奥托

我遵照你的指示,没有任何错误。但是,当我运行Nginx-V时,模块不在那里。我会把我看到的更新。感谢将/usr/local/nginx/modules/ngx_pagespeed.so复制到/etc/nginx/modules/ngx_pagespeed.so,并添加
load_module“modules/ngx_pagespeed.so”到/etc/nginx/nginx.conf的顶部并重新加载nginx不起作用我得到:nginx:[emerg]module”/etc/nginx/modules/ngx_pagespeed.so“在/etc/nginx/nginx.conf:1 nginx:configuration file/etc/nginx/nginx.conf测试中不兼容二进制文件”您必须根据正在运行的nginx的相同版本进行编译,在您的情况下为1.10.0。使用此源代码并重新编译不幸的相同错误,我仍然没有在列表中看到该模块。我按照您的说明进行操作,没有错误。但是,当我运行Nginx-V时,模块不在那里。我会把我看到的更新。感谢将/usr/local/nginx/modules/ngx_pagespeed.so复制到/etc/nginx/modules/ngx_pagespeed.so,并添加
load_module“modules/ngx_pagespeed.so”到/etc/nginx/nginx.conf的顶部并重新加载nginx不起作用我得到:nginx:[emerg]module”/etc/nginx/modules/ngx_pagespeed.so“在/etc/nginx/nginx.conf:1 nginx:configuration file/etc/nginx/nginx.conf测试中不兼容二进制文件”您必须根据正在运行的nginx的相同版本进行编译,在您的情况下为1.10.0。使用这个源代码并重新编译不幸的相同错误,我仍然没有看到我的列表中的模块。