Posted: 2016-04-14 00:30:23
As a rule, only 1 process is allowed to bind to a specific IP:port (an interface). And the first process that takes that specific IP:port will prevent all other processes, that use the same IP:port, from starting…
Apache and IIS will both try to take port 80 (the HTTP port) and port 443 (the HTTPS port) – on IP “0.0.0.0”.
MySQL will try to take port 3306 (the default MySQL port) – on either IP “0.0.0.0” or IP “127.0.0.1”.
“0.0.0.0” specifies binding to all IP addresses the system has, including 127.0.0.1. And “127.0.0.1” is the standard localhost IP – used to bind services for local-access only.
To run multiple servers side-by-side (on the same system), 3 options are available (from the very simple to the more complicated):
Stop IIS, start Apache. And vice-versa.
With multiple MySQL instances, run 1 instance at a time.
Note that when using both MySQL and SQL Server, you can run both at the same time as they use different ports (and they will not conflict).
This is only a valid solution for local use and local development.
Select each website in IIS (including the Default Website), change the binding properties from *:80 and *:443 to other ports such as 8080 and 8443.
Update Web Platform’s MySQL’s my.ini file to change “port = 3306″ to another port such as 3307.
With the above re-binding, all IIS websites will now be reachable from URL:
By convention, all web-servers use the same standard ports (for HTTP and HTTPS)…
When a request is made from your Browser to
http://domain.name/path/, it resolves the domain name to an IP address, and the request is automatically sent to that IP on port 80 (and to port 443 for HTTPS traffic).
In effect, all standard URLs (i.e., without a user specified port) are short-hand for:
Webapp configuration files, other script files, and any programs that connect to Web Platform’s MySQL, will need to be updated to reflect the new port number to use.
This includes phpMyAdmin (phpmyadmin\config.inc.php).
Your system will likely have:
It is best to have WampDeveloper’s Services include the use of IP
127.0.0.1 – otherwise you’ll have to use an editor to do an auto-search for all instances of
127.0.0.1 (and some variations that can be picked up with string “127”) in WampDeveloper’s folder to update the local configuration structure for use of another local IP.
Bind Apache from the default of “0.0.0.0” to specific IPs (including IP 127.0.0.1). And Web Platform’s IIS to another specific IP. And perform the same for multiple MySQL servers…
Edit file – C:\WampDeveloper\Config\Apache\httpd.conf
Replace these two lines (one is at the beginning, the other at the end) –
Listen 80 ... Listen 443
Listen ip.address.here:80 ... Listen ip.address.here:443
Preferably also include
Listen 127.0.0.1:80 and
Select all websites (including Default Website) in IIS and change their bindings to the other IP.
If another instance of MySQL was installed (via Web Platform), edit its “C:\Program Files\MySQL\MySQL Server\my.ini” file and change
bind-address = 127.0.0.1 to the other IP.
If you have to keep Web Platform’s MySQL server on 127.0.0.1, bind WampDeveloper’s MySQL to something other than 127.0.0.1:
Edit file – C:\WampDeveloper\Config\Mysql\my.ini
bind-address = 127.0.0.1.
Edit file – C:\WampDeveloper\Tools\phpMyAdmin\config.inc.php
Update all instances of “127.0.0.1” (that is used for the connection IP and in the access control list).
You can run multiple servers at the same time and use the ProxyPass feature to have Apache act as the front-end, transparently proxying requests back-and-forth for specific URLs and websites.
This way you can have 1 public-facing server (Apache on port 80) serving all requests, and multiple back-end servers such as IIS and Tomcat running websites and scripts that use ASP.NET and Java.