Hi,

I used to use asp.net but found it restrictive in many way so I am learning php. I have built a forum and this is linked to IIS, (which i used with asp.net 2.0). Because I am new I am hitting problems but it seems the amount of people who understand php working with IIS are few and far between.
I have therefore decided to go all the way and download Apache. But I have been warned I cannot have IIS and Apache running on the same computer. I want to keep the current forum attatched to IIs because it is working fine (finally) and do any further work with new php applications with Apache. Can I do this on the same computer?

thanks

cass27😕

    You can certainly have Apache and IIS on the same computer, just not on the same port.

    In other words, you need to change the "Listen" directive in Apache's httpd.conf to a port other than port 80, the default HTTP port. That way, when you visit http://host you'll be hitting IIS, but you can use http://host:8080 to hit Apache (assuming you changed the Listen line to listen on port 8080).

      Do also note that Apache can handle .asp pages as well 😉 Apache::ASP

      You can get PHP running with IIS, it's just not as prevalent because PHP is more easily coupled with Apache. That doesn't mean it can't be done, just that it's more difficult.

        Bradgrafelman said:

        You can certainly have Apache and IIS on the same computer, just not on the same port.

        This is really great news! But you know whats coming next. How do I change the listen directive? Is httpd.conf a file? and is it simply a case of changing the scripting within it once its downloaded?
        Or is it a litle more complex and may need a tutorial?

        thanks again guys

          in httpd.conf look for the line "Listen", which then you could do:

          Listen *:8080

          to listen on all connections on port 8080, or specify a specific connection based on IP:

          Listen 192.168.1.2:8080

          NOTE: You can also define per-IP stuff in the <virtualHost> config.:

          <VirtualHost 192.168.1.3:8080>
              ServerName mydomain.com
              DocumentRoot /home/httpd/vhosts/mydomain.com/httpdocs
          </VirtualHost>
          
          <VirtualHost 192.168.1.2:8081>
              ServerName alt.mydomain.com
              DocumentRoot /home/httpd/vhosts/mydomain.com/httpdocs
          </VirtualHost>

          In this way you can use multiple IPs to create "alternate" ways to get to your site. Or if you want to host part of your site on a specific IP for whatever reason. You can also change the ports there as needed.

            I think I'll do the Listen*:8080. This sounds the most straight forward at the moment.

            Thanks for your help

            Cass27

              hmm.

              As I want my computer to continue using IIS for my forum on my first web site (presumably port 80), and I want to use apache for any further web sites what do you(port 8080) what would you suggest the syntax should be?

              Listen: *8080 or

              Listen 192.168.1.2:8080 ?

              thanks

              cass27

                Either one. If your server has only 1 IP address and 1 interface, then they're both saying the same thing. If you're running a "real" webserver with multiple IP addresses, then you'd want to use *:8080 unless you only want to run Apache on a specific IP.

                  Write a Reply...