一、系统约定篇
环境软件下载后存放位置:X:\Server_Tools
环境软件安装位置:X:\Server_Core
PHP安装位置:X:\Server_Core\PHP
MySQL安装位置:X:\Server_Core\MySQL
Zend Optimizer安装位置:X:\Server_Core\Zend
IIS网站站点根目录:X:\wwwroot
MySQL 数据库位置:X:\Database
php.ini存放位置:Y:\Windows\php.ini
my.ini 存放位置:X:\Server_Core\MySQL\my.ini
注:X和Y为本标准中的变量,X仅表示应用程序实际存放、安装的分区盘符,Y为系统所在分区盘符
二、系统环境检查以及准备所需软件篇
1、检查系统是否已安装IIS
单击:“开始”-“管理工具”。

检查是否存在“Internet 信息服务 (IIS) 管理器”,由于操作系统盘中会自带 IIS 组件,所以建议安装操作系统时也把 IIS 组件安装上。如果未安装,可以到网络上下载对应操作系统版本的 IIS 。
2、查看磁盘分区容量并确定使用策略
打开“我的电脑”,查看除C区外各个磁盘分区的可用空间容量,使用容量较大的磁盘分区作为WEB根目录,且MySQL数据库存储目录(Database),尽量不要与WEB根目录同在一个磁盘分区内。较小的磁盘分区可以作为服务环境软件的安装目录分区。
注:如有特殊要求则按要求进行部署。
3、下载环境软件
将所有软件均下载存放于Server_Tools文件夹中,下载地址:
MySQL v5.1.63 for Win下载
PHP v5.2.17 For Windows下载
Zend Optimizer v3.3.3下载
phpMyAdmin v3.4.11下载
注意事项:php版本选择5.2.x,暂时不要用php5.3版本,也不要用php4,php官方不再提供php4支持,MySQL版本选择5.0.x,php和MySQL小版本号越新越好,没有特殊原因不用其他版本,可能会有bug,php尽量使用非安装的绿色版本,MySQL尽量用安装版本。
三、环境部署篇
1、安装MySQL1)安装软件
进入X:\Server_Tools文件夹,双击mysql-essential-5.0.67-win32.msi;

选择Custom自定义安装

点击“Change”更改MySQL安装目录

待文件复制安装完毕后,进行MySQL设置界面,单击Finish。

选择Detailed Configuration进行详细配置

选择MySQL运行模式:Server Machine

选择MySQL数据库默认存储方式:Non-Trans Only (MYISAM)

设定MySQL最大连接数:一般设置为128 - 512之间的整数。

设定MySQL网络参数,注意:不要勾选启用Strict Mode!那个Addfirewall的选项仅在需要外连MySQL的时候勾选上,也就是说给防火墙加个出入站的策略。

设定MySQL默认字符集:以用户站点语言为准,默认我们填gbk。

Windows环境设定

修改设定 root 用户密码,root 密码请设置的比较复杂些。

注意:非必要情况下,不要启动远程连接模式! 完成 MySQL 的安装,并启动 MySQL 服务。

2)测试MySQL 工作是否正常
打开cmd命令提示符窗口,输入命令:mysql –u root –p

输入刚才安装时设置的密码后,如果能够正常进入MySQL控制台则说明MySQL安装正常。& nbsp;
3)更改 MySQL 数据库存放目录
打开cmd命令提示符窗口,输入命令:net stop mysql 停止MySQL服务运行;

打开X:\Server_Core\MySQL\my.ini,
找到: Datadir="X:\Server_Core\MySQL\data"
修改为: Datadir="X:\Database"
将X:\Server_Core\MySQL\data 文件夹复制到X:\,并重命名X:\Database;
打开cmd命令提示符窗口,
输入命令:net start mysql
启动MySQL服务。
重新测试MySQL是否工作正常。
4)移动 LibMySQL 动态链接库到系统目录
将X:\Server_Core\MySQL\bin\libmySQL.dll文件复制到 Y:\Windows\System32目录下。
2、安装 PHP
1)解压缩
解压缩下载的php-5.2.8-Win32.zip文件,并将其复制到:X:\Server_Core\PHP ;
2)修改php.ini
进入X:\Server_Core\PHP文件夹,将php.ini-dist 重命名为php.ini ;
打开php.ini文件,找到: extension_dir= "./"
将其改为: extension_dir= "X:\Server_Core\PHP\ext"
找到:Windows Extensions
在Windows Extensions下方的动态模块配置中,需要打开以下模块支持:(去掉模块配置每行前面的分号即可)
php_gd2.dll php_mbstring.dll php_mcrypt.dll php_mhash.dll php_ming.dll php_mysql.dll php_openssl.dll php_sockets.dll php_xmlrpc.dll php_zip.dll
找到:
disable_functions=
改为:
disable_functions=passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server 3、IIS与PHP的整合配置 1)建立网站 启动IIS管理器,并新建一个网站(虚拟主机); 

输入网站名称,改名称仅为 IIS 中的标识  网站IP地址不用填写,端口如没有特殊要求则保持80即可,最后正确输入网站域名。 PRE>  在网站分区中建立wwwroot以及下级站点文件夹bbs 
对于PHP应用,需要给予该站点“读取”和“运行脚本”的权限。 
至此,已经成功的新建了一个站点。 
IIS与PHP的整合配置 打开刚刚建立的网站属性 
在站点属性窗口中,单击“主目录”页签,单击“配置”按钮,在新弹出的“应用程序配置”对话框中,单击“添加”按钮,加入PHP的ISAPI支持,选择可执行文件:X:\Server _Core\PHP\php5isapi.dll、扩展名为.php、限制动作为:GET,POST。单击“确定”添加,并在 “应用程序配置”窗口中查看.php扩展是否加载成功。若成功,则单击“确定”关闭配置窗口,回到站点属性主窗口。
单击“文档”页签,在默认内容文档中添加index.htm、index.html、index.php三个文件,并将所有默认文档排序,顺序按照下图所示。完成后,单击“确定”,关闭站点属性配置窗口,回到IIS管理器主界面。

右键单击“Web 服务扩展”,添加PHP扩展支持。

在如下图所示的“新建WEB服务扩展”对话框中,“扩展名”填写PHP,“文件”选择X:\Server_Core\PHP \php5isapi.dll,并设置该PHP扩展默认为允许。
 重启IIS服务 

至此,IIS与PHP的整合已经完毕。
3)测试PHP是否安装正确 进入X:\wwwroot\bbs\
目录,新建一个phpinfo.php文件,内容为: <?php
phpinfo();
?> 打开IE浏览器,输入:http://www.xxx.com
/phpinfo.php 注:www.xxx.com为你的服务器域名,本机可以填写localhost 如果能够正常显示P
HP支持信息则表明配置整合成功。 4、安装Zend Optimizer 进入X:\Server_Tools文件夹,双击下载的ZendOptimizer-
3.3.3-Windows-i386.exe文件。 
选择I accept the tems of the license agreement 
点击“Browse”指定Zend Optimzer的安装目录为X:\Server_Core\Zend 
选择IIS(Install detected Microsoft Internet Information Services 5.1) 
选择php.ini的位置,注意观察是否为Y:\Windows,如果不是点击“Browse”选择Y:\Windows 
选择IIS网站根目录的位置,指定为:X:\wwwroot 
至此,就完成Zend Optimizer的安装了 
Zend Optimizer安装完成后会自动重启IIS服务,重启完成后需要再次打开IE浏览器窗口,查phpinfo.php支持信息,
观察是否包含了Zend Optimizer支持信息,如果没有,则说明Zend Optimizer没有安装成功!
|