Windows 2000下PHP服务器安装攻略

 更新时间:2016年11月25日 15:18  点击:1470
一、前期准备情况 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
  接下来添加以下语句:#……的是我的注释,不用加,看一下就可以了
<VirtualHost 192.168.0.1>
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脚本运行目录,当然,不指定的话整个目录全部可以运行
这里参照的是Apache Server1_3_12_win32版本。
ServerType standalone
#设置服务器的形式是单独启动(standalone),还是借由互联网络伺服程序inetd来启动。一般使用前者。
ServerRoot "d:/Apache"
#设置服务器的Home目录,用来存放服务器的设置文件、错误文件、记录文件。
PidFile logs/httpd.pid
#程序启动时,把父进程httpd的进程号(process id)存在这个文件中。这个文件名可以配合PidFile指令加以改变。
ScoreBoardFile logs/apache_status
#设置网络上WWW服务器一些执行程序的记录文件。
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf
#这两个文件的内容已经包含在httpd.conf文件中了。
Timeout 300
#如果客户端300秒还没有连上,或者服务器300秒还没有传送数据到客户端,就会自动断线。
KeepAlive On
#设置是否支持续传功能。
MaxKeepAliveRequests 100
#设置支持续传功能的数目。数目越多则浪费的硬盘空间越多。设置为0则不止持续传。
KeepAliveTimeout 15
#如果该为使用者在15秒后还没有向服务器发出要求,则他在不能续传。
MaxRequestsPerChild 0
#设置同时间内child process数目。
ThreadsPerChild 50
#设置服务器使用进程的数目。
#Listen 3000
#Listen 12.34.56.78:80
#允许使用其它的Port或IP访问服务器。此例中Port为3000,IP为12.34.56.78:80。
#BindAddress *
#设置Apache监听所有的IP,也可以具体的指定。
#LoadModule anon_auth_module modules/ApacheModuleAuthAnon.dll
……
#打开当前未激活预定以的模块。
#ExtendedStatus On
#设置服务器产生的状态信息。
这里参照的是Apache Server1_3_12_win32版本。
Port 80
#设置服务器使用的Port。
ServerAdmin you@your.address
#设置服务器管理者的E-Mail地址。
#ServerName new.host.name
#服务器的主机名。如果你有固定的IP地址,则不需要设置。
DocumentRoot "d:/Apache/htdocs"
#设置存放站点html文件的目录。
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
#设置/目录的指令。具体地说明:
Option:定义在目录内所能执行的操作。None表示只能浏览,FollowSymLinks允许页面连接到别处,ExecCGI允许执行CGI,MultiViews允许看动画或是听音乐之类的操作,Indexes允许服务器返回目录的格式化列表,Includes允许使用SSI。这些设置可以复选。All则可以做任何事,但不包括MultiViews。
UseCanonicalName directive
Syntax: UseCanonicalName on|off|dns
Default: UseCanonicalName on
Context: server config, virtual host, directory
Override: Options
Compatibility: UseCanonicalName is only available in Apache 1.3 and later
In many situations Apache has to construct a self-referential URL. That is, a URL which refers back to the same server. With UseCanonicalName on (and in all versions prior to 1.3) Apache will use the ServerName and Port directives to construct a canonical name for the server. This name is used in all self-referential URLs, and for the values of SERVER_NAME and SERVER_PORT in CGIs.
With UseCanonicalName off Apache will form self-referential URLs using the hostname and port supplied by the client if any are supplied (otherwise it will use the canonical name). These values are the same that are used to implement name based virtual hosts, and are available with the same clients. The CGI variables SERVER_NAME and SERVER_PORT will be constructed from the client supplied values as well.
An example where this may be useful is on an intranet server where you have users connecting to the machine using short names such as www. You'll notice that if the users type a shortname, and a URL which is a directory, such as http://www/splat, without the trailing slash then Apache will redirect them to http://www.domain.com/splat/. If you have authentication enabled, this will cause the user to have to reauthenticate twice (once for www and once again for www.domain.com). But if UseCanonicalName is set off, then Apache will redirect to http://www/splat/.
There is a third option, UseCanonicalName DNS, which is intended for use with mass IP-based virtual hosting to support ancient clients that do not provide a Host: header. With this option Apache does a reverse DNS lookup on the server IP address that the client connected to in order to work out self-referential URLs.
Warning: if CGIs make assumptions about the values of SERVER_NAME they may be broken by this option. The client is essentially free to give whatever value they want as a hostname. But if the CGI is only using SERVER_NAME to construct self-referential URLs then it should be just fine.
IndexOptions FancyIndexing
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz
ReadmeName README
HeaderName HEADER
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
当一个HTTP请求的URL为一个目录的时候,服务器返回这个目录中的索引文件。但如果一个目录中不存在缺省的索引文件,并且该服务器又许可显示目录文件列表的时候,就会显示出这个目录中的文件列表,为了使得这个文件列表能具有可理解性,而不仅仅是一个简单的列表,就需要前面的这些设置参数。
如果使用了IndexOptions FancyIndexing选项,可以让服务器产生的目录列
表中针对各种不同类型的文档引用各种图标。而哪种文件使用哪种图标,则使用
下面的 AddIconByEncoding、AddIconByType以及AddIcon来定义,分别依据MIME 的编码、类型以及文件的后缀来判断使用何种图标。如果不能确定文档使用的图标,就使用 DefaultIcon定义的缺省图标。
准备工作:
在http://www.apache.org下载apache_2.0.44-win32-x86-no_ssl.exe
在http://www.php.net下载php-4.3.0-Win32.zip
安装步骤:
1、运行apache_2.0.44-win32-x86-no_ssl.exe 进行默认安装到结束
2、解压php-4.3.0-Win32.zip到c:
3、拷贝文件c:php-4.3.0-Win32php.ini-dist到Windows目录下,并改名为php.ini,也把c:php-4.0.3-Win32php4ts.dll拷贝到windowssystem目录下(For Win98)或拷贝到winntsystem32目录下(For NT4/NT5)。
4、用记事本编辑文件C:Program FilesApache GroupApache2confhttpd.conf
加入两行:
LoadModule php4_module c:/php-4.3.0-Win32/sapi/php4apache2.dll
AddType application/x-httpd-php .php
5、重新启动Apache,整个安装过程结束,就这么简单,其实就是在httpd.conf中加上php模块。。。
测试:
1、用记事本写个test.php文件,保存到C:Program FilesApache GroupApache2htdocs下,内容如下:
<?php phpinfo(); ?>
2、打开浏览器运行:http://localhost/test.php
嘿嘿,够简单了吧
[!--infotagslink--]

