Home  >  Q&A  >  body text

Server - How do IIS and Apache coexist?

IIS occupies port 80. Apache also occupies port 80. After changing the apache port to 8080, the php site cannot be accessed through IIS. It feels too troublesome to publish php sites with apache. Is there any simple way to publish php?

大家讲道理大家讲道理2713 days ago730

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-16 16:59:39

    Method 1

    在IIS上配置PHP环境,直接把PHP项目部署到IIS,不用Apache

    Method 2

    你把Apache的项目部署到IIS

    Method 3

    Apache可以重定向,IIS部署8080,对应项目重定向到IIS
    

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 16:59:39

    1. It is recommended to configure PHP in IIS, it is also very easy to use now

    2. If you insist on installing Apache, you can install nginx

    Nginx  监听 80
    IIS    监听 8080
    Apache 监听 8081
        server {
            listen 80;
            server_name  $host;
            
            location / {
                proxy_pass http://127.0.0.1:8080;
                proxy_set_header Host $host;
            }
        }
    
        server {
            listen 80;
            server_name  www.abc.com abc.com php.abc.com;
            
            location / {
                proxy_pass http://127.0.0.1:8081;
                proxy_set_header Host $host;
            }
        }
    

    reply
    0
  • Cancelreply