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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值