相关文章

  • Windows VPN服务器配置图文教程 超详细版

    VPN可以虚拟出一个专用网络,让远处的计算机和你相当于处在同一个局域网中,而中间的数据也可以实现加密传输,用处很大,特别是在一些大公司,分公司处在不同的区域。...2016-01-27
  • Windows批量搜索并复制/剪切文件的批处理程序实例

    这篇文章主要介绍了Windows批量搜索并复制/剪切文件的批处理程序实例,需要的朋友可以参考下...2020-06-30
  • C#创建简单windows窗体应用(加法器)

    这篇文章主要为大家详细介绍了C#创建一个简单windows窗体应用的方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2020-06-25
  • 分享一段php获取linux服务器状态的代码

    简单的php获取linux服务器状态的代码,不多说-直接上函数:复制代码 代码如下:function get_used_status(){ $fp = popen('top -b -n 2 | grep -E "^(Cpu|Mem|Tasks)"',"r");//获取某一时刻系统cpu和内存使用情况 $rs =...2014-05-31
  • Springboot+TCP监听服务器搭建过程图解

    这篇文章主要介绍了Springboot+TCP监听服务器搭建过程,本文通过图文并茂的形式给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下...2020-10-28
  • Powershell 查询 Windows 日志的方法

    这篇文章主要介绍了Powershell 查询 Windows 日志的方法,需要的朋友可以参考下...2020-06-30
  • 服务器 UDP端口占用几千个的解决办法

    前一段时间使用NetStat命令查看服务器端口时,发现服务器udp端口开放了好多,最少在1000个以上,当时事情比较多,没有管它,今天终于有点时间,仔细检查了一下,排除了这个问题. ...2016-01-27
  • PHP连接公司内部服务器的MYSQL数据库的简单实例

    “主机,用户名,密码”得到连接、“数据库,sql,连接”得到结果,最后是结果的处理显示。当然,数据库连接是扩展库为我们完成的,我们能做的仅仅是处理结果而已。...2013-09-29
  • C#实现windows form限制文本框输入的方法

    这篇文章主要介绍了C#实现windows form限制文本框输入的方法,涉及C#限制文本框输入的技巧,非常具有实用价值,需要的朋友可以参考下...2020-06-25
  • 解决HttpPost+json请求---服务器中文乱码及其他问题

    这篇文章主要介绍了解决HttpPost+json请求---服务器中文乱码及其他问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2021-01-22
  • JS实现不使用图片仿Windows右键菜单效果代码

    本文实例讲述了JS实现不使用图片仿Windows右键菜单效果代码。分享给大家供大家参考,具体如下:这里演示JS不使用图片仿Windows右键菜单效果,这款代码灵活使用了文鼎字,配合CSS和JS做出了这个和系统右键菜单很相似的东东。...2015-10-23
  • C# Windows API应用之基于GetDesktopWindow获得桌面所有窗口句柄的方法

    这篇文章主要介绍了C# Windows API应用之基于GetDesktopWindow获得桌面所有窗口句柄的方法,结合实例形式分析了GetDesktopWindow函数用于获取窗口句柄的具体使用方法与相关注意事项,需要的朋友可以参考下...2020-06-25
  • Linux与Windows喜结连理

    作为一个新生事物,Linux吸引了不少眼球,但是它能否快捷、方便地与Windows资源共享,是一个很重要的问题。大家知道,Windows之间可以利用“网络邻居”来实现资源共享,而Linux...2016-11-25
  • 利用C#修改Windows操作系统时间

    这篇文章主要介绍了利用C#修改Windows操作系统时间,帮助大家更好的利用c#操作系统,感兴趣的朋友可以了解下...2020-12-08
  • 详解Windows下安装Nodejs步骤

    本篇文章主要介绍了详解Windows下安装Nodejs步骤,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧 ...2017-05-22
  • C#3.0使用EventLog类写Windows事件日志的方法

    这篇文章主要介绍了C#3.0使用EventLog类写Windows事件日志的方法,以简单实例形式分析了C#写windows事件日志的技巧,具有一定参考借鉴价值,需要的朋友可以参考下...2020-06-25
  • Hyper-V尝试连接到服务器出错无效类的解决方法

    这篇文章主要介绍了Hyper-V尝试连接到服务器出错无效类的解决方法,需要的朋友可以参考下...2016-09-28
  • mac使用Shell(终端)SSH连接远程服务器的方法

    这篇文章主要介绍了mac使用Shell(终端)SSH连接远程服务器的方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2020-07-11
  • js实现上传图片到服务器

    这篇文章主要为大家详细介绍了js实现上传图片到服务器,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2021-04-11
  • uploader秒传图片到服务器完整代码

    这篇文章主要为大家详细介绍了uploader秒传图片到服务器的完整代码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2017-04-27