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

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 安裝包
三、在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 的 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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章