1.Windows XP 2. apache 2.0.59 下载的包:apache_2.0.59-win32-x86-no_ssl.msi3. Sun Java System Active Server Pages 4.0.2 (不支持apache2.2) 下载地址: http://www.sun.com/download/products.xml?id=420a8e72 在安装Sun One Asp过程中. 在指定httpd.conf要进行配置时,如果无法获取httpd.conf文件,有两种可能: a. 你的apache版本不是Sun One Asp所支持的; b. 可能你的httpd.conf里的ServerName要改成 ServerName 你的服务器IP:804. 安装完后基本上可以运行asp了,别忘了在httpd.conf里的DirectoryIndex加上asp(添加主页索引)5. 修改注册表,允许父路径 Sun One asp不支持父路径的解决方法: 打开注册表:把[HKEY_LOCAL_MACHINE/SOFTWARE/ChiliSoft/chiliasp/Parameters下的EnableParentPaths的值0改为1,重启一下apache就行了(如果不行,就重启服务器吧)。以下问题就是因为Sun One asp默认不支持父路径************************************************Active Server Pages error 'ASP 0131 : 80004005′Disallowed Parent PathXXXXX.asp, line XXThe Include file '../XXXX.htm' cannot contain '..' to indicate the parent directory.************************************************
6. 但在response.redirect时会无法动作(只是不会转向到指定的网页..不会产生错误)此时..在response.redirect叙述前加上Response.Status = "302 Object Moved"
另附:
讓Apache Web Server 也能解譯ASP程式
有下列幾種:
要付費:(30天試用期)SUN的ChiliSoft ASP:Sun ONE Active Server Pages v3.6.2 (每部主機要美金 $495)iASP:STRYON提供的 InstantASP (授權金 ? )
免費:OpenAsp:原始下載網站為 http://www.activescripting.org/html/download.html,不過依據網路上的文獻,好像自1999年就關站了。又,根據其說明文件,此元件只能支援Apache Server的版本 1.3.0 到 1.3.6。
安裝 OpenAsp:(以版本 Apache 1.3.27 示範) / 下載 apasp.dll 元件壓縮檔
1.將下載的元件 apasp.DLL 複製於硬碟上任一地方。(建議在/Apache Group/Apache/modules,可統一管理)
2.編輯httpd.conf:由『開始』-『程式集』-『Apache HTTP Server』-『Configure Apache Server』-『Edit the Apache httpd.conf Configuration File』;或直接進入『/Apache Group/Apache/conf』編輯。
3.尋找『mime.types』,除了原有的AddType application/x-tar .tgz 及 AddType image/x-icon .ico 外,再加上 AddType text/x-asp asp 這一行。
4.在此設定檔的最下面一行,加上 LoadModule asp_module modules/apasp.dll (此dll檔存放的位置)
5.將Apache Server重新 restart:開始』-『程式集』-『Apache HTTP Server』-『Control Apache Server』-『Restart』
6.接下來就可以開始來測試了。利用文字編輯器編寫程式:<%=now %> ,並存在/Apache Group/Apache/htdocs(預設的web root)成 test.asp
7.在瀏覽器網址列輸入:http://127.0.0.1/test.asp
8.成功。
9.OpenAsp的限制:由於這個模組仍屬測試版,故部份物件與方法不支援。茲將原始說明文件提到的限制,條列如下:
ObjectContext No
Request 物件
Request.ClientCertificate NoRequest.QueryString YesRequest.Form YesRequest.Cookies YesRequest.ServerVariables YesRequest.TotalBytes NoRequest.BinaryRead No
Response 物件
Response.Buffer YesResponse.CacheControl NoResponse.Charset NoResponse.ContentType YesResponse.Expires YesResponse.ExpiresAbsolute No (almost supported)Response.IsClientConnected NoResponse.Pics NoResponse.Status NoResponse.AddHeader YesResponse.AppendToLog YesResponse.BinaryWrite YesResponse.Clear YesResponse.End YesResponse.Flush YesResponse.Redirect YesResponse.Write Yes
Server 物件
Server.CreateObject YesServer.HTMLEncode YesServer.MapPath YesServer.ScriptTimeout NoServer.URLEncode Yes
session 物件
Session YesSession.Abandon YesSession.CodePage NoSession.Contents YesSession.LCID NoSession.SessionID YesSession.StaticObjects NoSession.Timeout YesSession_OnStart YesSession_OnEnd No
Application 物件
Application YesApplication.Contents YesApplication.Lock YesApplication.Unlock YesApplication.StaticObjects NoApplication_OnStart YesApplication_OnEnd No
Standard Base Components No
---------------Global.asa 不支援---------------