信息安全的隐患-GoogleHacking原理和防范
技术天地:GoogleHacking是利用Google的搜索引擎快速查找存在脆弱性的主机以及包含敏感数据的信息,最近这种以前由黑客手动进行操作的攻击手段可以通过一种新的蠕虫病毒来自动完成。为了引起大家对GoogleHacking的关注与重视,我们编发了这篇文章希望大家通过对Hack的攻击手段的了解,更好的保护自己的信息安全。本文中重在对GoogleHacking攻击手段的理解,对一些攻击的细节不予详述请谅解。
前言:
2004年在拉斯维加斯举行的BlackHat大会上,有两位安全专家分别作了名为You found that on google ? 和google attacks 的主题演讲。经过安全焦点论坛原版主WLJ大哥翻译整理后,个人觉得有必要补充完善一些细节部分。今天向大家讲述的是Google的又一功能:利用搜索引擎快速查找存在脆弱性的主机以及包含敏感数据的信息,甚至可以直接进行傻瓜入侵。
用google来进行“渗透测试”
我们今天渗透测试人员在实施攻击之前,往往会先进行信息搜集工作,而后才是漏洞确认和最终的漏洞利用、扩大战果。在这里我们现在要谈的是:
一、利用google查找被人安装了php webshell后门的主机,并测试能否使用;
二、利用google查找暴露出来的INC敏感信息.
OK,现在我们开始:
1.查找利用php webshell
我们在google的搜索框中填入:
Code:
intitle:\"php shell*\" \"Enable stderr\" filetype:php
(注: intitle—网页标题 Enable stderr—UNIX标准输出和标准错误的缩写filetype—文件类型)。搜索结果中,你能找到很多直接在机器上执行命令的web shell来。如果找到的PHPSHELL不会利用,如果你不熟悉UNIX,可以直接看看LIST,这里就不详细说了,有很多利用价值。要说明的是,我们这里搜索出来的一些国外的PHPSHELL上都要使用UNIX命令,都是system调用出来的函数(其实用百度及其他搜索引擎都可以,只是填写搜索的内容不同)。通过我的检测,这个PHPWEBSHELL是可以直接Echo(Unix常用命令)。一句话就把首页搞定了:
Code:
echo \"召唤\" > index.jsp
在得到的
Code:
echo \
后再写上:\"召唤\"
现在看看首页,已经被我们改成: \"召唤\" 了
我们也可以用WGET上传一个文件上去(比如你要替换的叶子吧)。然后execute Command输入 cat file > index.html or echo \"\" > file
echo \"test\" >> file
这样一条条打出来,站点首页就成功被替换了。同样的也可以
Code:
uname -a;cat /etc/passwd
不过有点要注意,有些WEBSHELL程序有问题,执行不了的,比如:
http://www.al3toof.com/card/smal ... c_html&command=
http://ramsgaard.net/upload/shell.php
这些站的php是global register off
解决方案:
我们可以利用相关工具进行在互联网进行搜索,如果有信息被滥用,到http://www.google.com/remove.html 提交你希望删除的信息,
控制搜索引擎机器人的查询.
2.搜索INC敏感信息
我们在google的搜索框中填入:
Code:
.org filetype:inc
我们现在搜索的是org域名的站点的INC信息(因为google屏蔽掉了搜索\"COM\"信息,我们还可以搜其他gov,cn,info,tw,jp,edu等等之类的)
PS:我在看许多PHP编程人员在编程时候,都喜欢把一些常写的代码或配置信息,写在一个.inc的文件中,如shared.inc、global.inc、conn.inc等等,当然这是一个很好的习惯,包括PHP官方网站都是如此,但不知你有没有注意到这里面含一个安全隐患问题。
我有一次在写一个PHP代码时,无意中写错了一句话,当我在浏览器里查看此PHP文件时,竟然发现屏幕详细的显示了我所出错的PHP文件路径及代码行。(PHP错误显示配置是开着的.此功能在PHP里是默认的!),这就是说当我们无意写错代码(同样.inc文件也一样) 或者PHP代码解析出问题时,而PHP错误显示又是开着的,客户端的用户就会看到具体url地址的.inc文件,而.url文件如同txt文本一样,当在浏览器中浏览时,就毫无保留地显示了它的内容,而且不少站点在.inc文件写了重要的信息如用户密码之类!包括国内著名海尔公司以及嘉铃摩托公司,我之所以敢公布是因为我本人测试过,http://www.haier.com/su ***/inc/conn.inc 暴出的数据库ID密码用客户端连不上去,网站关闭了1215,而且防火墙也过滤掉了。
好,INC的知识说完后,我们继续又搜索到了好多,找到一个暴露了MYSQL口令的
我们又可以用客户端登陆上去修改数据了.这里涉及到数据库的知识,我们不谈太多,关于\"INC暴露敏感信息\"就到这里结束吧
当然我们可以通过一些办法解决:
1,你可以专门对.inc文件进行配置,避免用户直接获取源文件。
2,当然比较好的方法是,加上并且改文件扩展名为.php(PHP可以解析的扩展名),这样客户端就不会获取源文件了。
这里,我将FreeMind绘制的图片用文本表示了.
有关Google Hack的详细信息,帮助我们分析踩点
连接符:
Code:
+ - : . * |
操作符:
Code:
\"foo1 foo2\"
filetype:123
site:foo.com
intext:foo
intitle:footitle
allinurl:foo
密码相关
Code:
:“index of”
htpasswd / passwd
filetype:xls username password email
\"ws_ftp.log\"
\"config.php\"
allinurl:admin mdb
service filetype:pwd (frontpage)
敏感信息:
Code:
\"robots.tx\"
\"disallow:\"
filetype:txt
inurl:_vti_cnf (frontpage files)
allinurl:/msadc/samples/selector/showcode.asp
allinurl:/examples/jsp/snp/snoop.jsp
allinurl:phpsysinfo
ipsec filetype:conf
intitle:\"error occurred\" odbc request where (select|insert)
\"mydomain.com\" nessus report
\"report generated by\"
结尾:
如果要拿ROOT权限就要具体问题具体分析了,不过有了SHELL权限就好提了,网上有很多根据WEBSHELL提升权限的文章大家可以参照一下.
通过google我们还可以搜索到很多有用的东西,不过是细节,要通过信息收集慢慢分析、扩大、进行入侵.
这些我就不具体分析了.给大家个思路,大家慢慢研究好了
到这里,这篇文章就要结束了,写这篇文章的目的是为了引起大家的关注与重视,了解新的HACK手段,了解新的防护方法,事物都有两面性,在当今Google盛行的时代,在充分利用google的同时.也应该看得更全面.
技术天地:GoogleHacking是利用Google的搜索引擎快速查找存在脆弱性的主机以及包含敏感数据的信息,最近这种以前由黑客手动进行操作的攻击手段可以通过一种新的蠕虫病毒来自动完成。为了引起大家对GoogleHacking的关注与重视,我们编发了这篇文章希望大家通过对Hack的攻击手段的了解,更好的保护自己的信息安全。本文中重在对GoogleHacking攻击手段的理解,对一些攻击的细节不予详述请谅解。
前言:
2004年在拉斯维加斯举行的BlackHat大会上,有两位安全专家分别作了名为You found that on google ? 和google attacks 的主题演讲。经过安全焦点论坛原版主WLJ大哥翻译整理后,个人觉得有必要补充完善一些细节部分。今天向大家讲述的是Google的又一功能:利用搜索引擎快速查找存在脆弱性的主机以及包含敏感数据的信息,甚至可以直接进行傻瓜入侵。
用google来进行“渗透测试”
我们今天渗透测试人员在实施攻击之前,往往会先进行信息搜集工作,而后才是漏洞确认和最终的漏洞利用、扩大战果。在这里我们现在要谈的是:
一、利用google查找被人安装了php webshell后门的主机,并测试能否使用;
二、利用google查找暴露出来的INC敏感信息.
OK,现在我们开始:
1.查找利用php webshell
我们在google的搜索框中填入:
Code:
intitle:\"php shell*\" \"Enable stderr\" filetype:php
(注: intitle—网页标题 Enable stderr—UNIX标准输出和标准错误的缩写filetype—文件类型)。搜索结果中,你能找到很多直接在机器上执行命令的web shell来。如果找到的PHPSHELL不会利用,如果你不熟悉UNIX,可以直接看看LIST,这里就不详细说了,有很多利用价值。要说明的是,我们这里搜索出来的一些国外的PHPSHELL上都要使用UNIX命令,都是system调用出来的函数(其实用百度及其他搜索引擎都可以,只是填写搜索的内容不同)。通过我的检测,这个PHPWEBSHELL是可以直接Echo(Unix常用命令)。一句话就把首页搞定了:
Code:
echo \"召唤\" > index.jsp
在得到的
Code:
echo \
后再写上:\"召唤\"
现在看看首页,已经被我们改成: \"召唤\" 了
我们也可以用WGET上传一个文件上去(比如你要替换的叶子吧)。然后execute Command输入 cat file > index.html or echo \"\" > file
echo \"test\" >> file
这样一条条打出来,站点首页就成功被替换了。同样的也可以
Code:
uname -a;cat /etc/passwd
不过有点要注意,有些WEBSHELL程序有问题,执行不了的,比如:
http://www.al3toof.com/card/smal ... c_html&command=
http://ramsgaard.net/upload/shell.php
这些站的php是global register off
解决方案:
我们可以利用相关工具进行在互联网进行搜索,如果有信息被滥用,到http://www.google.com/remove.html 提交你希望删除的信息,
控制搜索引擎机器人的查询.
2.搜索INC敏感信息
我们在google的搜索框中填入:
Code:
.org filetype:inc
我们现在搜索的是org域名的站点的INC信息(因为google屏蔽掉了搜索\"COM\"信息,我们还可以搜其他gov,cn,info,tw,jp,edu等等之类的)
PS:我在看许多PHP编程人员在编程时候,都喜欢把一些常写的代码或配置信息,写在一个.inc的文件中,如shared.inc、global.inc、conn.inc等等,当然这是一个很好的习惯,包括PHP官方网站都是如此,但不知你有没有注意到这里面含一个安全隐患问题。
我有一次在写一个PHP代码时,无意中写错了一句话,当我在浏览器里查看此PHP文件时,竟然发现屏幕详细的显示了我所出错的PHP文件路径及代码行。(PHP错误显示配置是开着的.此功能在PHP里是默认的!),这就是说当我们无意写错代码(同样.inc文件也一样) 或者PHP代码解析出问题时,而PHP错误显示又是开着的,客户端的用户就会看到具体url地址的.inc文件,而.url文件如同txt文本一样,当在浏览器中浏览时,就毫无保留地显示了它的内容,而且不少站点在.inc文件写了重要的信息如用户密码之类!包括国内著名海尔公司以及嘉铃摩托公司,我之所以敢公布是因为我本人测试过,http://www.haier.com/su ***/inc/conn.inc 暴出的数据库ID密码用客户端连不上去,网站关闭了1215,而且防火墙也过滤掉了。
好,INC的知识说完后,我们继续又搜索到了好多,找到一个暴露了MYSQL口令的
我们又可以用客户端登陆上去修改数据了.这里涉及到数据库的知识,我们不谈太多,关于\"INC暴露敏感信息\"就到这里结束吧
当然我们可以通过一些办法解决:
1,你可以专门对.inc文件进行配置,避免用户直接获取源文件。
2,当然比较好的方法是,加上并且改文件扩展名为.php(PHP可以解析的扩展名),这样客户端就不会获取源文件了。
这里,我将FreeMind绘制的图片用文本表示了.
有关Google Hack的详细信息,帮助我们分析踩点
连接符:
Code:
+ - : . * |
操作符:
Code:
\"foo1 foo2\"
filetype:123
site:foo.com
intext:foo
intitle:footitle
allinurl:foo
密码相关
Code:
:“index of”
htpasswd / passwd
filetype:xls username password email
\"ws_ftp.log\"
\"config.php\"
allinurl:admin mdb
service filetype:pwd (frontpage)
敏感信息:
Code:
\"robots.tx\"
\"disallow:\"
filetype:txt
inurl:_vti_cnf (frontpage files)
allinurl:/msadc/samples/selector/showcode.asp
allinurl:/examples/jsp/snp/snoop.jsp
allinurl:phpsysinfo
ipsec filetype:conf
intitle:\"error occurred\" odbc request where (select|insert)
\"mydomain.com\" nessus report
\"report generated by\"
结尾:
如果要拿ROOT权限就要具体问题具体分析了,不过有了SHELL权限就好提了,网上有很多根据WEBSHELL提升权限的文章大家可以参照一下.
通过google我们还可以搜索到很多有用的东西,不过是细节,要通过信息收集慢慢分析、扩大、进行入侵.
这些我就不具体分析了.给大家个思路,大家慢慢研究好了
到这里,这篇文章就要结束了,写这篇文章的目的是为了引起大家的关注与重视,了解新的HACK手段,了解新的防护方法,事物都有两面性,在当今Google盛行的时代,在充分利用google的同时.也应该看得更全面.
Introduction
www.comvantage.com/
Thank you for choosing Document Storage System (DSS), which was created to securely store and effectively manage virtually any type of document into a searchable database. These documents can be added to the system via a scanner or from any type of file. Multiple files can even be drag-and-dropped into DSS to import files in volume. Documents are stored in a compressed format into the database - saving as much as 90% less disk space than the same files not in the system.
The security in DSS has been enhanced to support multiple departments in a single database allowing each department to customize the categorizing data fields and user rights/roles to each particular department to prevent information breaches to unauthorized users. DSS also supports document locking to prevent others from editing certain documents.
Documents can have an unlimited amount of descriptive information added or use the OCR plug-in to extract keywords from the documents to make searching by keywords more powerful. The search tree allows a graphical means to search for documents similar to Windows Explorer.
The annotations feature allows the user to add comments on a separate layer than the document.
DSS has been developed to be fully scalable from a home office to a large multi-department organization. DSS allows for database upgrading from the provided MS Access database to an enterprise database like MS SQL Server, MySQL, Oracle, Interbase, IBM DB2 or Sybase.
The repository mode provides for high-speed scanning of unorganized documents, which can later be organized and categorized. This also allows incoming documents to be divided based on workflow or job function.
The DSS Printer can act as a way to capture documents directly rather than printing on paper and scanning the documents into the system.
DSS makes your search results and documents portable by the creation of a \"snapshot\" of the database that can be copied to a CD-ROM, which can then be distributed freely and run on any Windows machine without the need for an install process or a DSS license.
As you will see, DSS has a user-friendly interface but includes an extensive help file for your review. DSS is ready to grow with your company and simplify document management.
[ed]ed2k://|file|COMvantage.Document.Storage.System.V4.0.Enterprise-CORE.rar|12199330|A173F3F0D92B9323DA50863CE3A10EB5|/[/ed]

www.comvantage.com/
Thank you for choosing Document Storage System (DSS), which was created to securely store and effectively manage virtually any type of document into a searchable database. These documents can be added to the system via a scanner or from any type of file. Multiple files can even be drag-and-dropped into DSS to import files in volume. Documents are stored in a compressed format into the database - saving as much as 90% less disk space than the same files not in the system.
The security in DSS has been enhanced to support multiple departments in a single database allowing each department to customize the categorizing data fields and user rights/roles to each particular department to prevent information breaches to unauthorized users. DSS also supports document locking to prevent others from editing certain documents.
Documents can have an unlimited amount of descriptive information added or use the OCR plug-in to extract keywords from the documents to make searching by keywords more powerful. The search tree allows a graphical means to search for documents similar to Windows Explorer.
The annotations feature allows the user to add comments on a separate layer than the document.
DSS has been developed to be fully scalable from a home office to a large multi-department organization. DSS allows for database upgrading from the provided MS Access database to an enterprise database like MS SQL Server, MySQL, Oracle, Interbase, IBM DB2 or Sybase.
The repository mode provides for high-speed scanning of unorganized documents, which can later be organized and categorized. This also allows incoming documents to be divided based on workflow or job function.
The DSS Printer can act as a way to capture documents directly rather than printing on paper and scanning the documents into the system.
DSS makes your search results and documents portable by the creation of a \"snapshot\" of the database that can be copied to a CD-ROM, which can then be distributed freely and run on any Windows machine without the need for an install process or a DSS license.
As you will see, DSS has a user-friendly interface but includes an extensive help file for your review. DSS is ready to grow with your company and simplify document management.
[ed]ed2k://|file|COMvantage.Document.Storage.System.V4.0.Enterprise-CORE.rar|12199330|A173F3F0D92B9323DA50863CE3A10EB5|/[/ed]

Setting up BIND under windows
For one reason or another you insist to run BIND on windows. Well that's perfectly acceptable! Download the BIND executeable linked from the previous post and install it to the default directory.
Under Windows XP, %WINDIR% is 'C:\WINDOWS'
Under Windows NT/2K/2K3, %WINDIR% is 'C:\WINNT'
%WINDIR%\SYSTEM32\dns\bin
In this directory you have all of the BIND executeables. Here's a description of the executeables I'm going to bother mentioning:
named.exe - This is the BIND server program
rndc.exe - This program can be used to manage the server
named-checkzone.exe - This program can be used to check the syntax for zone files
named-checkconf.exe - This program can be used to check the syntax for config files
%WINDIR%\SYSTEM32\dns\etc
In this directory you have all the configuration files and zone files. Delete all the files you see in here. Then download my template BIND Config files to this directory. Ignore the "advanced" directory. Here's a description of the files:
named.conf - Tell bind what domains you are hosting - plus some extra config stuff.
rndc.key - This is the authentication key for rndc.exe to manage named.exe.
named.ca - These are the DNS root servers.
basiczone.com.zone - This is an example zone file.
127.0.0.rev - This is an example of a reverse IP zone file.
If you are the intuitive sort, reading the comments in these files should teach you all you need to know to get everything setup to your satisfaction. However, I'm going to assume you're still confused, so let's move on. The first thing we need to do is configure BIND to be the host of your domain. So crack open named.conf in notepad.
-- open named.conf --
First we need to tell BIND where our zone files are going to be stored. Currently it is set to this:
directory "/var/named";
That may be fine under linux, but we need to change it to this. Don't forget to replace %WINDIR% with the path to your windows directory.
directory "%WINDIR%\SYSTEM32\dns\etc";
Now let's pretend the domain you want to host on your server is called "example.com". Let's edit the file so that it is using our domain. Scroll all the way down to the end of the file. You will find this zone block:
zone "basiczone.com" IN {
type master;
file "basiczone.com.zone";
};
Seems pretty straight-forward. We are going to be the master of the domain, so the type is "master". It also provides the name of the file that stores information about the "basiczone.com" domain. Let's change that to this:
zone "example.com" IN {
type master;
file "example.com.zone";
};
Excellent, we are now the host of our very own example.com! The file "example.com.zone" that will be in our etc directory will take care of domain->IP resolutions, but we also need IP->domain resolution as well. So take a look at this other zone block:
zone "0.0.127.in-addr.arpa" {
type master;
file "127.0.0.rev";
};
Now we see why it's called a "reverse" zone. The IP address is reversed for resolution purposes to make it act like a domain. Now go to www.whatismyip.com and copy that IP address. I'm going to pretend that the IP is 12.345.67.8. Let's edit the zone block to say this:
zone "67.345.12.in-addr.arpa" {
type master;
file "12.345.67.rev";
};
Wondering why we aren't including the last number 8? It's because this demonstration is creating a reverse zone file for all the IP addresses that start with 12.345.67. In the zone file we'll configure which ending IPs are pointing to what.
-- close named.conf --
So now we're done configuring named.conf. We need to setup the domain and reverse ip zone files now. In your etc directory, make the following changes:
rename basiczone.com.zone to example.com.zone
rename 127.0.0.rev to 12.345.67.rev
Once again we're at a point where the dns server will run perfectly fine. However, our DNS info will be all wrong wrong wrong. So on to editing your example.com domain. We're assuming the following:
You registered ns1.example.com at your registrar with 12.345.67.8
You registered ns2.example.com at your registrar with 12.345.67.8
You specified the following servers as hosts for your domain at your registrar:
ns1.example.com
ns2.example.com
-- open example.com.zone --
There's a few confusing points about this file that you may be wondering about. A zone file is filled with "records". Each record takes a domain, and assign it to some piece of information. The file is also organized into columns. Here's a description of them:
Column1: The domain to assign the information
In the first column we have these values: @, ns1, ns2, www, mail. The '@' is a symbol for the name of our zone. That would be 'example.com' in this case. The other words are simply a shortcut for "ns1.example.com", "ns2.example.com", "Www.example.com", and "mail.example.com" respectively. BIND will add on the zone name when it reads the file.
Column2: The type of information we're assigning
In the second column we have these values: SOA, NS, MX, A. Just ignore the SOA record, it's required. The NS records are where we specify the names of the dns servers that host our domain. The MX record is where we assign the name of our email server for <mailbox>@example.com. And finally, the 'A' records is where we assign IP addresses to the domains.
Column3: The information data
This is what we're going to have to edit. The NS records are fine if you added "ns1.example.com" and "ns2.example.com" as hosts for your domain at your registrar. If not, you need to change the data values to the names of the dns servers you DID assign at your registrar. The MX record is also fine if you want "mail.example.com" to be your mail server. The 'A' records have got to change though. If you're hosting your own mail server and web server, change all the IPs to 12.345.67.8 (replace that with your real IP of course).
-- close example.com.zone --
All done with that. Let's move on to the reverse zone:
-- open 12.345.67.rev --
Things are a little bit different in this file. Notice that we've got some full domains. You are allowed to specify full domains in your zone files IF you have a period stuck on to the end of it. Always put that period on there if you DON'T want BIND to automatically append the zone name to the end of the domain. We also got a new record type called PTR. The PTR record is what you use to assign a domain to an IP. PTR records should only be located in reverse IP zones. In this zone we are assigning domains to 4 IP addresses. All 4 IPs begin with 12.345.67 since that is the name of our zone, and the last digit can be found in the first column. Delete all these records:
1 PTR ns1.basiczone.com.
2 PTR ns2.basiczone.com.
3 PTR mail.basiczone.com.
4 PTR www.basiczone.com.
In our demonstration we only have 1 IP, so let's make only 1 PTR record for the IP ending with 8.
8 PTR mail.example.com. ;12.345.67.8 points to mail.example.com
We actually have a lot of domains pointing to that IP, but we should only specify one of them. Since many mail servers require RDNS for you to send mail to them, I had the mail domain assigned to the IP. We also need to change the NS records from:
@ NS ns1.basiczone.com.
@ NS ns2.basiczone.com.
To the name servers that host a reverse zone for this IP:
@ NS ns1.example.com.
@ NS ns2.example.com.
-- close 12.345.67.rev --
Now let's talk about how to manage the server.
start the server
Windows: Control Panel->Administrative Tools->Services->ISC BIND->Start
stop the server
Windows: Control Panel->Administrative Tools->Services->ISC BIND->Stop
DOS: %WINDIR%\SYSTEM32\dns\bin>rndc.exe stop
reload config
Windows: Control Panel->Administrative Tools->Services->ISC BIND->Restart
DOS: %WINDIR%\SYSTEM32\dns\bin>rndc.exe reload
If you try to start the server and it says the application terminated unexpectedly or something, check the error logs like this:
Windows: Control Panel->Administrative Tools->Event Viewer->Application Log
DOS: %WINDIR%\SYSTEM32\dns\bin>named.exe -g
If you did fail to start the server, it means named.conf has a syntax error someplace. Either try to figure it out yourself, or show me the logs using the DOS method.
Got the server start? excellent! Now let's test your configuration. I wrote a tool called "DNS Crawler" and it is a create way to test your dns server config remotely.
http://www.dollardns.net/cgi-bin/dnscrawler/index....
In the above URL, enter your IP in the "server" field. The domain you registered in the "name" field. And "AXFR" for the type. Press "submit query" and you'll see your entire zone if you didn't mess up someplace. If you got a "server failure" then you need to check out the logs to see why. "server failures" most commonly happen when you have a syntax error in your zone file.
The above test uses TCP port 53. We should also make sure that normal UDP queries also work. Make the same query except change the type to "ANY". That will display all records assigned to the root domain. (the ones that start with @ in your zone file).
Another great resource for checking the syntax of your domains is in the below link. Create a master or reverse zone, and change it up. It will tell you if you try to save a zone with syntax errors. There's also a DNS Crawler link to check the format of your zone.
DollarDNS Zone Manager
And by golly, I think I'm done with this tutorial.
Under Windows XP, %WINDIR% is 'C:\WINDOWS'
Under Windows NT/2K/2K3, %WINDIR% is 'C:\WINNT'
%WINDIR%\SYSTEM32\dns\bin
In this directory you have all of the BIND executeables. Here's a description of the executeables I'm going to bother mentioning:
named.exe - This is the BIND server program
rndc.exe - This program can be used to manage the server
named-checkzone.exe - This program can be used to check the syntax for zone files
named-checkconf.exe - This program can be used to check the syntax for config files
%WINDIR%\SYSTEM32\dns\etc
In this directory you have all the configuration files and zone files. Delete all the files you see in here. Then download my template BIND Config files to this directory. Ignore the "advanced" directory. Here's a description of the files:
named.conf - Tell bind what domains you are hosting - plus some extra config stuff.
rndc.key - This is the authentication key for rndc.exe to manage named.exe.
named.ca - These are the DNS root servers.
basiczone.com.zone - This is an example zone file.
127.0.0.rev - This is an example of a reverse IP zone file.
If you are the intuitive sort, reading the comments in these files should teach you all you need to know to get everything setup to your satisfaction. However, I'm going to assume you're still confused, so let's move on. The first thing we need to do is configure BIND to be the host of your domain. So crack open named.conf in notepad.
-- open named.conf --
First we need to tell BIND where our zone files are going to be stored. Currently it is set to this:
directory "/var/named";
That may be fine under linux, but we need to change it to this. Don't forget to replace %WINDIR% with the path to your windows directory.
directory "%WINDIR%\SYSTEM32\dns\etc";
Now let's pretend the domain you want to host on your server is called "example.com". Let's edit the file so that it is using our domain. Scroll all the way down to the end of the file. You will find this zone block:
zone "basiczone.com" IN {
type master;
file "basiczone.com.zone";
};
Seems pretty straight-forward. We are going to be the master of the domain, so the type is "master". It also provides the name of the file that stores information about the "basiczone.com" domain. Let's change that to this:
zone "example.com" IN {
type master;
file "example.com.zone";
};
Excellent, we are now the host of our very own example.com! The file "example.com.zone" that will be in our etc directory will take care of domain->IP resolutions, but we also need IP->domain resolution as well. So take a look at this other zone block:
zone "0.0.127.in-addr.arpa" {
type master;
file "127.0.0.rev";
};
Now we see why it's called a "reverse" zone. The IP address is reversed for resolution purposes to make it act like a domain. Now go to www.whatismyip.com and copy that IP address. I'm going to pretend that the IP is 12.345.67.8. Let's edit the zone block to say this:
zone "67.345.12.in-addr.arpa" {
type master;
file "12.345.67.rev";
};
Wondering why we aren't including the last number 8? It's because this demonstration is creating a reverse zone file for all the IP addresses that start with 12.345.67. In the zone file we'll configure which ending IPs are pointing to what.
-- close named.conf --
So now we're done configuring named.conf. We need to setup the domain and reverse ip zone files now. In your etc directory, make the following changes:
rename basiczone.com.zone to example.com.zone
rename 127.0.0.rev to 12.345.67.rev
Once again we're at a point where the dns server will run perfectly fine. However, our DNS info will be all wrong wrong wrong. So on to editing your example.com domain. We're assuming the following:
You registered ns1.example.com at your registrar with 12.345.67.8
You registered ns2.example.com at your registrar with 12.345.67.8
You specified the following servers as hosts for your domain at your registrar:
ns1.example.com
ns2.example.com
-- open example.com.zone --
There's a few confusing points about this file that you may be wondering about. A zone file is filled with "records". Each record takes a domain, and assign it to some piece of information. The file is also organized into columns. Here's a description of them:
Column1: The domain to assign the information
In the first column we have these values: @, ns1, ns2, www, mail. The '@' is a symbol for the name of our zone. That would be 'example.com' in this case. The other words are simply a shortcut for "ns1.example.com", "ns2.example.com", "Www.example.com", and "mail.example.com" respectively. BIND will add on the zone name when it reads the file.
Column2: The type of information we're assigning
In the second column we have these values: SOA, NS, MX, A. Just ignore the SOA record, it's required. The NS records are where we specify the names of the dns servers that host our domain. The MX record is where we assign the name of our email server for <mailbox>@example.com. And finally, the 'A' records is where we assign IP addresses to the domains.
Column3: The information data
This is what we're going to have to edit. The NS records are fine if you added "ns1.example.com" and "ns2.example.com" as hosts for your domain at your registrar. If not, you need to change the data values to the names of the dns servers you DID assign at your registrar. The MX record is also fine if you want "mail.example.com" to be your mail server. The 'A' records have got to change though. If you're hosting your own mail server and web server, change all the IPs to 12.345.67.8 (replace that with your real IP of course).
-- close example.com.zone --
All done with that. Let's move on to the reverse zone:
-- open 12.345.67.rev --
Things are a little bit different in this file. Notice that we've got some full domains. You are allowed to specify full domains in your zone files IF you have a period stuck on to the end of it. Always put that period on there if you DON'T want BIND to automatically append the zone name to the end of the domain. We also got a new record type called PTR. The PTR record is what you use to assign a domain to an IP. PTR records should only be located in reverse IP zones. In this zone we are assigning domains to 4 IP addresses. All 4 IPs begin with 12.345.67 since that is the name of our zone, and the last digit can be found in the first column. Delete all these records:
1 PTR ns1.basiczone.com.
2 PTR ns2.basiczone.com.
3 PTR mail.basiczone.com.
4 PTR www.basiczone.com.
In our demonstration we only have 1 IP, so let's make only 1 PTR record for the IP ending with 8.
8 PTR mail.example.com. ;12.345.67.8 points to mail.example.com
We actually have a lot of domains pointing to that IP, but we should only specify one of them. Since many mail servers require RDNS for you to send mail to them, I had the mail domain assigned to the IP. We also need to change the NS records from:
@ NS ns1.basiczone.com.
@ NS ns2.basiczone.com.
To the name servers that host a reverse zone for this IP:
@ NS ns1.example.com.
@ NS ns2.example.com.
-- close 12.345.67.rev --
Now let's talk about how to manage the server.
start the server
Windows: Control Panel->Administrative Tools->Services->ISC BIND->Start
stop the server
Windows: Control Panel->Administrative Tools->Services->ISC BIND->Stop
DOS: %WINDIR%\SYSTEM32\dns\bin>rndc.exe stop
reload config
Windows: Control Panel->Administrative Tools->Services->ISC BIND->Restart
DOS: %WINDIR%\SYSTEM32\dns\bin>rndc.exe reload
If you try to start the server and it says the application terminated unexpectedly or something, check the error logs like this:
Windows: Control Panel->Administrative Tools->Event Viewer->Application Log
DOS: %WINDIR%\SYSTEM32\dns\bin>named.exe -g
If you did fail to start the server, it means named.conf has a syntax error someplace. Either try to figure it out yourself, or show me the logs using the DOS method.
Got the server start? excellent! Now let's test your configuration. I wrote a tool called "DNS Crawler" and it is a create way to test your dns server config remotely.
http://www.dollardns.net/cgi-bin/dnscrawler/index....
In the above URL, enter your IP in the "server" field. The domain you registered in the "name" field. And "AXFR" for the type. Press "submit query" and you'll see your entire zone if you didn't mess up someplace. If you got a "server failure" then you need to check out the logs to see why. "server failures" most commonly happen when you have a syntax error in your zone file.
The above test uses TCP port 53. We should also make sure that normal UDP queries also work. Make the same query except change the type to "ANY". That will display all records assigned to the root domain. (the ones that start with @ in your zone file).
Another great resource for checking the syntax of your domains is in the below link. Create a master or reverse zone, and change it up. It will tell you if you try to save a zone with syntax errors. There's also a DNS Crawler link to check the format of your zone.
DollarDNS Zone Manager
And by golly, I think I'm done with this tutorial.
| ongod_yon | 上次訪問此網站﹕ 13-Dec-04 | |||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||
|
|
| ongod_yon | ||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||
|
|
|
2.2.1.2 Installing a Windows Binary Distribution
To install MySQL on Windows using a binary distribution, follow this procedure:
If you are working on a Windows NT, 2000, or XP machine, make sure that you have logged in as a user with administrator privileges.
If you are doing an upgrade of an earlier MySQL installation, it is necessary to stop the current server. On Windows NT, 2000, or XP machines, if you are running the server as a Windows service, stop it as follows from the command prompt:
C:\> NET STOP MySQL
If you plan to use a different server after the upgrade (for example, if you want to run mysqld-max rather than mysqld), remove the existing service:
C:\> C:\mysql\bin\mysqld --remove
You can reinstall the service to use the proper server after upgrading. If you are not running the MySQL server as a service, stop it like this:
C:\> C:\mysql\bin\mysqladmin -u root shutdown
Exit the WinMySQLAdmin program if it is running.
Unzip the distribution file to a temporary directory.
Run the setup.exe program to begin the installation process. If you want to install MySQL into a location other than the default directory (`C:\mysql'), use the Browse button to specify your preferred directory. If you do not install MySQL into the default location, you will need to specify the location whenever you start the server. The easiest way to do this is to use an option file, as described in section 2.2.1.3 Preparing the Windows MySQL Environment.
Finish the install process.
Important note: Early alpha Windows distributions for MySQL 4.1 do not contain an installer program. A 4.1 distribution is a Zip file that you just unzip in the location where you want to install MySQL. For example, to install `mysql-4.1.1-alpha-win.zip' as `C:\mysql', unzip the distribution file on the C: drive, then rename the resulting `mysql-4.1.1-alpha' directory to `mysql'.
If you are upgrading to MySQL 4.1 from an earlier version, you will want to preserve your existing `data' directory that contains the grant tables in the mysql database and your own databases. Before installing 4.1, stop the server if it is running, and save your `data' directory to another location. Then either rename the existing `C:\mysql' directory or remove it. Install 4.1 as described in the preceding paragraph, and then replace its `data' directory with your old `data' directory. This will avoid the loss of your current databases. Start the new server and update the grant tables. See section 2.5.8 Upgrading the Grant Tables.
Please see section 2.2.1.8 Troubleshooting a MySQL Installation Under Windows if you encounter difficulties during installation.
2.2.1.3 Preparing the Windows MySQL Environment
If you need to specify startup options when you run the server, you can indicate them on the command line or place them in an option file. For options that will be used every time the server starts, you will find it most convenient to use an option file to specify your MySQL configuration. This is true particularly under the following circumstances:
The installation or data directory locations are different from the default locations (`C:\mysql' and `C:\mysql\data').
You need to tune the server settings. For example, to use the InnoDB transactional tables in MySQL 3.23, you must manually add some extra lines to the option file, as described in section 16.4 InnoDB Configuration. (As of MySQL 4.0, InnoDB creates its data files and log files in the data directory by default. This means you need not configure InnoDB explicitly. You may still do so if you wish, and an option file will be useful in this case, too.)
On Windows, the MySQL installer places the data directory directly under the directory where you install MySQL. If you would like to use a data directory in a different location, you should copy the entire contents of the `data' directory to the new location. For example, by default, the installer places MySQL in `C:\mysql' and the data directory in `C:\mysql\data'. If you want to use a data directory of `E:\mydata', you must do two things:
Move the data directory from `C:\mysql\data' to `E:\mydata'.
Use a --datadir option to specify the new data directory location each time you start the server.
When the MySQL server starts on Windows, it looks for options in two files: the `my.ini' file in the Windows directory, and the `C:\my.cnf' file. The Windows directory typically is named something like `C:\WINDOWS' or `C:\WinNT'. You can determine its exact location from the value of the WINDIR environment variable using the following command:
C:\> echo %WINDIR%
MySQL looks for options first in the `my.ini' file, then in the `my.cnf' file. However, to avoid confusion, it's best if you use only one file. If your PC uses a boot loader where the C: drive isn't the boot drive, your only option is to use the `my.ini' file. Whichever option file you use, it must be a plain text file.
An option file can be created and modified with any text editor, such as the Notepad program. For example, if MySQL is installed at `E:\mysql' and the data directory is located at `E:\mydata\data', you can create the option file and set up a [mysqld] section to specify values for the basedir and datadir parameters:
[mysqld]
# set basedir to your installation path
basedir=E:/mysql
# set datadir to the location of your data directory
datadir=E:/mydata/data
Note that Windows pathnames are specified in option files using forward slashes rather than backslashes. If you do use backslashes, you must double them.
Another way to manage an option file is to use the WinMySQLAdmin tool. You can find WinMySQLAdmin in the `bin' directory of your MySQL installation, as well as a help file containing instructions for using it. WinMySQLAdmin has the capability of editing your option file, but note these points:
WinMySQLAdmin uses only the `my.ini' file.
If WinMySQLAdmin finds a `C:\my.cnf' file, it will in fact rename it to `C:\my_cnf.bak' to disable it.
Now you are ready to start the server.
2.2.1.4 Selecting a Windows Server
Starting with MySQL 3.23.38, the Windows distribution includes both the normal and the MySQL-Max server binaries.
Up through the early releases of MySQL 4.1, the servers included in Windows distributions are named like this:
Binary Description
mysqld Compiled with full debugging and automatic memory allocation checking, symbolic links, and InnoDB and BDB tables.
mysqld-opt Optimized binary. From version 4.0 on, InnoDB is enabled. Before 4.0, this server includes no transactional table support.
mysqld-nt Optimized binary for Windows NT, 2000, and XP with support for named pipes.
mysqld-max Optimized binary with support for symbolic links, and InnoDB and BDB tables.
mysqld-max-nt Like mysqld-max, but compiled with support for named pipes.
We have found that the server with the most generic name (mysqld) is the one that many users are likely to choose by default. However, that is also the server that results in the highest memory and CPU use due to the inclusion of full debugging support. The server named mysqld-opt is a better general-use server choice to make instead if you don't need debugging suport and don't want the maximal feature set offered by the -max servers or named pipe support offered by the -nt servers.
To make it less likely that the debugging server would be chosen inadvertantly, some name changes were made from MySQL 4.1.2 to 4.1.4: mysqld has been renamed to mysqld-debug and mysqld-opt has been renamed to mysqld. Thus, the server that includes debugging support indicates that in its name, and the server named mysqld is an efficient default choice. The other servers still have their same names. The resulting servers are named like this:
Binary Description
mysqld-debug Compiled with full debugging and automatic memory allocation checking, symbolic links, and InnoDB and BDB tables.
mysqld Optimized binary with InnoDB support.
mysqld-nt Optimized binary for Windows NT, 2000, and XP with support for named pipes.
mysqld-max Optimized binary with support for symbolic links, and InnoDB and BDB tables.
mysqld-max-nt Like mysqld-max, but compiled with support for named pipes.
The name changes were not both instituted at the same time. If you have MySQL 4.1.2 or 4.1.3, it might be that you have a server named mysqld-debug but not one named mysqld. In this case, you should have have a server mysqld-opt, which you should choose as your default server unless you need maximal features, named pipes, or debugging support.
All of the preceding binaries are optimized for modern Intel processors, but should work on any Intel i386-class or higher processor.
MySQL supports TCP/IP on all Windows platforms. The mysqld-nt and mysql-max-nt servers support named pipes on NT, 2000, and XP. However, the default is to use TCP/IP regardless of the platform. (Named pipes are slower than TCP/IP in many Windows configurations.) Named pipe use is subject to these conditions:
Starting from MySQL 3.23.50, named pipes are enabled only if you start the server with the --enable-named-pipe option. It is now necessary to use this option explicitly because some users have experienced problems shutting down the MySQL server when named pipes were used.
Named pipe connections are allowed only by the mysqld-nt or mysqld-max-nt servers, and only if the server is run on a version of Windows that supports named pipes (NT, 2000, XP).
These servers can be run on Windows 98 or Me, but only if TCP/IP is installed; named pipe connections cannot be used.
On Windows 95, these servers cannot be used.
Note: Most of the examples in the following sections use mysqld as the server name. If you choose to use a different server, such as mysqld-opt, make the appropriate substitutions in the commands that are shown in the examples. One good reason to choose a different server is that because mysqld contains full debugging support, it uses more memory and runs slower than the other Windows servers.
2.2.1.5 Starting the Server for the First Time
On Windows 95, 98, or Me, MySQL clients always connect to the server using TCP/IP. (This will allow any machine on your network to connect to your MySQL server.) Because of this, you must make sure that TCP/IP support is installed on your machine before starting MySQL. You can find TCP/IP on your Windows CD-ROM.
Note that if you are using an old Windows 95 release (for example, OSR2), it's likely that you have an old Winsock package; MySQL requires Winsock 2! You can get the newest Winsock from http://www.microsoft.com/. Windows 98 has the new Winsock 2 library, so it is unnecessary to update the library.
On NT-based systems such as Windows NT, 2000, or XP, clients have two options. They can use TCP/IP, or they can use a named pipe if the server supports named pipe connections.
In MySQL 4.1 and up, Windows servers also support shared-memory connections if started with the --shared-memory option. Clients can connect this way by using the --protocol=memory option.
For information about which server binary to run, see section 2.2.1.4 Selecting a Windows Server.
This section gives a general overview of starting the MySQL server. The following sections provide more specific information for particular versions of Windows.
The examples in these sections assume that MySQL is installed under the default location of `C:\mysql'. Adjust the pathnames shown in the examples if you have MySQL installed in a different location.
Testing is best done from a command prompt in a console window (a ``DOS window''). This way you can have the server display status messages in the window where they are easy to see. If something is wrong with your configuration, these messages will make it easier for you to identify and fix any problems.
To start the server, enter this command:
C:\> C:\mysql\bin\mysqld --console
For servers that include InnoDB support, you should see the following messages as the server starts:
InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist:
InnoDB: a new database to be created!
InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200
InnoDB: Database physically writes the file full: wait...
InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280
InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280
InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be created
InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: creating foreign key constraint system tables
InnoDB: foreign key constraint system tables created
011024 10:58:25 InnoDB: Started
When the server finishes its startup sequence, you should see something like this, which indicates that the server is ready to service client connections:
mysqld: ready for connections
Version: '4.0.14-log' socket: '' port: 3306
The server will continue to write to the console any further diagnostic output it produces. You can open a new console window in which to run client programs.
If you omit the --console option, the server writes diagnostic output to the error log in the data directory (`C:\mysql\data' by default). The error log is the file with the `.err' extension.
Note: The accounts that are listed in the MySQL grant tables initially have no passwords. After starting the server, you should set up passwords for them using the instructions in section 2.4 Post-Installation Setup and Testing.
2.2.1.6 Starting MySQL from the Windows Command Line
The MySQL server can be started manually from the command line. This can be done on any version of Windows.
To start the mysqld server from the command line, you should start a console window (a ``DOS window'') and enter this command:
C:\> C:\mysql\bin\mysqld
On non-NT versions of Windows, this will start mysqld in the background. That is, after the server starts, you should see another command prompt. If you start the server this way on Windows NT, 2000, or XP, the server will run in the foreground and no command prompt will appear until the server exits. Because of this, you should open another console window to run client programs while the server is running.
You can stop the MySQL server by executing this command:
C:\> C:\mysql\bin\mysqladmin -u root shutdown
This invokes the MySQL administrative utility mysqladmin to connect to the server and tell it to shut down. The command connects as root, which is the default administrative account in the MySQL grant system. Note that users in the MySQL grant system are wholly independent from any login users under Windows.
If mysqld doesn't start, check the error log to see whether the server wrote any messages there to indicate the cause of the problem. The error log is located in the `C:\mysql\data' directory. It is the file with a suffix of `.err'. You can also try to start the server as mysqld --console; in this case, you may get some useful information on the screen that may help solve the problem.
The last option is to start mysqld with --standalone --debug. In this case, mysqld will write a log file `C:\mysqld.trace' that should contain the reason why mysqld doesn't start. See section D.1.2 Creating Trace Files.
Use mysqld --help to display all the options that mysqld understands!
2.2.1.7 Starting MySQL as a Windows Service
On the NT family (Windows NT, 2000, or XP), the recommended way to run MySQL is to install it as a Windows service. Then Windows starts and stops the MySQL server automatically when Windows starts and stops. A server installed as a service can also be controlled from the command line using NET commands, or with the graphical Services utility.
The Services utility (the Windows Service Control Manager) can be found in the Windows Control Panel (under Administrative Tools on Windows 2000 or XP). It is advisable to close the Services utility while performing server installation or removal operations from this command line. This prevents some odd errors.
To get MySQL to work with TCP/IP on Windows NT 4, you must install service pack 3 (or newer).
Before installing MySQL as a Windows service, you should first stop the current server if it is running by using the following command:
C:\> C:\mysql\bin\mysqladmin -u root shutdown
This invokes the MySQL administrative utility mysqladmin to connect to the server and tell it to shut down. The command connects as root, which is the default administrative account in the MySQL grant system. Note that users in the MySQL grant system are wholly independent from any login users under Windows.
Now install the server as a service:
C:\> mysqld --install
If you have problems installing mysqld as a service using just the server name, try installing it using its full pathname:
C:\> C:\mysql\bin\mysqld --install
As of MySQL 4.0.2, you can specify a specific service name after the --install option. As of MySQL 4.0.3, you can in addition specify a --defaults-file option after the service name to indicate where the server should obtain options when it starts. The rules that determine the service name and option files the server uses are as follows:
If you specify no service name, the server uses the default service name of MySQL and the server reads options from the [mysqld] group in the standard option files.
If you specify a service name after the --install option, the server ignores the [mysqld] option group and instead reads options from the group that has the same name as the service. The server reads options from the standard option files.
If you specify a --defaults-file option after the service name, the server ignores the standard option files and reads options only from the [mysqld] group of the named file.
Note: Prior to MySQL 4.0.17, a server installed as a Windows service has problems starting if its pathname or the service name contains spaces. For this reason, avoid installing MySQL in a directory such as `C:\Program Files' or using a service name containing spaces.
In the usual case that you install the server with --install but no service name, the server is installed with a service name of MySQL.
As a more complex example, consider the following command:
C:\> C:\mysql\bin\mysqld --install mysql --defaults-file=C:\my-opts.cnf
Here, a service name is given after the --install option. If no --defaults-file option had been given, this command would have the effect of causing the server to read the [mysql] group from the standard option files. (This would be a bad idea, because that option group is for use by the mysql client program.) However, because the --defaults-file option is present, the server reads options only from the named file, and only from the [mysqld] option group.
You can also specify options as ``Start parameters'' in the Windows Services utility before you start the MySQL service.
Once a MySQL server is installed as a service, Windows will start the service automatically whenever Windows starts. The service also can be started immediately from the Services utility, or by using the command NET START MySQL. The NET command is not case sensitive.
When run as a service, mysqld has no access to a console window, so no messages can be seen there. If mysqld doesn't start, check the error log to see whether the server wrote any messages there to indicate the cause of the problem. The error log is located in the `C:\mysql\data' directory. It is the file with a suffix of `.err'.
When mysqld is running as a service, it can be stopped by using the Services utility, the command NET STOP MySQL, or the command mysqladmin shutdown. If the service is running when Windows shuts down, Windows will stop the server automatically.
From MySQL 3.23.44 on, you have the choice of installing the server as a Manual service if you don't wish the service to be started automatically during the boot process. To do this, use the --install-manual option rather than the --install option:
C:\> C:\mysql\bin\mysqld --install-manual
To remove a server that is installed as a service, first stop it if it is running. Then use the --remove option to remove it:
C:\> C:\mysql\bin\mysqld --remove
For MySQL versions older than 3.23.49, one problem with automatic MySQL service shutdown is that Windows waited only for a few seconds for the shutdown to complete, then killed the database server process if the time limit was exceeded. This had the potential to cause problems. (For example, the InnoDB storage engine had to perform crash recovery at the next startup.) Starting from MySQL 3.23.49, Windows waits longer for the MySQL server shutdown to complete. If you notice this still is not enough for your installation, it is safest not to run the MySQL server as a service. Instead, start it from the command-line prompt, and stop it with mysqladmin shutdown.
This change to tell Windows to wait longer when stopping the MySQL server works for Windows 2000 and XP. It does not work for Windows NT, where Windows waits only 20 seconds for a service to shut down, and after that kills the service process. You can increase this default by opening the Registry Editor `\winnt\system32\regedt32.exe' and editing the value of WaitToKillServiceTimeout at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control in the Registry tree. Specify the new larger value in milliseconds. For example, the value 120000 tells Windows NT to wait up to 120 seconds.
If you don't want to start mysqld as a service, you can start it from the command line. For instructions, see section 2.2.1.6 Starting MySQL from the Windows Command Line.
Please see section 2.2.1.8 Troubleshooting a MySQL Installation Under Windows if you encounter difficulties during installation.
2.2.1.8 Troubleshooting a MySQL Installation Under Windows
When installing and running MySQL for the first time, you may encounter certain errors that prevent the MySQL server from starting. The purpose of this section is to help you diagnose and correct some of these errors.
Your first resource when troubleshooting server issues is the error log. The MySQL server uses the error log to record information relevant to the error that is preventing the server from starting. The error log is located in the data directory specified in your `my.ini' file. The default data directory location is `C:\mysql\data'. See section 5.9.1 The Error Log.
Another source of information regarding possible errors is the console messages displayed when the MySQL service is starting. Use the NET START mysql command from the command line after installing mysqld as a service to see any error messages regarding the starting of the MySQL server as a service. See section 2.2.1.7 Starting MySQL as a Windows Service.
The following are examples of some of the more common error messages you may encounter when installing MySQL and starting the server for the first time:
System error 1067 has occurred.
Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't exist
These messages occur when the MySQL server cannot find the mysql privileges database or other critical files. This error is often encountered when the MySQL base or data directories are installed in different locations than the default locations (`C:\mysql' and `C:\mysql\data', respectively).
If you have installed MySQL to a directory other than `C:\mysql' you will need to ensure that the MySQL server is aware of this through the use of a configuration (my.ini) file. The my.ini file needs to be located in your Windows directory, typically located at `C:\WinNT' or `C:\WINDOWS'. You can determine its exact location from the value of the WINDIR environment variable by issuing the following command from the command prompt:
C:\> echo %WINDIR%
An option file can be created and modified with any text editor, such as the Notepad program. For example, if MySQL is installed at `E:\mysql' and the data directory is located at `D:\MySQLdata', you can create the option file and set up a [mysqld] section to specify values for the basedir and datadir parameters:
[mysqld]
# set basedir to your installation path
basedir=E:/mysql
# set datadir to the location of your data directory
datadir=D:/MySQLdata
Note that Windows pathnames are specified in option files using forward slashes rather than backslashes. If you do use backslashes, you must double them:
[mysqld]
# set basedir to your installation path
basedir=C:\\Program Files\\mysql
# set datadir to the location of your data directory
datadir=D:\\MySQLdata
See section 2.2.1.3 Preparing the Windows MySQL Environment.
2.2.1.9 Running MySQL Client Programs on Windows
You can test whether the MySQL server is working by executing any of the following commands:
C:\> C:\mysql\bin\mysqlshow
C:\> C:\mysql\bin\mysqlshow -u root mysql
C:\> C:\mysql\bin\mysqladmin version status proc
C:\> C:\mysql\bin\mysql test
If mysqld is slow to respond to TCP/IP connections from client programs on Windows 9x/Me, there is probably a problem with your DNS. In this case, start mysqld with the --skip-name-resolve option and use only localhost and IP numbers in the Host column of the MySQL grant tables.
You can force a MySQL client to use a named pipe connection rather than TCP/IP by specifying the --pipe option or by specifying . (period) as the host name. Use the --socket option to specify the name of the pipe. As of MySQL 4.1, you should use the --protocol=PIPE option.
There are two versions of the MySQL command-line tool: Binary Description
mysql Compiled on native Windows, offering limited text editing capabilities.
mysqlc Compiled with the Cygnus GNU compiler and libraries, which offers readline editing.
If you want to use mysqlc, you must have a copy of the `cygwinb19.dll' library installed somewhere that mysqlc can find it. Current distributions of MySQL include this library in the same directory as mysqlc (the `bin' directory under the base directory of your MySQL installation). If your distribution does not have the cygwinb19.dll library in the `bin' directory, look for it in the lib directory and copy it to your Windows system directory (`\Windows\system' or a similar place).
2.2.1.10 MySQL on Windows Compared to MySQL on Unix
MySQL for Windows has by now proven itself to be very stable. The Windows version of MySQL has the same features as the corresponding Unix version, with the following exceptions:
Windows 95 and threads
Windows 95 leaks about 200 bytes of main memory for each thread creation. Each connection in MySQL creates a new thread, so you shouldn't run mysqld for an extended time on Windows 95 if your server handles many connections! Other versions of Windows don't suffer from this bug.
Limited number of ports
Windows systems have about 4,000 ports available for client connections, and after a connection on a port closes, it takes two to four minutes before the port can be reused. In situations where clients connect to and disconnect from the server at a high rate, it is possible for all available ports to be used up before closed ports become available again. If this happens, the MySQL server will appear to have become unresponsive even though it is running. Note that ports may be used by other applications running on the machine as well, in which case the number of ports available to MySQL is lower. For more information, see http://support.microsoft.com/default.aspx?scid=kb;...
Concurrent reads
MySQL depends on the pread() and pwrite() calls to be able to mix INSERT and SELECT. Currently we use mutexes to emulate pread()/pwrite(). We will, in the long run, replace the file level interface with a virtual interface so that we can use the readfile()/writefile() interface on NT, 2000, and XP to get more speed. The current implementation limits the number of open files MySQL can use to 2,048 (1,024 before MySQL 4.0.19), which means that you will not be able to run as many concurrent threads on NT, 2000, and XP as on Unix.
Blocking read
MySQL uses a blocking read for each connection, which has the following implications if named pipe connections are enabled:
A connection will not be disconnected automatically after eight hours, as happens with the Unix version of MySQL.
If a connection hangs, it's impossible to break it without killing MySQL.
mysqladmin kill will not work on a sleeping connection.
mysqladmin shutdown can't abort as long as there are sleeping connections.
We plan to fix this problem when our Windows developers have figured out a nice workaround.
ALTER TABLE
While you are executing an ALTER TABLE statement, the table is locked from being used by other threads. This has to do with the fact that on Windows, you can't delete a file that is in use by another thread. In the future, we may find some way to work around this problem.
DROP TABLE
DROP TABLE on a table that is in use by a MERGE table will not work on Windows because the MERGE handler does the table mapping hidden from the upper layer of MySQL. Because Windows doesn't allow you to drop files that are open, you first must flush all MERGE tables (with FLUSH TABLES) or drop the MERGE table before dropping the table. We will fix this at the same time we introduce views.
DATA DIRECTORY and INDEX DIRECTORY
The DATA DIRECTORY and INDEX DIRECTORY options for CREATE TABLE are ignored on Windows, because Windows doesn't support symbolic links. These options also are ignored on systems that have a non-functional realpath() call.
DROP DATABASE
You cannot drop a database that is in use by some thread.
Killing MySQL from the Task Manager
You cannot kill MySQL from the Task Manager or with the shutdown utility in Windows 95. You must take it down with mysqladmin shutdown.
Case-insensitive names
Filenames are not case sensitive on Windows, so MySQL database and table names are also not case sensitive on Windows. The only restriction is that database and table names must be specified using the same case throughout a given statement. See section 10.2.2 Identifier Case Sensitivity.
The `\' pathname separator character
Pathname components in Windows 95 are separated by the `\' character, which is also the escape character in MySQL. If you are using LOAD DATA INFILE or SELECT ... INTO OUTFILE, use Unix-style filenames with `/' characters:
mysql> LOAD DATA INFILE 'C:/tmp/skr.txt' INTO TABLE skr;
mysql> SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr;
Alternatively, you must double the `\' character:
mysql> LOAD DATA INFILE 'C:\\tmp\\skr.txt' INTO TABLE skr;
mysql> SELECT * INTO OUTFILE 'C:\\tmp\\skr.txt' FROM skr;
Problems with pipes.
Pipes do not work reliably from the Windows command-line prompt. If the pipe includes the character ^Z / CHAR(24), Windows will think it has encountered end-of-file and abort the program. This is mainly a problem when you try to apply a binary log as follows:
C:\> mysqlbinlog binary-log-name | mysql --user=root
If you have a problem applying the log and suspect that it is because of a ^Z / CHAR(24) character, you can use the following workaround:
C:\> mysqlbinlog binary-log-file --result-file=/tmp/bin.sql
C:\> mysql --user=root --execute "source /tmp/bin.sql"
The latter command also can be used to reliably read in any SQL file that may contain binary data.
Can't open named pipe error
If you use a MySQL 3.22 server on Windows NT with the newest MySQL client programs, you will get the following error:
error 2017: can't open named pipe to host: . pipe...
This happens because the release version of MySQL uses named pipes on NT by default. You can avoid this error by using the --host=localhost option to the new MySQL clients or by creating an option file `C:\my.cnf' that contains the following information:
[client]
host = localhost
Starting from 3.23.50, named pipes are enabled only if mysqld-nt or mysqld-max-nt is started with --enable-named-pipe.
Access denied for user error
If you attempt to run a MySQL client program to connect to a server running on the same machine, but get the error Access denied for user 'some-user'@'unknown' to database 'mysql', this means that MySQL cannot resolve your hostname properly. To fix this, you should create a file named `\windows\hosts' containing the following information:
127.0.0.1 localhost
Here are some open issues for anyone who might want to help us improve MySQL on Windows:
Add some nice start and shutdown icons to the MySQL installation.
It would be really nice to be able to kill mysqld from the Task Manager in Windows 95. For the moment, you must use mysqladmin shutdown.
Port readline to Windows for use in the mysql command-line tool.
GUI versions of the standard MySQL clients (mysql, mysqlshow, mysqladmin, and mysqldump) would be nice.
It would be nice if the socket read and write functions in `net.c' were interruptible. This would make it possible to kill open threads with mysqladmin kill on Windows.
Add macros to use the faster thread-safe increment/decrement methods provided by Windows.
i have seen these good software. Share ...
http://www.pablovandermeer.nl/index.html
Quick Easy FTP Server 2.4.2
Quick ’n Easy FTP Server 2.4.2
Quick 'n Easy FTP Server is a multi threaded FTP server for Windows 98/NT/XP that can be easily setup even by inexperienced users.
New users can be easily created by an wizard who is guiding you step by step in the process.
The server handles all basic FTP commands plus a lot of special FTP commands like MDTM, NLST, FEAT and many more!
Key features:
- Simple, intuitive and cool looking user interface, with several pages for managing the users, configuration and security.
- Easy to setup using the build-in FTP Server Setup Wizard.
- Add new user accounts with the User Account Wizard.
- Security: Allow/block specific ip addresses/ranges.
- Support for virtual directories.
- Limit download/upload speed per user.
- Support for systems that are a part of a network with a router and/or firewall.
- Configuration is saved in XML format.
- Realtime server trace, which displays every command and it’s reply on the screen.
- Everything can also be logged to a file.
- Users can send messages via their FTP client to the FTP Server’s messages console .
- Integrated upload/download statistics (saved in XML).
- Remote administration option.
- Disk quota
Frequently Asked Questions:
Click here for Frequently Asked Questions (FAQ) about Quick ‘n Easy FTP Server.
What’s New?
June 10, 2004 (version 2.1)
- Fixed: Problems with UI/thread synchronisation could cause exceptions
- Fixed: Sometimes the security mode was not saved between sessions.
- Added: Support for files larger than 2 GB (64 bits).
- Added: 'Allow Directory Browse' option in User Accounts.
- Added: FTP Server setup wizard, to quickly configure the server.
- Added: Help information for router/firewall owners.
June 12, 2004 (version 2.11a)
- Fixed: Invalid USERS.XML (virtual directory order) could cause corrupted User Accounts.
- Fixed: View and Clear button on Configuration page.
- Fixed: When skinned scrollbar was active, a large number of user accounts made the user list disappear...
June 20, 2004 (version 2.12)
- Fixed: TaskPane bug (deleting collapsed items could cause an exception).
- Fixed: Compatibility with Win9x/NT4 issues.
July 2, 2004 (version 2.14)
- Fixed: Compatibility issues with CuteFTP Clients (and probably some other FTP clients
- Added: Tray Icon tooltip now shows number of online users.
July 10, 2004 (version 2.2)
- Fixed: Allow directory listing is now also available in remote administration commands.
- Fixed: Virtual directory did not show 'List' option in UI.
- Fixed: Virtual directory problems when mapped to root drive.
- Fixed: If 'Getting IP from remote server' failed, PASV mode did get 'confused'.
- Fixed: TaskPane now uses Windows Color Scheme when XP-look is disabled.
- Added: Improved Remote administration command documentation (in help file).
August 10, 2004 (version 2.3)
- Fixed: GetPeerName failure could result in stability problems.
- Fixed: Problems with corrupt XML files (improved XML character encoding).
- Added: External changes to USERS.XML and SECURITY.XML can now be reloaded using the commandline option: /c
September 5, 2004 (version 2.4)
- Added: Disk quota(amount of uploaded bytes) to limit users disk space: when users deletes file(s) the value is decreased again.
- Added: File Types Filter, to edit the displayed file types for the LIST command.
October 5, 2004 (version 2.4.1)
- Fixed: MFC's GetLength64() did not report correct file size in LIST command.
- Fixed: Kick user did not work correctly for downloads.
- Fixed: Transfer progress is now only displayed for downloads, since it's not possible to determine the status for uploads.
- Fixed: Slightly changed error/exception handling.
October 28, 2004 (version 2.4.2)
- Fixed: Some buggy firewalls could screw up socket handles when accepting new connections. The server can now 'detect' problems with incompatible firewalls (it might still crash, but at least you know why).
Read whatsnew.txt for more details
http://www.pablovandermeer.nl/index.html
Quick Easy FTP Server 2.4.2
Quick ’n Easy FTP Server 2.4.2
Quick 'n Easy FTP Server is a multi threaded FTP server for Windows 98/NT/XP that can be easily setup even by inexperienced users.
New users can be easily created by an wizard who is guiding you step by step in the process.
The server handles all basic FTP commands plus a lot of special FTP commands like MDTM, NLST, FEAT and many more!
Key features:
- Simple, intuitive and cool looking user interface, with several pages for managing the users, configuration and security.
- Easy to setup using the build-in FTP Server Setup Wizard.
- Add new user accounts with the User Account Wizard.
- Security: Allow/block specific ip addresses/ranges.
- Support for virtual directories.
- Limit download/upload speed per user.
- Support for systems that are a part of a network with a router and/or firewall.
- Configuration is saved in XML format.
- Realtime server trace, which displays every command and it’s reply on the screen.
- Everything can also be logged to a file.
- Users can send messages via their FTP client to the FTP Server’s messages console .
- Integrated upload/download statistics (saved in XML).
- Remote administration option.
- Disk quota
Frequently Asked Questions:
Click here for Frequently Asked Questions (FAQ) about Quick ‘n Easy FTP Server.
What’s New?
June 10, 2004 (version 2.1)
- Fixed: Problems with UI/thread synchronisation could cause exceptions
- Fixed: Sometimes the security mode was not saved between sessions.
- Added: Support for files larger than 2 GB (64 bits).
- Added: 'Allow Directory Browse' option in User Accounts.
- Added: FTP Server setup wizard, to quickly configure the server.
- Added: Help information for router/firewall owners.
June 12, 2004 (version 2.11a)
- Fixed: Invalid USERS.XML (virtual directory order) could cause corrupted User Accounts.
- Fixed: View and Clear button on Configuration page.
- Fixed: When skinned scrollbar was active, a large number of user accounts made the user list disappear...
June 20, 2004 (version 2.12)
- Fixed: TaskPane bug (deleting collapsed items could cause an exception).
- Fixed: Compatibility with Win9x/NT4 issues.
July 2, 2004 (version 2.14)
- Fixed: Compatibility issues with CuteFTP Clients (and probably some other FTP clients
- Added: Tray Icon tooltip now shows number of online users.
July 10, 2004 (version 2.2)
- Fixed: Allow directory listing is now also available in remote administration commands.
- Fixed: Virtual directory did not show 'List' option in UI.
- Fixed: Virtual directory problems when mapped to root drive.
- Fixed: If 'Getting IP from remote server' failed, PASV mode did get 'confused'.
- Fixed: TaskPane now uses Windows Color Scheme when XP-look is disabled.
- Added: Improved Remote administration command documentation (in help file).
August 10, 2004 (version 2.3)
- Fixed: GetPeerName failure could result in stability problems.
- Fixed: Problems with corrupt XML files (improved XML character encoding).
- Added: External changes to USERS.XML and SECURITY.XML can now be reloaded using the commandline option: /c
September 5, 2004 (version 2.4)
- Added: Disk quota(amount of uploaded bytes) to limit users disk space: when users deletes file(s) the value is decreased again.
- Added: File Types Filter, to edit the displayed file types for the LIST command.
October 5, 2004 (version 2.4.1)
- Fixed: MFC's GetLength64() did not report correct file size in LIST command.
- Fixed: Kick user did not work correctly for downloads.
- Fixed: Transfer progress is now only displayed for downloads, since it's not possible to determine the status for uploads.
- Fixed: Slightly changed error/exception handling.
October 28, 2004 (version 2.4.2)
- Fixed: Some buggy firewalls could screw up socket handles when accepting new connections. The server can now 'detect' problems with incompatible firewalls (it might still crash, but at least you know why).
Read whatsnew.txt for more details
在“阅读全文”的前面加个图片
2005年1月26日17:08星期三 [生活]
昨天yang问我怎么在阅读全文的前面加个图片,我告诉他把图片加到main.htm里面的{ seereply }前面就可以了,后来他提醒我日志写得短的话就不显示阅读全文了,但是图片还显示。
后来又以为是main.php,看了看没有。今天突然想到blog的界面可以中英文切换的,于是打开了语言文件看了一下,原来可以对main.lang.php动手脚的。
打开main.lang.php在里面的“阅读全文”前加上“<img src=图片地址 align=absmiddle>”就可以了。
我把图片加上了,但是有的模板很正常显示,有的在图片周围有个紫色的小框。怎么回事啊?
比如:blogger模板:http://www.liuyangonline.com/blog/index.php?tem=bl...
apple模板:http://www.liuyangonline.com/blog/index.php?tem=ap...
闪给你看 回复于 2005年1月27日16:52
在那个模板的css中加上img { border:0; }试试。
2005年1月26日17:08星期三 [生活]
昨天yang问我怎么在阅读全文的前面加个图片,我告诉他把图片加到main.htm里面的{ seereply }前面就可以了,后来他提醒我日志写得短的话就不显示阅读全文了,但是图片还显示。
后来又以为是main.php,看了看没有。今天突然想到blog的界面可以中英文切换的,于是打开了语言文件看了一下,原来可以对main.lang.php动手脚的。
打开main.lang.php在里面的“阅读全文”前加上“<img src=图片地址 align=absmiddle>”就可以了。
我把图片加上了,但是有的模板很正常显示,有的在图片周围有个紫色的小框。怎么回事啊?
比如:blogger模板:http://www.liuyangonline.com/blog/index.php?tem=bl...
apple模板:http://www.liuyangonline.com/blog/index.php?tem=ap...
闪给你看 回复于 2005年1月27日16:52
在那个模板的css中加上img { border:0; }试试。
Windows 2003平台下Apache2.0.49+PHP4.3.6+MySQL4.0.18+PhpMyadmin2.5.6+JK2.0.4+J2S
DK1.4.2_4+Tomcat5.0.19完全整合方法
flyfox
首先从internet上下载以上所有软件包
以下是下载地址:
Apache http://httpd.apache.org/
PHP:http://www.php.net/
MySQL:http://dev.mysql.com/downloads/
PhpMyadmin:http://sourceforge.net/projects/phpmyadmin/
J2SDK:http://java.sun.com/j2ee/download.html
Tomcat:http://apache.linuxforum.net/dist/jakarta/tomcat-5...
JK2:http://apache.linuxforum.net/dis ... ctors/jk2/binaries/
注意以上软件包,如果有的选择的应该选用windows平台下的。
安装和配置步骤:
1. 先装Apache,按缺省安装即可(假设安装到D:\Aache2),测试方法在浏览器中输入
2. 解开PHP zip包至D:\PHP,然后将该目录下的php.ini-dist 拷贝到系统%WINDOWS%(一般是C:\windows)目录,然后改名为php.ini,编辑该文件,搜索"doc_root",将该行改成: doc_root = "d:\webroot" ; 搜索"extension_dir"将该行改成:
extension_dir = "d:\php" (假设PHP安装目录为D:\PHP,假设web文档放在D:\webroot)
将D:\PHP下的php4ts.dll和D:\php\sapi\下的php4apache2.dll拷贝到系统%SYSTEMROOT%\System32目录下
(一般是C:\windows\system32),为了保险起见,可以将D:\php\sapi\和D:\php\dlls\
目录下的所有文件都拷贝到%SYSTEMROOT%\System32目录下。
3. 编辑设置D:\Apache2\conf\httpd.conf文件(编辑前关掉Apache服务),加入以下几行:
###Add surport to PHP script document
LoadModule php4_module D:/php/sapi/php4apache2.dll
AddType application/x-httpd-php .php .php3
找到AddDefaultCharset ISO-8859-1这行,在前面加个#号注释掉。然后在下边添加
AddDefaultCharset GB2312
DefaultLanguage GB2312
AddLanguage zh-cn .cn
这是设置APACHE2对中文支持。
4. 安装MySQL,按缺省安装即可,假设安装在D:\MySQL下,运行D:\mysql\bin\winmysqlad
min.exe,会在系统 %WINDOWS%目录下生成my.ini,检查C:\windows目录下是否存在该文件,如果不存在创建并编辑成如下样子:
#This File was made using the WinMySQLAdmin 1.4 Tool
#2003-12-15 17:53:46
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
[mysqld]
basedir=D:/mysql
#bind-address=10.10.10.10
datadir=D:/mysql/data
#language=D:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
[WinMySQLAdmin]
Server=D:/mysql/bin/mysqld-nt.exe
5. 解压缩PhpMyadmin软件包至D:/webroot/phpmyadmin,编辑D:\Apache2\conf\httpd.conf文件(编辑前关掉Apache服务),
在文件最后加上几行:
NameVirtualHost 127.0.0.1
DocumentRoot "d:/webroot/phpMyAdmin"
Options ExecCGI
Order allow,deny
Allow from All
DirectoryIndex index.php index.php3 index.htm index.html
6. 重新开启Apache服务,现在在浏览器输入http://127.0.0.1,此时应该进入了PhpMyadmin管理界面,选择Language为
Chinese Simplified (zh),点击进入“权限”设置,将用户“任意,%,否,ALL
PRIVILEGES ”用户删除,给两个root用户设置密码。
7. 然后编辑D:\Webroot\phpMyAdmin\config.inc.php,搜索"$cfg['PmaAbsoluteUri']",
将其修改成: $cfg['PmaAbsoluteUri'] = 'http://127.0.0.1;
搜索“$cfg['Servers'][$i]['auth_type'] = 'config';”,将其修改成:
$cfg['Servers'][$i]['auth_type'] = 'http';
8. 重新在浏览器输入http://127.0.0.1,此时应该进入了PhpMyadmin登录界面,要求提供用户名和密码,输入root,密码为刚才你修改的。至此Windows 2003平台下Apache2.0.49+PHP4.3.6+MySQL4.0.18+PhpMyadmin2.5.6的整合已经完成了。
9. 安装J2SDK1.4.2_04,可以不用安装demo和sourece,假设安装至C:\j2sdk1.4.2_04。然
后配置环境变量:在我的电脑上点击鼠标
右键-属性-点选高级-点选环境变量,弹出环境变量对话框,新建以下变量名和值:
变量名:path
变量值:.;C:\j2sdk1.4.2_04\bin; C:\j2sdk1.4.2_04
变量名:JAVA_HOME
变量值:C:\j2sdk1.4.2_04
变量名:CLASSPATH
变量值: .;C:\j2sdk1.4.2_04\lib\tools.jar;C:\j2sdk1.4.2_04\lib\dt.jar;C:\j2sdk1.4.2_04\jre\lib\ext
重新启动计算机使配置的环境变量生效
10.安装Tomcat,按缺省值安装,假设安装至D:\Tomcat,安装要求设置用户名和密码,自己设置。
启动TOMCAT服务,在浏览器输入http://127.0.0.1:8080
应该能看到Tomcat的欢迎界面,表示安装成功,
运行各种Examples,检查其对JSP和Servlet等的支持,虽然TOMCAT有内置的HTTP服务,
但是它仅仅对JSP程序体现出比较好的执行效率和性能,对于静态页面的处理速度远不如APACHE,所以为了一个完美的WEB系统,我们要将APACHE和TOMCAT集成在一起!
(下面就是集成他们的具体配置步骤,请注意仔细认真,比较繁琐)。
11. 将下载的jakarta-tomcat-connectors-jk2.0.4-win32-apache2.0.49.zip解包,将其中modules目录下的mod_jk2.so拷贝至
D:\Apache2\modules\下,然后编辑D:\Apache2\conf\httpd.conf文件(编辑前关掉Apache服务),加入以下几行:
### Add surport to jsp with the jk2 mod connector to tomcat
LoadModule jk2_module modules/mod_jk2.so
12. 现在假设我们要发布的web文件要放在D:\webroot下,不同的虚拟站点用不同的目录,总站点: http://www.example.com 对应IP 10.10.10.10 对应目录D:\webroot\WWW
总站点别名:10.10.10.10 对应IP 10.10.10.10 对应目录D:\webroot\WWW
IT部门: surport.example.com对应IP 10.10.10.10 对应目录D:\webroot\surport
PhpMyadmin:对应IP 127.0.0.1对应目录D:\webroot\phpmyadmin
13.设置jk2的tomcat方配置,编辑D:\Tomcat\conf\jk2.properties文件(编辑前关掉Tomcat服务),使其如下:
## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED
## WHEN YOU EDIT THE FILE.
## COMMENTS WILL BE _LOST_
## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.
# Set the desired handler list
handler.list=apr,request,channelJni
#
# Override the default port for the socketChannel
channelSocket.port=8019
# Default:
channelUnix.file=${jkHome}/work/jk2.socket
# Just to check if the the config is working
shm.file=${jkHome}/work/jk2.shm
# In order to enable jni use any channelJni directive
channelJni.disabled = 0
# And one of the following directives:
apr.jniModeSo=d:/apache2/modules/mod_jk2.so
# If set to inprocess the mod_jk2 will Register natives itself
# This will enable the starting of the Tomcat from mod_jk2
apr.jniModeSo=inprocess
14.设置jk2的Apache方配置,在D:\Apache2\conf目录下创建workers2.properties并编辑
如下:
[shm]
file=${serverRoot}/logs/shm.file
size=1048576
# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
# define the worker
[ajp13:localhost:8019]
channel=channel.socket:localhost:8009
# Uri mapping
[uri:www.example.com/*.jsp]
worker=ajp13:localhost:8009
[uri:surport.example.com/*.jsp]
worker=ajp13:localhost:8009
[uri:10.10.10.10/*.jsp]
worker=ajp13:localhost:8009
[uri:127.0.0.1/*.jsp]
worker=ajp13:localhost:8009
15.设置Tomcat的虚拟站点,编辑D:\Tomcat\conf\server.xml(编辑前关掉Tomcat服务),
搜索
修改成
搜索 在这行上面加入以下几行:
16.配置Apache的虚拟站点,编辑D:\Apache2\conf\httpd.conf文件(编辑前关掉Apache服务)
在文件最后加上:
NameVirtualHost 10.10.10.10
DocumentRoot "/webroot/www"
ServerName http://www.example.com
Options ExecCGI
Order allow,deny
Allow from All
DirectoryIndex index.jsp index.php index.php3 index.htm index.html
DocumentRoot "/webroot/www"
ServerName 10.10.10.10
Options ExecCGI
Order allow,deny
Allow from All
DirectoryIndex index.jsp index.php index.php3 index.htm index.html
DocumentRoot "/webroot/surport"
ServerName surport.example.com
Options ExecCGI
Order allow,deny
Allow from All
DirectoryIndex index.jsp index.php index.php3 index.htm index.html
17.重新启动tomcat和apache服务测试配置。在D:\webroot\www和D:\webroot\surport下放
一个test.php和一个test.jsp
其中test.php内容如下:
test.jsp内容如下:
测试过程如下:在浏览器中输入http://127.0.0.1应该进入phpmyadmin的登录界面
输入http://127.0.0.1:8080应该进入Tomcat欢迎界面
输入http://www.example.com/test.php应该显示php环境信息
输入http://www.example.com/test.jsp应该显示“4”
输入http://10.10.10.10/test.php应该显示php环境信息
输入http://10.10.10.10/test.jsp应该显示“4”
输入http://surport.example.com/test.php应该显示php环境信息
输入http://surport.example.com/test.jsp应该显示“4”
18.如果以上测试均成功的话,现在请删掉test.php和test.jsp,在要发布的目录里放上您要发布的文件。
安装Apache2及相关建议路径
准备:
操作系统瘟到死2千>
去www.apache.org下载Apache2>
去www.activestate.com下载perl5.6>
去www.php.net下载PHP4.3>
去www.mysql.com下载mysql4>
去www.sourceforge.net下载phpmyadmin
空出一个盘来,例如:L:
目录结构如下:
/对应L:\
先建立目录
/usr
/usr/local
/usr/local/tmp
/www
/www/default
/www/default/cgi-bin
安装Apache2,路径为/usr/local
安装perl,路径为/usr
安装php,把php的目录拷贝到/usr/local/php
安装mysql,路径为/usr/local/mysql
安装phpmyadmin,路径为/usr/local/Apache2/htdocs/phpMyAdmin
配置:
编辑/usr/local/Apache2/conf/httpd.conf
查找LoadModule foo_module
另起一行添加
LoadModule php4_module /usr/local/php/sapi/php4apache2.dll
PHPINIDir /usr/local/php/php.ini
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
Alias /phpMyAdmin /usr/local/Apache2/htdocs/phpMyAdmin
查找ServerName开头的一行
修改为
ServerName localhost #要是自己有了域名localhost修改为自己的域名
查找DocumentRoot开头的一行
修改为
DocumentRoot /www/default
AllowOverride None
Order allow,deny
Allow from all
查找DirectoryIndex开头的一行
修改为
DirectoryIndex index.htm index.html index.php index.php3 index.php4
查找ScriptAlias开头的一行
修改为:
ScriptAlias /cgi-bin/ "/www/default/cgi-bin"
AllowOverride None
Options None
Order allow,deny
Allow from all
把/usr/local/Apache2/cgi-bin里面的文件拷贝到/www/default/cgi-bin
编辑/usr/local/php/php.ini,要是没有救复制php.ini-dist为php.ini
include_path = ".;./;/usr/local/php/includes/"
extension_dir = "/usr/local/php/extensions/"
upload_tmp_dir = /usr/local/tmp
session.save_path=/usr/local/tmp
然后到开始 控制面板 管理工具 服务
重新启动mysql和apache2
然后这样子啦
写
phpinfo();
?>
到/www/default/index.php
然后访问
http://localhost
现在可以看到php的相关信息了
访问http://localhost/phpMyAdmin
进入mysql->user,浏览,删除开头不是为 localhost root的项目
访问
http://localhost/cgi-bin/test.cgi
现在可以看到cgi的信息了
好了,什么都好了,等有一天你觉得瘟到死原来这么这么差劲的时候,你会发现,移植起来也是很方便的事情哦。
?php>
DK1.4.2_4+Tomcat5.0.19完全整合方法
flyfox
首先从internet上下载以上所有软件包
以下是下载地址:
Apache http://httpd.apache.org/
PHP:http://www.php.net/
MySQL:http://dev.mysql.com/downloads/
PhpMyadmin:http://sourceforge.net/projects/phpmyadmin/
J2SDK:http://java.sun.com/j2ee/download.html
Tomcat:http://apache.linuxforum.net/dist/jakarta/tomcat-5...
JK2:http://apache.linuxforum.net/dis ... ctors/jk2/binaries/
注意以上软件包,如果有的选择的应该选用windows平台下的。
安装和配置步骤:
1. 先装Apache,按缺省安装即可(假设安装到D:\Aache2),测试方法在浏览器中输入
2. 解开PHP zip包至D:\PHP,然后将该目录下的php.ini-dist 拷贝到系统%WINDOWS%(一般是C:\windows)目录,然后改名为php.ini,编辑该文件,搜索"doc_root",将该行改成: doc_root = "d:\webroot" ; 搜索"extension_dir"将该行改成:
extension_dir = "d:\php" (假设PHP安装目录为D:\PHP,假设web文档放在D:\webroot)
将D:\PHP下的php4ts.dll和D:\php\sapi\下的php4apache2.dll拷贝到系统%SYSTEMROOT%\System32目录下
(一般是C:\windows\system32),为了保险起见,可以将D:\php\sapi\和D:\php\dlls\
目录下的所有文件都拷贝到%SYSTEMROOT%\System32目录下。
3. 编辑设置D:\Apache2\conf\httpd.conf文件(编辑前关掉Apache服务),加入以下几行:
###Add surport to PHP script document
LoadModule php4_module D:/php/sapi/php4apache2.dll
AddType application/x-httpd-php .php .php3
找到AddDefaultCharset ISO-8859-1这行,在前面加个#号注释掉。然后在下边添加
AddDefaultCharset GB2312
DefaultLanguage GB2312
AddLanguage zh-cn .cn
这是设置APACHE2对中文支持。
4. 安装MySQL,按缺省安装即可,假设安装在D:\MySQL下,运行D:\mysql\bin\winmysqlad
min.exe,会在系统 %WINDOWS%目录下生成my.ini,检查C:\windows目录下是否存在该文件,如果不存在创建并编辑成如下样子:
#This File was made using the WinMySQLAdmin 1.4 Tool
#2003-12-15 17:53:46
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
[mysqld]
basedir=D:/mysql
#bind-address=10.10.10.10
datadir=D:/mysql/data
#language=D:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
[WinMySQLAdmin]
Server=D:/mysql/bin/mysqld-nt.exe
5. 解压缩PhpMyadmin软件包至D:/webroot/phpmyadmin,编辑D:\Apache2\conf\httpd.conf文件(编辑前关掉Apache服务),
在文件最后加上几行:
NameVirtualHost 127.0.0.1
DocumentRoot "d:/webroot/phpMyAdmin"
Options ExecCGI
Order allow,deny
Allow from All
DirectoryIndex index.php index.php3 index.htm index.html
6. 重新开启Apache服务,现在在浏览器输入http://127.0.0.1,此时应该进入了PhpMyadmin管理界面,选择Language为
Chinese Simplified (zh),点击进入“权限”设置,将用户“任意,%,否,ALL
PRIVILEGES ”用户删除,给两个root用户设置密码。
7. 然后编辑D:\Webroot\phpMyAdmin\config.inc.php,搜索"$cfg['PmaAbsoluteUri']",
将其修改成: $cfg['PmaAbsoluteUri'] = 'http://127.0.0.1;
搜索“$cfg['Servers'][$i]['auth_type'] = 'config';”,将其修改成:
$cfg['Servers'][$i]['auth_type'] = 'http';
8. 重新在浏览器输入http://127.0.0.1,此时应该进入了PhpMyadmin登录界面,要求提供用户名和密码,输入root,密码为刚才你修改的。至此Windows 2003平台下Apache2.0.49+PHP4.3.6+MySQL4.0.18+PhpMyadmin2.5.6的整合已经完成了。
9. 安装J2SDK1.4.2_04,可以不用安装demo和sourece,假设安装至C:\j2sdk1.4.2_04。然
后配置环境变量:在我的电脑上点击鼠标
右键-属性-点选高级-点选环境变量,弹出环境变量对话框,新建以下变量名和值:
变量名:path
变量值:.;C:\j2sdk1.4.2_04\bin; C:\j2sdk1.4.2_04
变量名:JAVA_HOME
变量值:C:\j2sdk1.4.2_04
变量名:CLASSPATH
变量值: .;C:\j2sdk1.4.2_04\lib\tools.jar;C:\j2sdk1.4.2_04\lib\dt.jar;C:\j2sdk1.4.2_04\jre\lib\ext
重新启动计算机使配置的环境变量生效
10.安装Tomcat,按缺省值安装,假设安装至D:\Tomcat,安装要求设置用户名和密码,自己设置。
启动TOMCAT服务,在浏览器输入http://127.0.0.1:8080
应该能看到Tomcat的欢迎界面,表示安装成功,
运行各种Examples,检查其对JSP和Servlet等的支持,虽然TOMCAT有内置的HTTP服务,
但是它仅仅对JSP程序体现出比较好的执行效率和性能,对于静态页面的处理速度远不如APACHE,所以为了一个完美的WEB系统,我们要将APACHE和TOMCAT集成在一起!
(下面就是集成他们的具体配置步骤,请注意仔细认真,比较繁琐)。
11. 将下载的jakarta-tomcat-connectors-jk2.0.4-win32-apache2.0.49.zip解包,将其中modules目录下的mod_jk2.so拷贝至
D:\Apache2\modules\下,然后编辑D:\Apache2\conf\httpd.conf文件(编辑前关掉Apache服务),加入以下几行:
### Add surport to jsp with the jk2 mod connector to tomcat
LoadModule jk2_module modules/mod_jk2.so
12. 现在假设我们要发布的web文件要放在D:\webroot下,不同的虚拟站点用不同的目录,总站点: http://www.example.com 对应IP 10.10.10.10 对应目录D:\webroot\WWW
总站点别名:10.10.10.10 对应IP 10.10.10.10 对应目录D:\webroot\WWW
IT部门: surport.example.com对应IP 10.10.10.10 对应目录D:\webroot\surport
PhpMyadmin:对应IP 127.0.0.1对应目录D:\webroot\phpmyadmin
13.设置jk2的tomcat方配置,编辑D:\Tomcat\conf\jk2.properties文件(编辑前关掉Tomcat服务),使其如下:
## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED
## WHEN YOU EDIT THE FILE.
## COMMENTS WILL BE _LOST_
## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.
# Set the desired handler list
handler.list=apr,request,channelJni
#
# Override the default port for the socketChannel
channelSocket.port=8019
# Default:
channelUnix.file=${jkHome}/work/jk2.socket
# Just to check if the the config is working
shm.file=${jkHome}/work/jk2.shm
# In order to enable jni use any channelJni directive
channelJni.disabled = 0
# And one of the following directives:
apr.jniModeSo=d:/apache2/modules/mod_jk2.so
# If set to inprocess the mod_jk2 will Register natives itself
# This will enable the starting of the Tomcat from mod_jk2
apr.jniModeSo=inprocess
14.设置jk2的Apache方配置,在D:\Apache2\conf目录下创建workers2.properties并编辑
如下:
[shm]
file=${serverRoot}/logs/shm.file
size=1048576
# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
# define the worker
[ajp13:localhost:8019]
channel=channel.socket:localhost:8009
# Uri mapping
[uri:www.example.com/*.jsp]
worker=ajp13:localhost:8009
[uri:surport.example.com/*.jsp]
worker=ajp13:localhost:8009
[uri:10.10.10.10/*.jsp]
worker=ajp13:localhost:8009
[uri:127.0.0.1/*.jsp]
worker=ajp13:localhost:8009
15.设置Tomcat的虚拟站点,编辑D:\Tomcat\conf\server.xml(编辑前关掉Tomcat服务),
搜索
修改成
搜索
16.配置Apache的虚拟站点,编辑D:\Apache2\conf\httpd.conf文件(编辑前关掉Apache服务)
在文件最后加上:
NameVirtualHost 10.10.10.10
DocumentRoot "/webroot/www"
ServerName http://www.example.com
Options ExecCGI
Order allow,deny
Allow from All
DirectoryIndex index.jsp index.php index.php3 index.htm index.html
DocumentRoot "/webroot/www"
ServerName 10.10.10.10
Options ExecCGI
Order allow,deny
Allow from All
DirectoryIndex index.jsp index.php index.php3 index.htm index.html
DocumentRoot "/webroot/surport"
ServerName surport.example.com
Options ExecCGI
Order allow,deny
Allow from All
DirectoryIndex index.jsp index.php index.php3 index.htm index.html
17.重新启动tomcat和apache服务测试配置。在D:\webroot\www和D:\webroot\surport下放
一个test.php和一个test.jsp
其中test.php内容如下:
test.jsp内容如下:
测试过程如下:在浏览器中输入http://127.0.0.1应该进入phpmyadmin的登录界面
输入http://127.0.0.1:8080应该进入Tomcat欢迎界面
输入http://www.example.com/test.php应该显示php环境信息
输入http://www.example.com/test.jsp应该显示“4”
输入http://10.10.10.10/test.php应该显示php环境信息
输入http://10.10.10.10/test.jsp应该显示“4”
输入http://surport.example.com/test.php应该显示php环境信息
输入http://surport.example.com/test.jsp应该显示“4”
18.如果以上测试均成功的话,现在请删掉test.php和test.jsp,在要发布的目录里放上您要发布的文件。
安装Apache2及相关建议路径
准备:
操作系统瘟到死2千>
去www.apache.org下载Apache2>
去www.activestate.com下载perl5.6>
去www.php.net下载PHP4.3>
去www.mysql.com下载mysql4>
去www.sourceforge.net下载phpmyadmin
空出一个盘来,例如:L:
目录结构如下:
/对应L:\
先建立目录
/usr
/usr/local
/usr/local/tmp
/www
/www/default
/www/default/cgi-bin
安装Apache2,路径为/usr/local
安装perl,路径为/usr
安装php,把php的目录拷贝到/usr/local/php
安装mysql,路径为/usr/local/mysql
安装phpmyadmin,路径为/usr/local/Apache2/htdocs/phpMyAdmin
配置:
编辑/usr/local/Apache2/conf/httpd.conf
查找LoadModule foo_module
另起一行添加
LoadModule php4_module /usr/local/php/sapi/php4apache2.dll
PHPINIDir /usr/local/php/php.ini
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
Alias /phpMyAdmin /usr/local/Apache2/htdocs/phpMyAdmin
查找ServerName开头的一行
修改为
ServerName localhost #要是自己有了域名localhost修改为自己的域名
查找DocumentRoot开头的一行
修改为
DocumentRoot /www/default
AllowOverride None
Order allow,deny
Allow from all
查找DirectoryIndex开头的一行
修改为
DirectoryIndex index.htm index.html index.php index.php3 index.php4
查找ScriptAlias开头的一行
修改为:
ScriptAlias /cgi-bin/ "/www/default/cgi-bin"
AllowOverride None
Options None
Order allow,deny
Allow from all
把/usr/local/Apache2/cgi-bin里面的文件拷贝到/www/default/cgi-bin
编辑/usr/local/php/php.ini,要是没有救复制php.ini-dist为php.ini
include_path = ".;./;/usr/local/php/includes/"
extension_dir = "/usr/local/php/extensions/"
upload_tmp_dir = /usr/local/tmp
session.save_path=/usr/local/tmp
然后到开始 控制面板 管理工具 服务
重新启动mysql和apache2
然后这样子啦
写
phpinfo();
?>
到/www/default/index.php
然后访问
http://localhost
现在可以看到php的相关信息了
访问http://localhost/phpMyAdmin
进入mysql->user,浏览,删除开头不是为 localhost root的项目
访问
http://localhost/cgi-bin/test.cgi
现在可以看到cgi的信息了
好了,什么都好了,等有一天你觉得瘟到死原来这么这么差劲的时候,你会发现,移植起来也是很方便的事情哦。
?php>
经常看到大家问一些相同的或者以前已经多次解答的问题。所以,我将这些问题整理了一些出来供大家参考。
Q:为什么我的ASP页面到windows2003后就不能执行了,执行ASPX正常。
A:windows2003中默认没有启用ASP支持,在IIS的Web Service Extensions里找到Active Server Pages,将ALLOW选上,就可以了。
Q:我的IIS只要asp文件有错,就显示HTTP500错误,但是却不显示出错的详细信息。以前能够显示究竟是那个文件的那一行出错,但现在却不显示。
A:在IE的Internet选项中选高级,选中“显示友好的HTTP错误”即可。
Q:在Windows XP家庭版如何安装IIS?
A:windows XP家庭版不能安装IIS,请升级到专业版。
Q:为何我访问本机地址要求输入用户和密码?
A:将IIS设置中匿名帐号权限打开。再则检查所在目录的NTFS权限。
Q:我的ASP文件包含文件的时候提示Active Server Pages 错误 'ASP 0131'不允许的父路径,如何解决?
A:在站点属性中选择主目录-配置-应用程序选项,将“启用父目录”选上。
Q:为何我的IIS老是当机?
A:1、检查你设置的脚本超时时间,不能过长。2、检查你的程序是否有对象和连接没有关闭。3、依次停止各个用户的服务,看看是不是有耗大资源的用户程序。
Q:win200 server+iis,为什么在网页上,有的中文htm链接路径可以显示,有的不行?
A:'转换双字节字符为合法的URL传输字串
function getUrlEncodel(byVal Url)
Dim i,code
getUrlEncodel=""
if trim(Url)="" then exit function
for i=1 to len(Url)
code=Asc(mid(Url,i,1))
If code<0 Then code = code + 65536
If code>255 Then
getUrlEncodel=getUrlEncodel&"%"&Left(Hex(Code),2)&"%"&Right(Hex(Code),2)
else
getUrlEncodel=getUrlEncodel&mid(Url,i,1)
end if
next
end function
Q:IIS 所有的exe文件从上面的目录都不能下载,显示404 文件找不到 是什么原因?还是哪里设置错误?
A:设置一下http头--MIME类型,新建一个类型扩展名为EXE,类型为:application/octet-stream
Q:在管理工具中找不到IIS了。
A:在C:\WINDOWS\system32\inetsrv中找到快捷方式重新建立。
Q:IIS无法支持ASP了,重启N次都不行。
A:在应用程序程序配置中检查.asp文件是不是已经映射到C:\WINDOWS\system32\inetsrv\asp.dll。若无,则添加。
0>
Q:为什么我的ASP页面到windows2003后就不能执行了,执行ASPX正常。
A:windows2003中默认没有启用ASP支持,在IIS的Web Service Extensions里找到Active Server Pages,将ALLOW选上,就可以了。
Q:我的IIS只要asp文件有错,就显示HTTP500错误,但是却不显示出错的详细信息。以前能够显示究竟是那个文件的那一行出错,但现在却不显示。
A:在IE的Internet选项中选高级,选中“显示友好的HTTP错误”即可。
Q:在Windows XP家庭版如何安装IIS?
A:windows XP家庭版不能安装IIS,请升级到专业版。
Q:为何我访问本机地址要求输入用户和密码?
A:将IIS设置中匿名帐号权限打开。再则检查所在目录的NTFS权限。
Q:我的ASP文件包含文件的时候提示Active Server Pages 错误 'ASP 0131'不允许的父路径,如何解决?
A:在站点属性中选择主目录-配置-应用程序选项,将“启用父目录”选上。
Q:为何我的IIS老是当机?
A:1、检查你设置的脚本超时时间,不能过长。2、检查你的程序是否有对象和连接没有关闭。3、依次停止各个用户的服务,看看是不是有耗大资源的用户程序。
Q:win200 server+iis,为什么在网页上,有的中文htm链接路径可以显示,有的不行?
A:'转换双字节字符为合法的URL传输字串
function getUrlEncodel(byVal Url)
Dim i,code
getUrlEncodel=""
if trim(Url)="" then exit function
for i=1 to len(Url)
code=Asc(mid(Url,i,1))
If code<0 Then code = code + 65536
If code>255 Then
getUrlEncodel=getUrlEncodel&"%"&Left(Hex(Code),2)&"%"&Right(Hex(Code),2)
else
getUrlEncodel=getUrlEncodel&mid(Url,i,1)
end if
next
end function
Q:IIS 所有的exe文件从上面的目录都不能下载,显示404 文件找不到 是什么原因?还是哪里设置错误?
A:设置一下http头--MIME类型,新建一个类型扩展名为EXE,类型为:application/octet-stream
Q:在管理工具中找不到IIS了。
A:在C:\WINDOWS\system32\inetsrv中找到快捷方式重新建立。
Q:IIS无法支持ASP了,重启N次都不行。
A:在应用程序程序配置中检查.asp文件是不是已经映射到C:\WINDOWS\system32\inetsrv\asp.dll。若无,则添加。
0>
在IIS中建立隐藏的虚拟目录
打开iis的管理器--选定一个文件夹--右建--资源管理器,到网站的根目录,新建一个文件夹这里取名为free,我们到winnt\system32那里新建一个文件夹取名homepage,回到iis的管理器刷新就会看到,free这个目录。
选中他右键--新建---虚拟目录,给这个虚拟目录取名axin,把这个虚拟目录指向winnt\system32\homepage,建立完成。
现在放个首页进去,打开浏览器http://ip/free/axin应该可以正常浏览!!好了别管他,打开我的电脑找到网站的根目录删掉free这个文件夹,再回到浏览器刷新看看,晕倒,网页依然存在,回到iis的管理器刷新看看,free这个目录没有了。
打开iis的管理器--选定一个文件夹--右建--资源管理器,到网站的根目录,新建一个文件夹这里取名为free,我们到winnt\system32那里新建一个文件夹取名homepage,回到iis的管理器刷新就会看到,free这个目录。
选中他右键--新建---虚拟目录,给这个虚拟目录取名axin,把这个虚拟目录指向winnt\system32\homepage,建立完成。
现在放个首页进去,打开浏览器http://ip/free/axin应该可以正常浏览!!好了别管他,打开我的电脑找到网站的根目录删掉free这个文件夹,再回到浏览器刷新看看,晕倒,网页依然存在,回到iis的管理器刷新看看,free这个目录没有了。






