VPS侦探论坛

 找回密码
 注册
查看: 5031|回复: 12

[Apache] lnmp1.4,如何新增nginx模块,有类似的教程吗?

[复制链接]
发表于 2017-8-6 17:07:53 | 显示全部楼层 |阅读模式

我是lnmp1.4测试版,现在想给Nginx新增一个pagespeed模块,怎么安装呢?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-8-6 18:10:59 | 显示全部楼层


这是升级nginx时给出的错误:
Current Nginx Version:.sh: line 5: /usr/local/nginx/sbin/nginx: No such file or directory
You can get version number from http://nginx.org/en/download.html
Please enter nginx version you want, (example: 1.7.8):

然后我输入1.12.0:
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional modules
adding module in /home/dev/ngx_pagespeed-1.12.34.2-stable
mod_pagespeed_dir=/home/dev/ngx_pagespeed-1.12.34.2-stable/psol/include
build_from_source=false
checking for psol ... not found
./configure: error: module ngx_pagespeed requires the pagespeed optimization library.
Look in /home/dev/lnmp1.4/src/nginx-1.12.0/objs/autoconf.err for more details.
make: *** No rule to make target `build', needed by `default'.  Stop.
mv: cannot stat `/usr/local/nginx/sbin/nginx': No such file or directory
cp: cannot stat `objs/nginx': No such file or directory
Test nginx configure file...
include/upgrade_nginx.sh: line 59: /usr/local/nginx/sbin/nginx: No such file or directory
upgrade...
make: *** No rule to make target `upgrade'.  Stop.
Checking ...
Error: Nginx upgrade failed.


军哥给看看啥情况
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-8-6 18:24:07 | 显示全部楼层

我知道了,军哥,原来是需要gcc4.8+版本的,,那么升级gcc按下面的方法吗?https://bbs.vpser.net/viewthread.php?tid=14542&highlight=gcc

然后我添加ngx_pagespeed模块到nginx,是在lnmp1.4目录下的include下upgrade_nginx.sh添加--add-module=/home/dev/ngx_pagespedxxxxx;

最后返回Lnmp.4目录下,执行sudo ./upgrade.sh nginx,,依然输入我之前的Nginx版本号就算是添加模块成功了对吧?

但是gcc模块我看了上面链接的那个教程貌似是单独安装的,那么安装了之后他会覆盖之前的版本吗?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-8-8 09:37:33 | 显示全部楼层

回复 3# 的帖子




嗯,不过编译安装gcc太慢,现在一般较新的linux发行版应该gcc应该都是很新的

只要是正确的版本号就可以,与当前版本一样也没问题,升级时会自动备份原版本并覆盖安装
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-8-9 10:48:31 | 显示全部楼层

回复 3# 的帖子


军哥,我本地虚拟机升级gcc正常,但是服务器上我使用dev用户编译安装时出错了。。
后来解决了,是因为没有yum update的原因,,

[ 本帖最后由 609926202 于 2017-8-9 11:27 编辑 ]

军哥运维代购:http://shop63846532.taobao.com/

发表于 2017-9-4 17:09:05 | 显示全部楼层

楼主 麻烦问下 怎么给nginx 添加新模块啊 比如 --add-module=/home/nginx_mod_h264_streaming-2.2.7
发表于 2017-9-5 09:18:40 | 显示全部楼层

回复 6# 的帖子


3楼都已经给出详细教程了!!!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-9-5 18:41:06 | 显示全部楼层

回复 7# 的帖子


你好 军哥,麻烦问下,如果我是要添加nginx 自带模块的话 是不是 这样来做
Nginx_Modules_Options='--with-http_mp4_module --with-http_flv_module'
就是添加支持mp4文件的模块,我这样添加之后,还是访问不了 .
下边是 nginx -V 查看的信息
nginx version: nginx/1.12.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
built with OpenSSL 1.0.2l  25 May 2017
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module --with-openssl=/home/lnmp1.4-full/src/openssl-1.0.2l --with-ld-opt='-ljemalloc' --with-http_mp4_module --with-http_flv_module

其中已经有 --with-http_mp4_module --with-http_flv_module  这俩个模块了

配置文件是

location ~ \.mp4$  {   
                        mp4;
                        root /home/wwwroot/file;  
                        mp4_buffer_size     1m;  
                }
不知道哪里有问题,麻烦军哥 帮忙看下 谢谢了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-9-6 09:25:59 | 显示全部楼层

回复 8# 的帖子



不清楚你说的访问不了是出错还是什么,没有具体错误信息没法说,这是反馈问题的基本要求
mp4播放要依赖浏览器支持或依赖播放器
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-9-6 10:05:08 | 显示全部楼层

回复 9# 的帖子




你好 军哥, 在浏览器上直接访问 *.mp4 文件的时候   

报错 显示 404 Not Found  nginx   用谷歌和火狐还有IE 都是
lnmp.conf 配置文件
==========================================================
Download_Mirror='https://soft.vpser.net'

Nginx_Modules_Options='--with-http_mp4_module --with-http_flv_module'
PHP_Modules_Options=''

##MySQL/MariaDB database directory##
MySQL_Data_Dir='/usr/local/mysql/var'
MariaDB_Data_Dir='/usr/local/mariadb/var'
##Default website home directory##
Default_Website_Dir='/home/wwwroot/default'
Enable_Nginx_Openssl='y'

vhosts.conf 配置文件
==============================================================
location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

        location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*.(js|css)?$
        {
            expires      12h;
        }
               
                location ~ .mp4$  {   
                        mp4;
                        root /home/wwwroot/file;  
                        mp4_buffer_size     1m;  
                        #mp4_max_buffer_size 5m;  
                }
               
                location ~ .flv$ {  
                        flv;  
                        root /home/wwwroot/file;
                }  
               
        location ~ /.well-known {
            allow all;
        }
               
        location ~ /.
        {
            deny all;
        }
               
                location ~* .(eot|ttf|woff|woff2|svg|otf)$ {
                        add_header Access-Control-Allow-Origin *;
                }
               
        access_log  /home/wwwlogs/access.log;
发表于 2017-9-6 19:31:16 | 显示全部楼层

404是文件不存在
发表于 2017-9-16 09:53:47 | 显示全部楼层

回复 11# 的帖子


军哥 文件肯定是存在的,感觉好像模块没安装成功,或者配置不知道哪里有问题
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-9-19 16:52:22 | 显示全部楼层
问题已经处理,不好意思,军哥打扰了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-3-29 13:58 , Processed in 0.030163 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表