WINDOWS下简单快捷的WEB架设

由 synn 在 07-11-2003 22:03 发表:

WINDOWS下简单快捷的WEB架设

=========================================

配置Apache Server(安装在根目录)

1 寻找Port 默认为80

2 寻找ServerAdmin 这里输入你的E-Mail地址

3 寻找ServerName 这里定义你的域名

4 寻找DocumentRoot 这里指定主页放置目录,记住,末尾不要加"/"

5 寻找DirectoryIndex 默认首页,可以设多个.例:

 1<ifmodule mod_dir.c="">   
 2  
 3DirectoryIndex index.htm   
 4  
 5DirectoryIndex index.php   
 6  
 7DirectoryIndex index.cgi   
 8  
 9DirectoryIndex index.html   
10  
11</ifmodule>

6 重启Apache Server

=========================================

=========================================

增加对 Perl CGI 脚本的支持

1 安装Perl for Win32 ,安装在C:\usr (所有提问全"是")

2 寻找ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/",将""中的路径指向CGI脚本目录.例:

ScriptAlias /cgi-bin/ "d:/www/"

3 改上面最近的下面的内容:""中路径与上面的相同.

更改Allow Override和Options的参数为All(区分大小,下同).例:

 1<directory "d:="" www"="">   
 2  
 3AllowOverride all   
 4  
 5Options all   
 6  
 7Order allow,deny   
 8  
 9Allow from all   
10  
11</directory>

4 寻找AddHandler cgi-script .cgi 删除前面的#,在后面加上 .pl

=========================================

=========================================

增加对 PHP 脚本的支持(适用于APACHE1.3.X)

1 解开放在c:\php

2 到c:\php下,把php4ts.dll拷到c:\winnt\system32

3 把php.ini-recommended拷一份,改名为php.ini,移到c:\winnt\

4 打开c:\winnt\php.ini

;register_globals = Off 改成

register_globals = On

就可以了,把php.ini保存关闭

5 打开httpd.conf

在httpd.conf文件相应的位置加上这四个:

ScriptAlias /php/ "c:/php/"

LoadModule php4_module c:/php/sapi/php4apache.dll

AddModule mod_php4.c

AddType application/x-httpd-php .php

6 测试:内容为:

以下适用于APACHE2.0.X

There are two ways to set up PHP to work with Apache 2.0 on Windows. One is to use the CGI binary the other is to use the Apache module DLL. In either case you need to stop the Apache server, and edit your httpd.conf to configure Apache to work with PHP.

You need to insert these three lines to your Apache httpd.conf configuration file to set up the CGI binary: Example 3-8. PHP and Apache 2.0 as CGI

ScriptAlias /php/ "c:/php/"

AddType application/x-httpd-php .php

Action application/x-httpd-php "/php/php.exe"

If you would like to use PHP as a module in Apache 2.0, be sure to move php4ts.dll to winnt/system32 (for Windows NT/2000) or windows/system32 (for Windows XP), overwriting any older file. You need to insert these two lines to your Apache httpd.conf configuration file to se

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus