• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 14910
  • Last Modified:

Window Server 2003 - IIS and Apache, ASP and PHP, MSSQL and MySQL concurrently

Hi Experts

I would like to setup a server with Windows Server 2003 that runs IIS and Apache concurrently.
IIS will be running ASP and Apache will be running PHP.
Setup MS SQL Server and MySQL.
ASP will mostly be using MSSQL and PHP with MySQL. But ASP should also use MySQL and PHP should also be able to use MSSQL.

How would I go about doing that?

Thanks :)



0
minichicken
Asked:
minichicken
  • 7
  • 4
  • 2
6 Solutions
 
humeniukCommented:
The best way to do this is to use separate IP addresses for each server platform, so that IIS binds to x.x.x.62 and Apache binds to x.x.x.204, for example.  That way, both platforms can use port 80 rather than having one work on an alternative port, which is a hassle.

Setting up IIS/ASP/MS SQL and Apache/PHP/MySQL are both fairly conventional.  The tricky parts are connecting PHP to MSSQL and ASP to MySQL.  The PHP Manual has great info about PHP-MSSQL (see www.php.net/manual/en/ref.mssql.php).  Here's a tutorial for using MySQL with ASP - www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=7739&lngWId=4.


0
 
minichickenAuthor Commented:
Thanks humeniuk for your input.

So to run 2 separate web servers on 1 machines is just a matter of assigning 2 different IP addresses to each of them.
Sounds easy, but how would I go about doing that? The setup is just for internal development use it is not public on the internet.

thanks :)
0
 
mattisflonesCommented:
In network connections, just add a extra IP address under:
Controlpanel->Network connections->Lan connection->Properties->TCP/IP Protocol->... You`ll find it..

In IIS you set up every site with one IP, and i guess its about the same in Apache.
MSSQL and MySql is no problem as they use different Ports for their communication.

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
humeniukCommented:
You can install 2 (or more) web servers on the same machine.  It's just software after all.  However, you can't have two applications using the same port on the same IP address.  That's where the second IP comes in.  You can either add a second network card or do as mattisflones said and assign an additional IP to the single network card.  Go to TCP/IP Protocol Properties as mattisflones says and then click the Advanced button.  You'll be able to add IP addresses there.

When you configure IIS, you configure it to use one IP (ie. 192.168.100.101) and when you configure Apache, you configure it to use the other (ie.192.168.100.102).   You can run multiple websites on IIS/192.168.100.101 with host headers and multiple websites on Apache/192.168.100.102 with virtual hosts.  If you want to run multiple sites with individual IP's, just add more IP addresses to your NIC.
0
 
mattisflonesCommented:
Xactly...  And its really easy to put on the web if you wish to do so.
0
 
minichickenAuthor Commented:
thanks guys, i was just trying to setup the environment and i have some problems.

IIS is installed.
Apache, MySQL and PHP is installed and tested, works fine.

This is what I did to setup 2 IP addressed, please confirm:

>> CONTROL PANEL >> NETWORK CONNECTIONS >> LAN CONNECTIONS >> PROPERTIES >> INTERNET PROTOCOL TCP/IP  >> PROPERTIES >> manually set first IP address >> click on ADVANCED >> add another IP address.

The problem:
I can only have 1 web-server running at once, either IIS or Apache, and not both. If one of them is running already and i try to start the other one, i can't. I know where to assign IP address for IIS (I think i know) but I dont know how to assign IP address for Apache. While I have apache running i tried to assign IIS with both the IP i created and failed. Seems like it conflicting.

Also, normally to access your web server locally, you usually type in "localhost" or the name of the server in the browser address bar. it doesnt matter which server you running. If you have IIS running you still type "localhost" and will access the wwwroot folder and if you have apache running and type "localhost" you will see the htdocs folder. So if you have both of them running at the same time, how to you access each of the servers separately?

thanks.... ^_^
0
 
humeniukCommented:
Sorry, the info above was incomplete.

The two web servers are currently in conflict because "when you start Internet Information Services (IIS) 6.0 on Microsoft Windows Server 2003, IIS binds to all IP addresses on the server, not just the IP addresses that are assigned to Web sites" (I believe Apache does the same).  Therefore, you need to bind each server to its specific IP address so that it doesn't bind to all IP addresses, just the one you want it to.

Here's how to do it in Win2k3/IIS6:
http://support.microsoft.com/default.aspx?scid=kb;en-us;813368&Product=iis60

Here's how to do it in Apache 2.0:
http://httpd.apache.org/docs-2.0/bind.html
http://httpd.apache.org/docs-2.0/mod/mpm_common.html#listen
0
 
humeniukCommented:
Read the above links for more info, but essentially, what you want to do in Apache is modify your httpd.conf file:

# Port: The port the standalone listens to.
Port 80

     to

# Port: The port the standalone listens to.
# Port 80

     and

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the VirtualHost command

# Listen 3000
# Listen x.x.x.x:80

     to

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the VirtualHost command

# Listen 3000
Listen 192.168.100.204:80    (or whatever the IP is that you want to assign to Apache)


You may also have to disable the cache accelerator:

AfpaEnable

     to

# AfpaEnable
0
 
minichickenAuthor Commented:
Thank you all.

I got it to work with one IP but different ports for IIS and Apache.

IIS: 192.168.0.xx:aa
Apache: 192.168.0.xx:bb

and it seems to work well, I got apache, mysql and php running as well as ASP working, but havent install MSSQL yet, but i think it should be fine.

My security concern is that is it safe to assign ports to the two different web servers or is it better to have two IP address and use port 80 for both of the IPs??

I will close the question when I get a confirmation on the security concern.

Thank you for all the help :)
0
 
humeniukCommented:
From a security standpoint, there is little difference between using different IP's and using different  ports.  There is a marginal security factor in that certain applications are more easily compromised than others, thus someone who wants to circumvent your security will check first if those ports are open.  Using an alternative port for your web server may mean that someone checks port 80 and then moves on.  However, this is of limited practical relevance, IMO.  The primary advantage of two IP's with both web servers on port 80 is convenience, you can use http://www.domain.com instead of http://www.domain.com:port#.
0
 
minichickenAuthor Commented:
thanks, really being of great help.....

I will gratefully reward the points now.

I've got a scenario with 2 different IPs. Normally when you browse a page on the server you will type localhost or 127.0.0.1 or the name of the server in the browser address bar, right? So having two IPs I then cant use localhost or 127.0.0.1 or the name of the server and can only type in the actuall IP address of the web servers i.e to access IIS i will type 192.168.0.aa and Apache 192.168.0.bb is that correct?

Thank you for the help, much appreciated :)
0
 
humeniukCommented:
Right, you're better off using the IP address or setting up DNS - www.IISdomain.com resolves to IIS IP and www.apachedomain.com resolves to Apache IP.
0
 
humeniukCommented:
Glad to be of help and thanks for the A.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now