linux - 如果您使用 nginx,请删除 apache2?

标签 linux apache nginx server vhosts

我对何时使用 nginx 或 apache 有点困惑。 正如我所看到的,很多人使用 nginx 作为 apache2 的代理来重定向到网站,但是你不能使用 nginx vhost 来做到这一点吗? 如果我将 nginx 添加到我的服务器,我的服务器应该有 apache2 吗?或者我应该删除?如果我删除 Apache 有什么关系吗?

最佳答案

您的系统上可以同时拥有 Apache 和 Nginx Web 服务器,但您应该采取措施避免端口冲突:

  1. 确保他们在配置中不使用相同的端口

  • 一次仅运行其中一个并作为守护进程启用
  • 至于同时使用两者的原因,这里有一篇文章解释了其中一个常见原因以及如何配置它: https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-reverse-proxy-for-apache

    关于linux - 如果您使用 nginx,请删除 apache2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54884129/

    相关文章:

    linux - 如何在shell脚本中无密码切换到另一个用户

    java - ProjectForge 中的 LifecycleException

    python - 如何停止重定向移动请求 Nginx Flask?

    node.js - 将 pm2 的集群模块与 socket.io 和 socket.io-redis 一起使用

    php - Codeigniter 子域和 WAMP

    ruby-on-rails - rbenv : bundle: command not found on production server

    c++ - Qt 多线程信号量和条件变量

    linux - bash 在 screen 内时,如果不适合一行,输出将被截断

    linux - 无法使用 OpenSSL 1.0.2k 构建 APR-util 1.5.4

    php - vHost 和 SSL 中的 mod_rewrite