Windows平台上Apache 2.X 的配置筆記與PHP5

來源:互聯網
上載者:User

Englisth Doc :http://httpd.apache.org/docs/2.0/platform/windows.html

        因為時間的關係,文章並未全部譯完。只為方便配置應該還是夠了。        改天再完全它。:)  一、OS的要求            主要的運行Apache 2.X的Windwos平台是Win NT系列。二進位格式的安裝包(The binary installer )只適用於X86系列處理理,如AMD,Intel。所有的OS都必須安裝好TCP/IP,並能工作。二、 Download Apache 安裝包          http://httpd.apache.org/download.cgi.三、在Windows上安裝Apache          注意:你不可以安裝兩個二進位格式的2.0 Apache在同一台電腦上。但是,如果你需要兩個Apache在你的PC上,你可以安裝一個1.X和一個2.X的二進位格式的安裝包。如果你要安裝兩個不同的2.0 Apache在同一PC上,你可以採用源碼的形式,編譯然後安裝在你的PC上。    運行剛才你得到的Apache.msi 安裝包,安裝過程中你將做以下幾步:

        1、 Network Domain 

             Enter the DNS domain in which your server is or will be registered in. For example, if your server's full DNS name is server.mydomain.net, you would type mydomain.net here

       2、Server Name  

            Your server's full DNS name. From the example above, you would type server.mydomain.net here.

     3、Administrator's Email Address  

            Enter the server administrator's or webmaster's email address here. This address will be displayed along with error messages to the client by default

     4、For whom to install Apache       

           Select for All Users, on Port 80, as a Service - Recommended if you'd like your new Apache to listen at port 80 for incoming traffic. It will run as a service (that is, Apache will run even if no one is logged in on the server at the moment) Select only for the Current User, on Port 8080, when started Manually if you'd like to install Apache for your personal experimenting or if you already have another WWW server running on port 80。

     5、The installation type

           Select Typical for everything except the source code and libraries for module development. With Custom you can specify what to install. A full install will require about 13 megabytes of free disk space. This does not include the size of your web site(s).

      6、Where to install

           The default path is C:/Program Files/Apache Group under which a directory called Apache2 will be created by default.

          

During the installation, Apache will configure the files in the conf subdirectory to reflect the chosen installation directory. However, if any of the configuration files in this directory already exist, they will not be overwritten. Instead, the new copy of the corresponding file will be left with the extension .default. So, for example, if conf/httpd.conf already exists, it will be renamed as conf/httpd.conf.default. After the installation you should manually check to see what new settings are in the .default file, and if necessary, update your existing configuration file.

Also, if you already have a file called htdocs/index.html, it will not be overwritten (and no index.html.default will be installed either). This means it should be safe to install Apache over an existing installation, although you would have to stop the existing running server before doing the installation, and then start the new one after the installation is finished.

After installing Apache, you must edit the configuration files in the conf subdirectory as required. These files will be configured during the installation so that Apache is ready to be run from the directory it was installed into, with the documents server from the subdirectory htdocs. There are lots of other options which you should set before you really start using Apache. However, to get started quickly, the files should work as installed.

四、配置Apache與PHP5以 Apache 模組方式安裝需要將以下兩行加入到 Apache 的 httpd.conf 設定檔中以設定 Apache 2.0 的 PHP 模組:

例子 6-6. PHP 在 Apache 2.0 中的模組方式

# 對 PHP 4 用這兩行:LoadModule php4_module "c:/php/php4apache2.dll"# 別忘了從 sapi 目錄中把 php4apache2.dll 拷貝出來!AddType application/x-httpd-php .php# 對 PHP 5 用這兩行:LoadModule php5_module "c:/php/php5apache2.dll"AddType application/x-httpd-php .php# 配置 php.ini 的路徑PHPIniDir "C:/php"

具體見: http://cn2.php.net/manual/zh/install.windows.php

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.