Home php教程 php手册 Win2000下PHP服务器安装攻略

Win2000下PHP服务器安装攻略

Jun 21, 2016 am 09:08 AM
apache com php quot

服务器|攻略

一、前期准备情况 Apache2(Win32) 完全模块化安装perl,php,ssl

1。一个安装好的WIN2000服务器,注意:如果你的机器上已经安装了IIS,将IIS里的所有web站点停掉或端口改成别的先。

2。下载软件

APACHE 2.0.48
Perl 4.3.1
PHP 4.3.1
MYSQL 4.0.12
ZendOptimizer

还有几个小东西,很重要,后面的安装会用到(不会全用到,有些文件是编译好的,可以直接用)
下载地址1: http://www.xdiy.net/soft/serv.rar
下载地址1: http://www.techxy.com/xdiy/serv.zip
包子里面是:mod_perl 1.9/ mod_ssl 2.0.43/ OpenSSL 0.9.6h/ mod_jk/ ApacheModuleGzip.dll
gd 2.0.9/ gdpm/ perldiver 1.1/ 中文php.ini/editplus /php_gd_gif.dll 等


二、安装开始

1。APACHE安装

1.1:运行apache_2.0.44-win32-x86-no_ssl.msi,

假设我的安装的默认路径是 X: ,这样就安装在x盘下的APACHE2的路径下,同时默认域为domain.com。

1.2:(作一个虚拟主机,此步可以不做)

编辑X:apache2confhttpd.conf

找到 #NameVirtualHost *

修改为 NameVirtualHost 192.168.0.1 #注意这个IP为你自己主机设的IP

找到 ServerName domain.com 修改为 #ServerName domain.com

找到ServerAdmin * (*是你安装apache时所填写的邮箱地址)修改为 #ServerAdmin

接下来添加以下语句:#……的是我的注释,不用加,看一下就可以了


ServerAdmin webmaster@domain.com
#主机管理员(联系人)的邮箱地址
ServerName domain.com
#主机名(主机头名)
ServerAlias domain.com www1.domain.com
#主机名(同样可以生效的主机头名)
document.oot X:/VirtualHost/domain.com/www.domain/wwwroot
#该虚拟主机的的www根目录.
ErrorLog X:/VirtualHost/domain.com/www.domain/logs/www.domain-error_log
#错误日志文档,也可以是../logs/www.domain-error_log
CustomLog X:/VirtualHost/domain.com/www.domain/logs/www.domain-access_log common
ScriptAlias /cgi-bin /cgi-bin
#指定perl脚本运行目录,当然,不指定的话整个目录全部可以运行
ScriptAlias /php4/ "/php-bin"
#指定php脚本运行目录,当然,不指定的话整个目录全部可以运行
Errordocument.nbsp400 /400.html
#自定义错误文件,要注意的是错误文件一定要放在根目录下,
#或者单另作一个虚拟主机,比方errors.domain.com,将错误文件放在其根目录下.
#则此时错误文档应为"Errordocument.nbsp400 http://errors.domain.com/400.html"


***如果你选择设置虚拟主机的话,请将浏览器设置INTERNET选项-连接-局域网设置
选择 “使用代理服务器”,地址:192.168.0.16 (写你主机的IP,本机调试127.0.0.1) 端口:80
如果局域网中只有你一台机子开机中,应改添127.0.0.1同本机调试一样


1.3:将文件名 X:apache2htdocsindex.html.en 改为c:apachehtdocsindex.html


1.4:访问http://localhost或http://domain.com.能看到页面就OK!


2。安装MYSQL

2.1: 解压 mysql-4.0.12-win.zip 到目录 X:MYSQL

2.2: 进入D:MYSQL 运行SETUP.EXE 一路回车,默认安装到 X:MYSQL


3。安装PHP

3.1: 解压php-4.3.1-Win32.zip 到目录 X:PHP

3.2: 进入X:PHP,开始配置PHP

3.3: 将文件名 php.ini-dist 改为 php.ini
(或者使用上面的那个serv.rar包中的那个PHP.INI文件,可以不用修改直接使用)

3.4: 打开php.ini,
找到 extension=php_gd.dll,将前面的分号去掉
找到 extension=php_gd2.dll,将前面的分号去掉
相同位置添加 extension=php_gd_gif.dll,这个文件上面我提供的serv.rar里面有

3.5: 拷贝 php.ini 和 php4ts.dll 到WIN2000的系统安装目录下的system32和system目录下

3.6: 打开APACHE的配置文件httpd.conf文件,添加如下语句(位置随便):

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

AddType application/x-httpd-php .php4

ScriptAlias /php4/ "C:/php/"

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

添加由PHP解析的扩展名:
AddType application/x-httpd-php4 .php .php3 .php4 .php2


#mod_perl
LoadFile "c:/usr/bin/perl58.dll"
LoadModule perl_module modules/mod_perl.so

#mod_ssl
LoadModule ssl_module modules/mod_ssl.so

LoadModule gzip_module modules/ApacheModuleGzip.dll
注:ApacheModuleGzip.dll(即:mod_gzip),在包包里面有.可以压缩静态的web页面。

