首页 > 编程技术 > php

IIS服务器完全配置实现asp,cgi,perl和php+mysql

发布时间:2016-11-25 15:17

IIS服务器完全配置实现asp,cgi,perl和php+mysql
IIS服务器完全配置 现在我们要使IIS实现ASP,CGI,PERL和PHP+MYSQL
所需软件(都要是For Windows的):
ActivePerl、PHP、MYSQL
一.ASP支持:
不用说了吧,什么都不用做,本身就支持ASP运行。
二.CGI,PERL支持:
1.安装ActivePerl
运行下载的ActivePerl一步一步安装(注意:安装路径请选择到根目录的/usr/下(默认是perl),这样对以后调试程序省很多事)
2.配置IIS
打开"Internet 信息服务"(在'管理工具'里),点开默认站点的属性,如图:
选择 "主目录" 选项卡,然后点 "配置(G)...",弹出如图对话框
然后 "添加(D)" 如下图:
推荐"c:usrinperl.exe" 记得一定要在后面加上" %s %s ",不然没法执行cgi的,确定后。用同样的方法添加扩展名.pl,如图:
完成后如图:
现在你的IIS已经支持cgi,perl了!
三.PHP、MYSQL支持:
1.安装PHP和MYSQL
运行下载的PHP和MYSQL一步一步安装就行了(装到哪里都行,一般现在网上流行的都是安装过的PHP,没有安装程序,你只需要把下载的压缩包解压缩出来就行了,放到如:c:php下)
2.PHP支持:
2.1 拷贝php目录下dlls文件夹里所有文件到c:windowssystem32下
2.2配置IIS:和刚才配置cgi一样,添加.php 如下图:
完成后如下图:
最后,把如图:
这里的 "执行权限" 该成:"脚本和可执行文件" 然后确定ok! 现在你的IIS已经完全支持PHP+MYSQL了!
一、下载MySQL数据库(ODBC)驱动程序和MySQL数据库系统程序
1.MySQL数据库(ODBC)驱动程序下载地址为: http://mysql.com/Downloads/MyODBC/myodbc-2.50.36-nt.zip 、 http://download.sourceforge.net/pub/mirrors/mysql/Downloads/MyODBC/myodbc-2.50.36-nt.zip 或者 http://www.fykx.net/download/php/myodbc-2.50.36-nt.zip(1457KB)
2.MySQL数据库系统程序下载地址为: http://www.mysql.com/Downloads/MySQL-3.23/mysql-3.23.30-gamma-win.zip (9632KB)或者是 http://www.fykx.net/download/php/mysql-3.23.30-gamma-win.zip
二、程序安装
1.安装MySQL数据库(ODBC)驱动程序(Windows系统下必须安装)
2.安装MySQL数据库系统程序,一般安装在系统默认位置“C:MySQL”,但要考虑你的服务器是否作为网络数据库服务器,如果要在此服务器上建立上百个数据库用户,就应该安装在空间比较大硬盘分驱上,以免今后不必要的麻烦和繁琐的设置。
Win32下Apache 2.0.35 php 4.2.0安装扎记
1、安装界面比较有好,分别添入ServerAdmin、ServerName、post即可
     如果你起用了DNS,会将DNS的设置作为默认配置,这点要注意。
     当可见到默认主页时表明安装成功,一般没有问题
2、默认的主页位置在[d]:/Program Files/Apache Group/Ahache2/htdocs
     若需要修改可在httph.conf文件中修改(下同)
     DucumentRoot "你的主页位置"
     请同时修改
     <Directory "你的主页位置">
     如需要配置用户主页,可修改
     UserDir "用户主页集位置"
     访问时用http://ServerName:post/~用户目录名
3、设定默认页面名
     将
     DirectoryIndex index.html index.html.var
     改为
     DirectoryIndex index.php index.html index.html.var
4、将
     AddDefaultCharset ISO-8859-1
     改为
     AddDefaultCharset GB2312
     以使输出页面的默认字符集为 gb2312,可防止出现乱码
5、在尾部添上(注意apache2filter.dll的真实路径)
     LoadModule php4_module c:/php/experimental/apache2filter.dll
     AddOutputFilter PHP .php
     AddInputFilter PHP .php
     AddType text/html .php
6、php4.2.0的安装与低版本相同
     到此,大功告成,你可以享受Apache 2.0了

#ExtendedStatus On <br>
  Apache服务器可以通过特殊的HTTP请求,来报告自身的运行状态,打开这个 <br>
ExtendedStatus 参数可以让服务器报告更全面的运行状态信息。
 <br>
