Installation of apahce and iis in windows

Source: Internet
Author: User

This article describes how to install apahce and iis in windows. If you need to know more, refer to it. Linux + Apache + PHP + MySQL is a low-cost, efficient, and stable WEB Server, but most of our development is completed in a Windows environment, and then transplanted to Linux or Unix. Now, according to your personal experience, install Apache2 + PHP 5 in Windows XP + IIS. It is easier to install IIS without using IIS.1. Disable IIS. If you do not disable IIS, an error will occur when installing Apache.There are two ways to disable IIS:

  1. Control Panel-performance and maintenance-management tools-service, disable the IIS Admin Service.
  2. Enter the following code in start-run, or Enter cmd first. In the displayed window, enter the following code.net stop iisadminThe preceding command disables all iis-related servers, such as web sites and smtp.Net stop iisadmin/yIf you use net stop w3svc to shut down a website's server, but multiple web sites won't work.
If you enable IIS, you can find the method to open the website service of interet information service in the control panel, or you can name it. net start w3svc can all be used. Note that if you directly open the IIS Admin Service or the net start iisadmin service, you can open the IIS Admin Service, but the 3w service is not enabled, so you still need to use the following method to open the 3w service, because the IIS Admin Service is not enabled for the 3w service, the IIS Admin Service is certainly enabled when the 3w service is enabled. 2. Install Apache2.Ps, Apache 2 cannot run on Windows 95; it can barely run on Windows 98, but cannot be used as a service. PHP does not support Windows 95 any more since version 4.3. Therefore, your Windows OS must be Windows NT, 2000, XP, Vista, and Win7.
  1. Apache can be downloaded at http://www.apache.org/dyn/closer.cgi/httpd/binaries/win32/
  2. For the Network Domain developed on the local machine, set ServerName to localhost and enter the email address.
  3. For beginners, we recommend that you select the first option regardless of whether or not the Apache service uses a single port of 80. In this way, Apache is directly registered as a system service, which is stable and convenient. Next, select Typical.
  4. Generally, the installation path is c: Programme FilesApache Group by default and is changed to c: web or other names in the 8.3 format. Therefore, no quotation marks are required for entering the Apache installation path each time, apache will automatically generate The Apache2 folder during installation, so the file will be installed in c: webapache2. In this way, you can install PHP and MySQL on the web to facilitate management.
  5. Because Apache and IIS both use the default WEB Service port 80, one of them must modify its port, which is generally changed to 8080.
    You can modify the IIS port directly in the IIS management tool. You can find it in the control panel or enter inetmgr
    Modify the Apache port and open the httpd. conf file through start-all programs-Apache-Configure Apache Server,
    Find # Listen 12.34.56.78: 80 # Replace the comment symbol Listen 80 with Listen 8080, and then change ServerName localhost: 80 to ServerName localhost: 8080.
  6. Enter localhost in the browser. If the port is modified, enter localhost: 8080 to view the apache page. This indicates that the installation is successful.
Ps [2005.9.29]. Use the apache proxy module to hide the iis Port
  1. According to the above method, apache uses the default port 80 and modifies iis to use port 8080. Of course, you can also use other reasonable ports.
  2. Modify the http. conf file of apache, remove the annotator before the following two lines of code #, and start the proxy module.
    LoadModule proxy_module modules/mod_proxy.soLoadModule proxy_http_module modules/mod_proxy_http.so
  3. Add the following two lines of code to the file to redirect the input http: // localhost/iis/to http: // localhost: 8080.
    ProxyPass /iis/ http://127.0.0.1:8080/ ProxyPassReverse /iis http://127.0.0.1:8080
    In this way, you can enter localhost in the browser to access apache, enter localhost/iis/to access iis, and the port 8080 is hidden.
  4. In addition, you can set a virtual host to access apache or iis
    <VirtualHost *: 80> ServerAdmin kavenyan@163.com DocumentRoot E:/www/dancewithnet ServerName www.dancewithnet.com ServerAlias dancewithnet.com DefaultLanguage zh-CN adddefacharcharset UTF-8 </VirtualHost> <VirtualHost *: 80> ServerAdmin kavenyan@163.com ServerName iis.dancewithnet.com DefaultLanguage zh-CN adddefacharcharset GB2312 ProxyPass/http: // 127.0.0.1: 8080/or http: // server ip: 8080/ProxyPassReverse/http: // 127.0.0.1: 8080/or http: // server ip: 8080/</VirtualHost>
    In this way, you can use www.dancewithnet.com to access apache and iis.dancewithnet.com to access iss, while hiding port 8080.3. Configure the PHP Environment
    1. Download the php5 zip installation package from www.php.net and decompress the package to c: webphp5. Apache 2 can run the PHP program in two ways: run the PHP program through a cgiinterface (use php.exe externally ), or use the php dll file to run in Apache. The latter method is faster. Therefore, for each version of PHP, two Windows binary release packages are provided. The smaller one is the. msipackage. The cgiexecutable program php.exe is installed, but the module required to run the PHP script through Apache DLL is removed. The larger. Zip package contains all these items.
    2. It is best to ensure that php5ts. dll is available regardless of the Interface (CGI or SAPI), so the file must be placed in the Windows path. The best location is the Windows system directory (% windir % System ):
      C: \ winnt \ system32 for Windows NT/2000 or c: \ winnt40 \ system32 for Windows NT/2000 Server c: \ windows \ system32 for Windows XP/Vista/Win7
      Ps, you have copied all the dll files in the PHP file to % windir % System. The configuration is slightly different from the method I introduced, but I think it is messy, I will not explain it any more. If you are interested, you can study it on your own.
    3. Then set the valid PHP configuration file, php. ini. The package contains two ini files: php. ini-dist and php. ini-recommended. We recommend that you use php. ini-recommended because this file optimizes the performance and security of the default settings. Copy the selected ini file to the directory that PHP can find and change it to php. ini. By default, PHP searches for php. ini in the Windows directory (% WINDIR % or % SYSTEMROOT %:
      C: \ winnt or c: \ winnt40 for Windows NT/2000 Server c: windows for Windows XP/Vista/Win7
    4. Stop Apache and enable httpd. conf for editing.
      If you use php in the form of a CGI binary file, add the following code (note the space between codes ):
      ScriptAlias /php/ "c:/web/php5/"AddType application/x-httpd-php .phpAction application/x-httpd-php "/php5/php.exe"
      If it is used as a module (recommended), add the following code:
      LoadModule php5_module "c:/web/php5/php5apache2.dll"AddType application/x-httpd-php .php
    5. Save httpd. conf and start Apache

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.