Apache forwarding allows IIS and Apache to share port 80

Source: Internet
Author: User

Because only one server (win2003 server) needs to run ASP programs and PHP applications on the server, and does not want to use IIS to run PHP applications.
In addition, if you do not want to run ASP programs on Apache, you need a solution for coexistence of Apache and IIS.

IIS is the built-in iis6.0 of Windows2003 server.

Apache is apache2.2.8.

First, download and install Apache

Then, stop the automatically started IIS server and modify the IIS port to a non-80 (such as 8081)

Then open the httpd. conf file of Apache to start configuration.

To enable Apache to support forwarding, that is, to act as an IIS proxy, you must first enable the Apache proxy module:

# Loadmodule proxy_module modules/mod_proxy.so
--> Loadmodule proxy_module modules/mod_proxy.so

# Loadmodule proxy_connect_module modules/mod_proxy_connect.so

--> Loadmodule proxy_connect_module modules/mod_proxy_connect.so
# Loadmodule proxy_ftp_module modules/mod_proxy_ftp.so

--> Loadmodule proxy_ftp_module modules/mod_proxy_ftp.so
# Loadmodule proxy_http_module modules/mod_proxy_http.so

--> Loadmodule proxy_http_module modules/mod_proxy_http.so

After enabling the proxy module, we start to configure the virtual host.

First include httpd-vhosts.conf files

# Include CONF/extra/httpd-vhosts.conf

--> Include CONF/extra/httpd-vhosts.conf

Save httpd. conf and open the httpd-vhosts.conf File

Start configuring virtual machine

Namevirtualhost *: 80

<Virtualhost *: 80>

Serveradmin B @ B .com
Servername www. B .com

DocumentRoot "C:/program files/Apache Software
Foundation/apache2.2/htdocs"
</Virtualhost>
<Virtualhost *: 80>
Proxypreservehost on

Serveradmin a@a.com
Servername www.a.com

Defaultlanguage ZH-CN
Adddefacharcharset gb2312
Proxypass/http://www.a.com: 8081/

Proxypassreverse/http://www.a.com: 8081/

</Virtualhost>

Configuration complete and save httpd-vhosts.conf

Restart the Apache server and IIS server.

We use www.a.com
The default page of IIS is displayed when you visit the past.

Through www. B .com
You can see it's work in the past.

In this way, IIS and Apache share port 80.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.