Question : Apache and IIS

I've just installed Apache on my web server which is already running IIS.

I need to be able to view ASP and PHP sites from different machines on my network. The ASP sites are working fine, I currently add these into IIS and setup an individual DNS record.

Apache has installed fine and I have changed the port to 81in the httpd.conf file (both instances). I can navigate to localhost:81/phpmyadmin and am able to view this fine.

My aim is to be able to view the sites by just using their name rather than having to put in localhost:81, the ASP sites all work in this way.

To do this I've added individual records to the hosts file on the server like so:

127.0.0.1      phpmyadmin
127.0.0.1      passion
127.0.0.1      arronbrook
127.0.0.1      eyesite

and then in the vhosts file I've done the following:

<virtualhost *:81>
      ServerName passion
      DocumentRoot "C:\xampp\htdocs\passion"
</virtualhost>

<VirtualHost *:81>
    ServerName phpmyadmin
    DocumentRoot "C:\xampp\phpmyadmin"
</VirtualHost>

<VirtualHost *:81>
    ServerName arronbrook
    DocumentRoot "C:\xampp\htdocs\arronbrook"
</VirtualHost>

<VirtualHost *:81>
    ServerName eyesite
    DocumentRoot "C:\xampp\htdocs\eyesite"
</VirtualHost>

This doesn't seem to work and when I navigate to say, http://phpmyadmin, I get "Bad Request (Invalid Hostname)" which is the default ASP page??

Any ideas?

Thanks,

Chris

Answer : Apache and IIS

Hi

Before your Virtual host definitions do you have the following entry:

NameVirtualHost *:81

Also did you re-start Apache after making the changes?

Also note that unless you shift Apache to port 80, and the ISS server to port 81, you'll need to append the port onto the host-name e.g.:

http://phpmyadmin:81/
http://passion:81/


Note: If you were to make Apache your default Web server, you could have it Reverse proxy request for the ASP apps / hosts to the IIS instance, or handle the ASP itself e.g.  To Reverse Proxy the requests to host "http://iisApp1/" to the IIS server:

<VirtualHost *:80>
    ServerName iisApp1
    ProxyRequests off
    <Proxy *>
      Order deny,allow
      Allow from all
    </Proxy>
    ProxyPass              /   http://iisApp1:81/
    ProxyPassReverse  /   http://iisApp1:81/
</VirtualHost>


See: http://www.apachetutor.org/admin/reverseproxies
Random Solutions  
 
programming4us programming4us