Windows installs both Apahce and IIS tutorials

Source: Internet
Author: User
Tags iis administration ini php file php script zip
Linux+apache+php+mysql is a low-cost, efficient and stable web Server, but most of our development is done in a Windows environment and then ported to Linux or UNIX. Now based on the personal experience to illustrate the Windows Xp+iis install apache2+php 5. It is simpler to install without IIS, except for IIS-related steps.
First, turn off IIS, and if you do not turn off IIS to install Apache, there will be an error.
There are two ways to turn off IIS, and either of these can be:
    1. Control Panel-performance and maintenance-management tools-services, turn off the IIS Admin service.
    2. In the beginning--run directly enter the following code, or enter CMD First, in the pop-up window to enter the same net stop iisadmin command shut down all IIS-related servers, such as Web sites, SMTP, and so on. net stop iisadmin /y避免输入上面那个命令后需要在输入yIf you are using net stop w3svc to shut down only one site 3w server, it is not possible to have more than one Web site.
If you turn on IIS, you can find a way to open a Web service on the Interet Information service in Control Panel, or you can use the name, net start w3svc. Note If you open the IIS Admin Service or the sport net start iisadmin directly in the service, you can turn on the IIS Admin service, but the 3w service is not turned on, so you still need to turn on the 3w service in the above way, because in the open IIS The admin service does not have the 3w service turned on, but opening the 3w service certainly opens the IIS Admin Service.
Second, the installation of Apache2.
Ps,apache 2 cannot be run on Windows 95; It is barely able to run on Windows 98, but it cannot be used as a service. Starting with version 4.3, PHP also no longer supports Windows 95. Therefore, your Windows operating system must be Windows NT, 2000, XP, Vista, and Win7.
    1. Apache can download to http://www.apache.org/dyn/closer.cgi/httpd/binaries/win32/
    2. For the development of the network domain,servername are filled into the localhost can be, fill in the email address can be.
    3. The single choice in the above figure, for beginners, regardless of whether the Apache service use 80, it is recommended to choose the first one, so that the Apache register directly as a system service, stable and convenient. Then choose typical next.
    4. The installation path is typically changed to C:programme Filesapache GROUP by default to C: Web or other 8.3-format name, so that each time you enter the Apache installation path in the future without quotes, and Apache installation will automatically generate the Apache2 folder, so the file will be installed to c:webpache2, so you can later put PHP, MySQL is installed in the web for several types of management.
    5. Since the default Web service port for Apache&iis is 80, one of them must modify its port, typically to 8080
      Modify the IIS port directly in the IIS administration tool. You can find it in the Control Panel or enter inetmgr in the run
      Modify the Apache port to open the httpd.conf file by starting-All Programs-apache-configure Apache server
      找到 #Listen 12.34.56.78:80   #是注释符号
           Listen 80  改成  Listen 8080
      然后找到  ServerName localhost:80   改成  ServerName localhost:8080  即可
    6. Enter localhost in the browser, if you modify the port on the input localhost:8080 can see the Apache page, it means that the installation was successful.
PS[2005.9.29]. Using the Apache Proxy module to implement the port that hides IIS
  1. According to the above method, Apache uses the default port 80, modifies IIS to use the port to 8080, of course you can also use other reasonable port.
  2. Modify Apache http.conf file, remove the annotation symbol # before two lines of code #, start the agent module
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
  3. Add the following two lines of code to the file so that the input http://localhost/iis/to the http://localhost:8080
    ProxyPass /iis/ http://127.0.0.1:8080/
     ProxyPassReverse /iis http://127.0.0.1:8080
    This allows you to enter localhost in the browser to access Apache, enter localhost/iis/to access IIS, and hide 8080 ports
  4. Alternatively, you can access Apache or IIS by setting up a virtual host
    <VirtualHost *:80>
        ServerAdmin kavenyan@163.com
        DocumentRoot E:/www/dancewithnet
        ServerName www.dancewithnet.com
        ServerAlias dancewithnet.com
        DefaultLanguage zh-CN
        AddDefaultCharset UTF-8
    </VirtualHost>
    <VirtualHost *:80>
        ServerAdmin kavenyan@163.com
        ServerName iis.dancewithnet.com
        DefaultLanguage zh-CN
        AddDefaultCharset GB2312
        ProxyPass / http://127.0.0.1:8080/  or http://服务器ip:8080/
        ProxyPassReverse / http://127.0.0.1:8080/   or http://服务器ip:8080/
    </VirtualHost>
    This allows access to the apache,iis.dancewithnet.com access ISS using www.dancewithnet.com, while hiding 8080 ports
    Third, configure the PHP environment
    1. Download php5 zip installation package on www.php.net, unzip its files into C:WEBPHP5
      PS, Apache 2 can take 2 ways to run a PHP program: Run via a CGI interface (external call Php.exe), or use PHP's DLL file to run inside Apache. The latter way is faster. Therefore, for each version of PHP, there are 2 Windows binary release packs available. The smaller one is the. msi package, which installs the CGI executable Php.exe, but takes away the modules needed to run the PHP script through the Apache DLL. The larger. zip package contains all of these things.
    2. It is best to ensure that Php5ts.dll is available regardless of which interface (CGI or SAPI) is used, so you must put this file in the Windows path. The best location is the Windows system directory (%windir%system):
      c:\winnt\system32 for Windows NT/2000
      或者
      c:\winnt40\system32 for Windows NT/2000 服务器版
      c:\windows\system32 for Windows XP/Vista/Win7
      PS, also has the PHP file all the DLL files are copied to the%windir%system, the configuration and I introduced a slightly different approach, but I think that more messy, it is no longer explained that interested friends can study their own.
    3. Then actually set up a valid PHP configuration file, php.ini. The compressed package includes two INI files, php.ini-dist and php.ini-recommended. It is recommended that you use php.ini-recommended, because this file performs performance and security optimizations on the default settings. Copy the selected INI file to the directory that PHP can find and rename it to PHP.ini. PHP defaults to search for php.ini under Windows directory (%WINDIR% or%SYSTEMROOT%):
      c:\winnt 或 c:\winnt40  for Windows NT/2000 服务器版
      c:windows  for Windows XP/Vista/Win7
    4. Stop Apache and open httpd.conf for editing.
      If you use PHP in the form of a CGI binary file, add the code as follows (note the space between the code):
      ScriptAlias /php/ "c:/web/php5/"
      AddType application/x-httpd-php .php
      Action application/x-httpd-php "/php5/php.exe"
      
      If you are a module (which is recommended), add the following code:
      LoadModule php5_module "c:/web/php5/php5apache2.dll"
      AddType application/x-httpd-php .php
      
    5. Save httpd.conf, 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.