一直在windows安装php都使用wamp,但由于其中支持thread safe mode与ZendGuardLoader冲突,现在只好手动安装wamp
一,基本的安装
http://hi.baidu.com/esnick/item/140b367b15e10e366cc37c4f
1,apache选择要ssh版的
http://archive.apache.org/dist/httpd/binaries/win32/httpd-2.2.20-win32-x86-openssl-0.9.8r.msi
2,php要选择nts版的
http://windows.php.net/downloads/releases/archives/php-5.3.8-nts-Win32-VC9-x86.zip
3,mysql选择了(mysql-5.0.96-win32.zip)
http://dev.mysql.com/downloads/mysql/5.0.html
安装的步骤相当简单,主要的设置有几点
php.ini
添加
extension_dir = "C:\php5\ext"
启用mysql
extension=php_mysql.dll
extension=php_mysqli.dll
httpd.conf
打开aphche安装目录conf下的httpd.conf文件,
搜索找到“ScriptAlias”,在添加内容,如下:
ScriptAlias /cgi-bin/ "D:/Apache Software Foundation/Apache2.2/cgi-bin/"
#glf-php-add-begin
ScriptAlias /php/ "D:/php/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
Action application/x-httpd-php "/php/php-cgi.exe"
#glf-php-add-end
然后搜索找到Directory,将其下内容修改如下:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
#Deny from all
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
添加虚拟主机
http://rainbird.blog.51cto.com/211214/43087
添加模块
LoadModule vhost_alias_module modules/mod_vhost_alias.so
导入设置
httpd.conf
Include conf/extra/httpd-vhosts.conf
二,加速安装
http://bbs.yxnwork.com/forum.php?mod=viewthread&tid=1132
1,eAccelerator.dll
http://www.oaxueyuan.com/wp-content/uploads/2011/09/eAccelerator5.3.8nts.rar
2,Zend Guard Loader
http://www.zend.com/en/products/guard/downloads
相关设置
php.ini
zend_extension=C:\php5\ext\ZendLoader.dll
zend_loader.enable=1
zend_loader.disable_licensing=0
zend_loader.license_path=
[eAccelerator]
extension="eaccelerator.dll"
eaccelerator.shm_size="128"
eaccelerator.cache_dir="C:/tmp"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys="disk_only"
eaccelerator.sessions="disk_only"
eaccelerator.content="disk_only"
三,ssl的安装
http://dufei.blog.51cto.com/382644/90532
http://oursimplehouse.blog.sohu.com/114435571.html
http://www.jb51.net/article/23971.htm
1,生成rsa密钥
密钥
openssl genrsa -out server.key 1024
openssl req -new -out server.csr -key server.key -config ..\conf\openssl.cnf
公钥
openssl genrsa -out ca.key 1024
openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ..\conf\openssl.cnf
签证
openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..\conf\openssl.cnf
但,此时会报错:
于是在在当前目录创建demoCA,
里面创建文件夹
newcerts
及以下文件,
index.txt,
serial
:serial内容为01,其他为空,.再执行一遍,即可生成server.crt文件
ps.此时需要输入一些信息,注意Common Name为服务器域名,如果在本机,为本机IP。
放置密钥
server.crt,
server.key,
ca.crt
复制到apache的conf文件夹下
2,设置
httpd.conf
打开httpd-ssl.conf:
如下设置:
SSLMutex none
SSLCertificateFile conf/server.crt (服务器公钥)
SSLCertificateKeyFile conf/server.key (服务器私钥)
SSLCACertificateFile conf/ca.crt (CA证书位置)
DocumentRoot "xxxxx" (网页根目录位置)
以下两步不须要
SSLVerifyClient require (去掉前面的‘#’号,进行客户端验证时需要)
SSLVerifyDepth 1 (去掉前面的‘#’号,把10改为1,进行客户端验证时需要)
--------------------------------------------------------
遇到的问题
http://topic.csdn.net/u/20080428/13/3dfe77af-a552-45fb-8569-f856a09532b9.html
http://bbs.chinaunix.net/forum.php?mod=viewthread&action=printable&tid=556088
http://web.archiveorange.com/archive/v/6AHY8GvWcZ4AL3aPc3KC
1,一个莫明其妙的错误,非法参数
Invalid argument: couldn't create child process: 22:
Invalid argument: couldn't spawn child process:
竟然是由于url中含有中文,解决的办法是
1,使用urlencode
2,添加
LoadModule encoding_module modules/mod_encoding.so
但windows版的不好找
http://zsulwj.blog.163.com/blog/static/35326925200911763231841/
http://nicoani.net/wiki/%E5%88%A9%E7%94%A8%E8%80%85:Butameron/%E5%82%99%E5%BF%98%E9%8C%B2/WebDAV-SVN%E3%82%92Windows%E3%81%A7%E6%A7%8B%E7%AF%89%E3%81%99%E3%82%8B#mod_encoding
http://webdav.todo.gr.jp/download/