› NGINX
› NGINX Trac
› 3rd Party Modules
› Security Advisories
› CHANGES
› OpenResty
› ngx_lua
› Tengine
在线学习资源
› NGINX 开发从入门到精通
NGINX Modules
› ngx_echo
nciyuan
V2EX  ›  NGINX

Nginx 的优点到底有多少以至于有些程序都不支持 Apache 了

  •  
  •   nciyuan · Oct 23, 2017 · 10416 views
    This topic created in 3322 days ago, the information mentioned may be changed or developed.

    我是个 Lamp 的用户,这是前提啊 23333 表示就是说有些大型的 PHP 程序,比如 KPPW ( www.kppw.cn ),ECJia ( www.ecjia.com ) 以前都是捣鼓 Discuz 啊,WordPress 这种大众化的程序,可是一上这种的大型程序 Apache 或者说 PHP 就趴窝了,不能正常运行了 环境是 LAMP+Debian,APT 源直接安装的,当时还是觉得 Apache 有 rewrite 之类的功能 虽说 Nginx 当然可以实现,可是对于我这种“普通中级玩家”来说 Apache 还是挺简单的 结果这些程序就挂了。 这些程序的网站上大部分都推荐用 CentOS+LNMP 所以我想问 Apache 为何无法运行呢?或者说有什么 Nginx 的必备功能做不到呢?

    38 replies  •  2018-12-14 01:34:14 +08:00
    likuku
    likuku
    Oct 23, 2017
    1
    天下武功唯快不破
    sagaxu
    sagaxu
    Oct 23, 2017❤️21
    2
    上一次用 apache 的时候,上海内环房价才几千一平
    vus520
    vus520
    Oct 23, 2017❤️2
    3
    什么?现在都用 Caddy 了
    AlwaysBehave
    AlwaysBehave
    Oct 23, 2017
    4
    用 LEMP 吧,通吃(噗
    还有,给点用 Apache 可以但是 Nginx 就挂了的例子啊,多半是 fpm 没配好?(雾)
    Link:
    https://lemp.io/
    shiny
    shiny
    Oct 23, 2017
    5
    是没配置好吧,我还没遇到过 nginx 能用 Apache 不能用的,除非用到了特殊的函数才可能导致 Web 服务器之间的不兼容,比如 fastcgi_finish_request / apache_request_headers
    nciyuan
    nciyuan
    OP
    Oct 23, 2017
    6
    @sagaxu 23333 现在翻了 20 倍
    @AlwaysBehave 需要 fan wall 吗,我这打不开
    @shiny 我的配置都是写好一份直接复制粘贴的,我看应该挺全的呢
    sunmonster
    sunmonster
    Oct 23, 2017
    7
    php 又不是直接通过 nginx 或 apache 来运行的,所以跟 nginx 或 apache 没有半毛钱关系,应该是 apache 的配置问题
    AlwaysBehave
    AlwaysBehave
    Oct 23, 2017
    8
    @nciyuan 不需要的样子
    其实就是 Nginx+Apache+Mysql+php
    sunmonster
    sunmonster
    Oct 23, 2017
    9
    动态网站 apche 跟 nginx 真的差别不大,现在 apache 也支持 event MPM,很多说 apache 落后的都是停留在 5,6 年前,也没用过,人云亦云。但是我用 nginx,并不是 nginx 快,而是 nginx 比较轻量,而且配置简单可读行高
    momocraft
    momocraft
    Oct 23, 2017
    10
    多写一份文档就多一份成本
    sagaxu
    sagaxu
    Oct 23, 2017
    11
    @sunmonster 时至今日,apache 份额仍比 nginx 高
    wwek
    wwek
    Oct 23, 2017
    12
    搭配跑 PHP 来说 apache 并不比 nginx 慢, 为什么用 nginx 那是因为功能强悍,性能强悍,生态丰富呀
    murmur
    murmur
    Oct 23, 2017
    13
    很多人只是拿 nginx 当负载均衡或者跑静态资源吧
    wdlth
    wdlth
    Oct 23, 2017
    14
    没遇到你说的不能用 Apache 的程序,Apache 的配置方法有多种,如果是 Rewrite 规则有区别的话,可以转换一下。
    carlclone
    carlclone
    Oct 23, 2017
    15
    你连 PHP 和 Apache,Nginx 的关系都没搞清楚吧
    boboliu
    boboliu
    Oct 23, 2017 via Android
    16
    将真,nginx 配置写起来舒服
    nciyuan
    nciyuan
    OP
    Oct 23, 2017 via Android
    17
    表示能有大神讲一下为啥都是 PHP 就运行不起来啊


    @carlclone 明白啊,只是为啥很多人都着魔似的推荐 Nginx
    @sunmonster 可是我就把能跑 wordpress 的 vhost 改下 SSL 和网站目录就装上了
    defunct9
    defunct9
    Oct 23, 2017 via iPhone
    18
    你配错了而已
    hard2reg
    hard2reg
    Oct 24, 2017
    19
    @vus520 caddy 不是收费吗
    EmmaSwan
    EmmaSwan
    Oct 24, 2017
    20
    只用 apache 和 caddy
    N 基本不碰
    NoAnyLove
    NoAnyLove
    Oct 24, 2017
    21
    以前在 VPS 上架自己的博客,因为内存小,所以用的 Nginx。还没有用过 Caddy 呢,怎么样?
    kn007
    kn007
    Oct 24, 2017
    22
    同 2 楼,用 Apache 都是多年的事了。。。Nginx 用了好久,以至于 Apache 的配置都不会写了
    0ZXYDDu796nVCFxq
    0ZXYDDu796nVCFxq
    Oct 24, 2017 via iPhone
    23
    可以把 nginx.conf 当一门语言来写,nginx 的很多变量都是可以修改的,玩起来很爽
    mosliu
    mosliu
    Oct 24, 2017
    24
    感觉 caddy 现在越来越好了。。。
    googlebot
    googlebot
    Oct 24, 2017 via iPad
    25
    很多年前,一个牛人写一篇 blog,128m 跑 ngix,从此 ngix 就出名了,
    其实 ngix 兼容性挺差,
    lfzyx
    lfzyx
    Oct 24, 2017
    26
    程序怎么可能特意去辨别前端是哪个 web 服务器,程序只会通过网关接口( Web Server Gateway Interface )通讯
    m939594960
    m939594960
    Oct 24, 2017
    27
    @vus520 我看 caddy 好像商用要付费啊
    jyf007
    jyf007
    Oct 24, 2017
    28
    @gstqc 这个叫 DSL
    @nciyuan 我透一下,某著名网站先是 wamp,接着我提议切 lnmp,结果不行,框架是 thinkphp,我找了个 nginx 的伪静态,只能正常显示页面。
    breestealth
    breestealth
    Oct 24, 2017
    29
    @googlebot 你说的应该是当时在金山的张宴。
    toxicant
    toxicant
    Oct 24, 2017
    30
    说差距不大的你玩玩 laravel 试试....
    scriptB0y
    scriptB0y
    Oct 24, 2017
    31
    我还用 apache,上次配置 https 有个地方花了两年才解决……
    msg7086
    msg7086
    Oct 24, 2017❤️1
    32
    @googlebot 128M 跑 nginx 是什么梗?
    只见过 64M 跑 nginx+mysql+wordpress 的。
    rffan
    rffan
    Oct 24, 2017
    33
    @msg7086 LEB 好多这个究极配置,128 的 OpenVZ 说是 128,OpenVZ 应该懂的,最多也就 64 的那种。
    skylancer
    skylancer
    Oct 24, 2017
    34
    喜欢 lighttpd 的只有我一个么
    skylancer
    skylancer
    Oct 24, 2017
    35
    擦 居然是 nginx 节点
    MagaFun
    MagaFun
    Oct 24, 2017
    36
    我个人属于 Apache 用习惯了,也懒得转 nginx 了,因为第一次做网站是 MediaWiki 网站。

    Apache 有的时候是真难用,比如中文子目录的问题就很烦人。不过其实我也很想学习一下 nginx 的。
    orderc
    orderc
    Oct 25, 2017
    37
    nginx 配置简单就这样
    aabbcc
    aabbcc
    Dec 14, 2018
    38
    @googlebot 这什么的。32M 内存 用 lighttpd + php +SQLite3 跑 typecho
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2133 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 100ms · UTC 07:46 · PVG 15:46 · LAX 23:46 · JFK 02:46
    ♥ Do have faith in what you're doing.