The company's servers have been using the PHP environment to build the Zhuzhou Metropolis online bbs.zzccoo.com Forum as a local portal website. Today, we have received requirements from the Department and need to add another formal portal website, the Forum serves as a subsidiary website for communication with netizens. This time, the server was changed a lot. The most important thing was that the previous server only had the Apache environment, currently, the portal website developed by the company uses SQL2005 +. in the NET2.0 environment, but I don't want to add another server, I just have to stick my head to a server to implement Apache + IIS sharing port 80.
Other SQL2005 installations are all well said. The key is that two websites with different source codes in different environments need to share port 80. Many of the materials found on Baidu are Mo Ling Xiao, so there is no specific explanation, because Baidu searched for tutorials in an Apache independent environment, rather than the APMServ5.2.6 integrated environment on my current server, there was a huge difference. After studying for about four hours, I finally solved this problem. Now I have published my solution, hoping that more people will be able to cope with applications in other special environments.
Let's talk about the server configuration environment before I configure it. APMServ5.2.6 integrates the PHP environment:
Apache 2.2.9 [HTTP server]
Nginx 0.7.19 [HTTP server]
NetBox 2.8 Build 4128 [HTTP server + ASP script interpretation engine]
PHP 5.2.6 [PHP script engine]
MiniPerl 5.8 [Perl script interpreter]
Memcached 1.2.4 [key-value memory cache system]
MySQL 5.1.28 [MySQL database server]
MySQL 4.0.26 [MySQL database server]
PhpMyAdmin 2.11.9.2 [MySQL database online management tool]
EAccelerator 0.9.5.3 [PHP script Acceleration Engine]
ZendOptimizer 3.3.3 [PHP script Acceleration Engine]
OpenSSL 0.9.8h [HTTPS (SSL) Secure Transmission Protocol]
Step 1: Install the SQL2005 database and IIS6.0 (built-in windows2003), and change the IIS port to port 81 (Apache environment and port 80 occupied );
Step 2: configure the Apache environment so that Apache can access port 81 as a proxy;
(1) modify the httpd. conf file in the "D: \ APMServ5.2.6 \ Apache \ conf" directory:
Find the following lines of text and remove the above # To enable the proxy function.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
Note: In addition, check whether the httpd. conf file contains the httpd-vhosts.conf file, if there is # In Front Of The following text, remove it
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
(2) then add the VM information under Apache and IIS In the httpd-vhosts.conf file under the directory "D: \ APMServ5.2.6 \ apache \ conf \ extra:
Example of virtual host configuration under IIS:
<VirtualHost *:80>
ProxyPreserveHost On
ServerAdmin 7740606@qq.com
ServerName www.zzccoo.com
ServerAlias zzccoo.com *.zzccoo.com
DefaultLanguage zh-CN
AddDefaultCharset GB2312
ProxyPass / http://www.zzccoo.com:81/
ProxyPassReverse / http://www.zzccoo.com:81/
</VirtualHost>
Example of virtual host configuration in apache:
<VirtualHost *:80>
ServerAdmin 1047894@qq.com
ServerName www.zhuzho.com
ServerAlias zhuzho.com *.zhuzho.com
DocumentRoot “d:/zhuzho”
</VirtualHost>
Remember that a website with the same domain name as port 81 must be established under IIS for forwarding. Of course, after the preceding configuration changes are saved, you must restart IIS and Apache to make the changes take effect.
You can see my website instance: www.2cto.com
Bbs.zzccoo.com/is the Zhuzhou urban online forum and port 80 built on the PHP environment.
Www.zzccoo.com/and www.zzccoo.com:81are built on the iisenvironment's 81port. The two addresses are on the same page.