>


4。安装ZendOptimizer
4.1: 安装ZendOptimizer-2[1].1.0a-Windows-i386.exe 到目录 X:zend
剩下的步骤呵呵,自己选好了


5。安装PERL

5.1: 安装ActivePerl-5.8.0.804-MSWin32-x86.msi 到目录 C:usr,
注意你的windows Installer 服务应该打过windows service pack的补丁


6.其它设置

6.1: 找到DirectoryIndex,添加以下语句
DirectoryIndex index.html index.html.var index.htm index.php index.shtml
DirectoryIndex index.php3 index.php4 index.cgi index.pl index.html

如果还想增加SSI,需把下面两行前面的#号去掉。
AddType text/html .shtml
AddHandler server-parsed .shtml

6.2: 查找出所有的"Options FollowSymLinks",全部改为"Options ALL",注意大小写.不用加""号。
查找出所有的"AllowOverride None",全部改为"AllowOverride ALL" ,注意大小写.不用加""号。

6.3: 找出#ScriptAlias /cgi-bin/ "X:/Apache2/cgi-bin/",把前面的#号去掉

6.4: 找到 AddHandler cgi-script .cgi后面加上.pl ,即
AddHandler cgi-script .cgi .pl

6.5: 重新启动Apache HTTP Server

7: 测试

7.1: 编写测试文件 env.php (拷贝到目录 可以执行的php的目录下)

文件内容: (其实就一行)

phpinfo(); ?>

访问: http://localhost/info.php 或 http://domain.com/info.php

如果看到PHP的欢迎测试页面,说明安装成功!

编写测试文件 env.cgi (拷贝到目录 可以执行的cgi的目录下)

文件内容:

#!/usr/bin/perl
print "Content-type:text/html ";
print "K O 了";
exit;

访问: http://localhost/cgi-bin/env.cgi 或 http://cgi-bin/env.cgi

如果看到cgi的测试页面,说明安装成功!


到目前为止,你的系统已经配置完成了! 在看看我提供的serv.rar里面的东东还有剩下没用的没?
如果有的话放到合适的位置

你已经配置好了 win2000+apache+php+mysql+mod_perl+perl+mod_ssl+ZendOptimizer

再有就是mod_ssl和openssl在serv.rar那个包里面是已经编译过的,可以直接使用
如果真要用到这两个东东,应该对ca了解一些才行,
相关网站:http://www.wise-tech.com.cn/bbs/forum/openssl/Default.asp



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1673
14
PHP Tutorial
1277
29
C# Tutorial
1257
24
The Continued Use of PHP: Reasons for Its Endurance The Continued Use of PHP: Reasons for Its Endurance Apr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

What happens if session_start() is called multiple times? What happens if session_start() is called multiple times? Apr 25, 2025 am 12:06 AM

Multiple calls to session_start() will result in warning messages and possible data overwrites. 1) PHP will issue a warning, prompting that the session has been started. 2) It may cause unexpected overwriting of session data. 3) Use session_status() to check the session status to avoid repeated calls.

The Compatibility of IIS and PHP: A Deep Dive The Compatibility of IIS and PHP: A Deep Dive Apr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

NGINX and Apache: Understanding the Key Differences NGINX and Apache: Understanding the Key Differences Apr 26, 2025 am 12:01 AM

NGINX and Apache each have their own advantages and disadvantages, and the choice should be based on specific needs. 1.NGINX is suitable for high concurrency scenarios because of its asynchronous non-blocking architecture. 2. Apache is suitable for low-concurrency scenarios that require complex configurations, because of its modular design.

Composer: Aiding PHP Development Through AI Composer: Aiding PHP Development Through AI Apr 29, 2025 am 12:27 AM

AI can help optimize the use of Composer. Specific methods include: 1. Dependency management optimization: AI analyzes dependencies, recommends the best version combination, and reduces conflicts. 2. Automated code generation: AI generates composer.json files that conform to best practices. 3. Improve code quality: AI detects potential problems, provides optimization suggestions, and improves code quality. These methods are implemented through machine learning and natural language processing technologies to help developers improve efficiency and code quality.

What is the significance of the session_start() function? What is the significance of the session_start() function? May 03, 2025 am 12:18 AM

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

Beyond the Hype: Assessing Apache's Current Role Beyond the Hype: Assessing Apache's Current Role Apr 21, 2025 am 12:14 AM

Apache remains important in today's technology ecosystem. 1) In the fields of web services and big data processing, ApacheHTTPServer, Kafka and Hadoop are still the first choice. 2) In the future, we need to pay attention to cloud nativeization, performance optimization and ecosystem simplification to maintain competitiveness.

Using Laravel: Streamlining Web Development with PHP Using Laravel: Streamlining Web Development with PHP Apr 19, 2025 am 12:18 AM

Laravel optimizes the web development process including: 1. Use the routing system to manage the URL structure; 2. Use the Blade template engine to simplify view development; 3. Handle time-consuming tasks through queues; 4. Use EloquentORM to simplify database operations; 5. Follow best practices to improve code quality and maintainability.

See all articles