Home  >  Q&A  >  body text

linux - 能否在同一台服务器上同时安装和运行 nginx 和 apache 且同时监听 80端口?

有一台 vps 上面已经装了 apache 跑着一个Wordpress的博客。
想再装一个 nginx,挂一个 typecho,都在80端口,可行吗?

PHP中文网PHP中文网2743 days ago876

reply all(7)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 13:07:06

    Two programs cannot monitor the same port at the same time. You can try using nginx+php-fpm or all on apache.

    I personally recommend using nginx+php-fpm, because php-fpm has been officially included and maintained by the official team, and wordpress.com also uses a deployment solution like nginx+php-fpm.

    reply
    0
  • 阿神

    阿神2017-04-17 13:07:06

    Why not configure several different apps on nginx?

    Nginx can be configured with several different domain names.

    For example
    http://xiugq.blog.51cto.com/813544/693448

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 13:07:06

    Just configure multiple domain names. Why do you have to use apache and nginx to monitor at the same time?

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 13:07:06

    Multiple IPs are OK.
    For example one is 111.111.111.111:80 and the other is 127.0.0.1:80 .

    reply
    0
  • 迷茫

    迷茫2017-04-17 13:07:06

    You can use nginx reverse proxy, but it is recommended that you move WordPress to apache.

    reply
    0
  • 阿神

    阿神2017-04-17 13:07:06

    No, it will conflict.

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 13:07:06

    If you just answer the question,
    Then it’s: no.
    There can only be one software listening on a port.

    If you have another answer, then it would be:
    Web server has multiple domain names (the same host can be accessed through multiple domain names) (the virtual machine can be accessed by changing the host to create a virtual domain name),

    reply
    0
  • Cancelreply