主服务器设置 <br>
  Apache服务器需要各种设置,以定义自己使用各种参数以提供Web服务。对于使用虚拟主机的情况,除了在虚拟主机的定义项中覆盖的设置之外(有的设置必须重新定义),这里的设置也是虚拟主机的缺省设置。
 <br>
  Port 80 <br>
  Port定义了Standalone模式下httpd守护进程使用的端口,标准端口是80。这个选项只对于以独立方式启动的服务器才有效,对于以inetd方式启动的服务器则在inetd.conf中定义使用哪个端口。
 <br>
  在Unix下使用80端口需要root权限,一些管理员为了安全的原因,认为 httpd 服务器不可能没有安全漏洞,因而更愿意使用普通用户的权限来启动服务器,这样就不能使用80端口及其他小于1024的端口,而必须使用大于 1024的端口来启动httpd,一般情况下8000或8080也是常用的端口。而Apache httpd服务器本身可以在以root权限打开80端口后再改变为普通用户身份进行运行,这样就减少了危险性,因而就不需要考虑这个安全问题。但是如果普通用户也想安装配置自己的WWW服务器,那么就不得不使用大于1024的端口。
 <br>
  User nobody <br>
  Group nogroup <br>
  User和Group配置是Apache的安全保证,Apache在打开端口之后,就将其本身设置为这两个选项设置的用户和组权限进行运行,这样就降低了服务器的危险性。这个选项也只用于 Standalone模式,inetd模式在inetd.conf中指定运行Apache的用户。由于服务器必须执行改变身份的setuid()操作,因此初始进程应该具备root权限,如果是使用非root用户来启动Aapche,这个配置就不会发挥作用。
 <br>
  缺省设置为nobody和nogroup,这个用户和组在系统中不拥有文件,保证了服务器本身和由它启动的CGI 进程没有权限更改文件系统。在某些情况下,例如为了运行CGI与Unix交互,也需要让服务器来访问服务器上的文件,如果仍然使用nobody和nogroup,那么系统中将会出现属于nobody的文件,这对于系统安全是不利的,因为其他程序也会以nobody和nogroup的权限执行某些操作,就有可能访问这些nobody拥有的文件,造成安全问题。一般情况下要为Web服务设定一个特定的用户和组,同时在这里更改用户和组设置。
Satisfy directive
Syntax: Satisfy 'any' or 'all'
Default: Satisfy all
Context: directory, .htaccess
Status: core
Compatibility: Satisfy is only available in Apache 1.2 and later
Access policy if both allow and require used. The parameter can be either 'all' or 'any'. This directive is only useful if access to a particular area is being restricted by both username/password and client host address. In this case the default behavior ("all") is to require that the client passes the address access restriction and enters a valid username and password. With the "any" option the client will be granted access if they either pass the host restriction or enter a valid username and password. This can be used to password restrict an area, but to let clients from particular addresses in without prompting for a password.
See also require and mod_access.
--------------------------------------------------------------------------------
ScoreBoardFile directive
Syntax: ScoreBoardFile filename
Default: ScoreBoardFile logs/apache_status
Context: server config
Status: core
The ScoreBoardFile directive is required on some architectures to place a file that the server will use to communicate between its children and the parent. The easiest way to find out if your architecture requires a scoreboard file is to run Apache and see if it creates the file named by the directive. If your architecture requires it then you must ensure that this file is not used at the same time by more than one invocation of Apache.
If you have to use a ScoreBoardFile then you may see improved speed by placing it on a RAM disk. But be careful that you heed the same warnings about log file placement and security.
Apache 1.2 and above:
Linux 1.x users might be able to add -DHAVE_SHMGET -DUSE_SHMGET_SCOREBOARD to the EXTRA_CFLAGS in your Configuration. This might work with some 1.x installations, but won't work with all of them. (Prior to 1.3b4, HAVE_SHMGET would have sufficed.)
<FilesMatch>
Syntax: <FilesMatch regex> ... </FilesMatch>
Context: server config, virtual host, .htaccess
Status: core
Compatibility: only available in Apache 1.3 and above.
The <FilesMatch> directive provides for access control by filename, just as the <Files> directive does. However, it accepts a regular expression. For example:
     <FilesMatch ".(gif|jpe?g|png)$">
would match most common Internet graphics formats.
See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received
--------------------------------------------------------------------------------
Group directive
Syntax: Group unix-group
Default: Group #-1
Context: server config, virtual host
Status: core
The Group directive sets the group under which the server will answer requests. In order to use this directive, the stand-alone server must be run initially as root. Unix-group is one of:
A group name
Refers to the given group by name.
# followed by a group number.
Refers to a group by its number.
It is recommended that you set up a new group specifically for running the server. Some admins use user nobody, but this is not always possible or desirable.
Note: if you start the server as a non-root user, it will fail to change to the specified group, and will instead continue to run as the group of the original user.
Special note: Use of this directive in <VirtualHost> requires a properly configured suEXEC wrapper. When used inside a <VirtualHost> in this manner, only the group that CGIs are run as is affected. Non-CGI requests are still processed as the group specified in the main Group directive.
SECURITY: See User for a discussion of the security considerations.
--------------------------------------------------------------------------------
标签:[!--infotagslink--]

您可能感兴趣的文章: