//
you're reading...
ASP Classic, IT-Center, Oracle, Web Based

First ASP Classic Code : How to Install IIS 6.0 and Create Virtual Directory

A. Installing IIS (IIS 6.0)
_____________________

This topic describes 3 methods for installing IIS:

Using the Configure Your Server Wizard.
Using Add or Remove Programs from Control Panel.
Using unattended setup.

This topic also lists the directories created on install, describes the IIS initial configuration backup, and briefly describes IIS optional components.

  Important

To help minimize the attack surface of the server, IIS 6.0 is not installed on Windows Server 2003 by default. When you first install IIS 6.0, it is locked down — which means that only request handling for static Web pages is enabled, and only the World Wide Web Publishing Service (WWW service) is installed. None of the features that sit on top of IIS are turned on, including ASP, ASP.NET, CGI scripting, FrontPage® 2002 Server Extensions from Microsoft, and WebDAV publishing. If you do not enable these features, IIS returns a 404 error. You can enable these features through the Web Services Extensions node in IIS Manager. For more information about how to troubleshoot 404 errors and other issues, see Troubleshooting in IIS 6.0.

Microsoft strongly recommends installing IIS on an NTFS-formatted drive. NTFS is a more powerful and secure file system than FAT and FAT32. For more information, see Securing Files with NTFS Permissions.

  Important

You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName “mmc systemroot\system32\inetsrv\iis.msc”.

Procedures

To install IIS using the Configure Your Server Wizard

1. From the Start menu, click Manage Your Server.
2. Under Managing Your Server Roles, click Add or remove a role.
3. Read the preliminary steps in the Configure Your Server Wizard and click Next.
4. Under Server Role, click Application server (IIS, ASP.NET) and then click Next.By default, the wizard installs and enables IIS, COM+, and DTC.
5. If you want to serve either of the optional technologies (FrontPage Server Extensions or ASP.NET), on the Application Server Options page, select the appropriate check boxes, and then click Next.
6. Read the summary and click Next.
7. Complete the wizard, and then click Finish.

  Note

The Configure Your Server Wizard enables ASP.NET by default, unlike the Add/Remove Windows components install method below.

For more information on the Configure Your Server Wizard, see “Configuring Your Server Wizard” in Windows Help.

To install IIS, add components, or remove components using Control Panel

1. From the Start menu, click Control Panel.
2. Double-click Add or Remove Programs.
3. Click Add/Remove Windows Components.
4. In the Components list box, click Application Server.
5. Click Details.
6. Click Internet Information Services Manager.
7. Click Details to view the list of IIS optional components. For a detailed description of IIS optional components, see “Optional Components” in this topic.
8. Select all optional components you wish to install.

  Note

The World Wide Web PublishingService optional component includes important subcomponents like the Active Server Pages component and Remote Administration (HTML). To view and select these subcomponents, click World Wide Web Publishing Service and then click Details.

1. Click OK until you are returned to the Windows Component Wizard.
2. Click Next and complete the Windows Component Wizard.

Unattended Setup

To simplify the process of setting up IIS on multiple computers running a member of the Windows Server 2003 family, you can run setup unattended. To do this, create and use an answer file, which is a customized script that automatically answers the setup questions.

For information on how to create an answer file and to view a table of all IIS unattended setup parameters, see Appendix E: Unattended Setup.

Top of pageTop of page

IIS Directories

IIS installs the following directories:

\InetPub
systemroot\Help\IISHelp
systemroot\System32\InetSrv
systemroot\System32\InetSrv\MetaBack

These directories contain user content and cannot be moved. You can, however, select the location of your Wwwroot and Ftproot directories at installation by using a script during unattended setup. If you uninstall IIS, the IISHelp directory is removed. The InetPub and InetSrv directories remain on your computer.

B. INSTALLING ASP CLASSIC IN IIS
______________________________________________________

To enable ASP pages
1. In IIS Manager  (go start menu  > run >, type with cmd command “inetmgr”),  expand the local computer, and then click Web Service Extensions.
2. In the details pane, click Active Server Pages, and then click Allow

C. VIRTUAL DIRECTORY
______________________________________________________

Follow one of the procedures that are described in How to: Open IIS Manager topic to open IIS Manager. You can then create a virtual directory.

To create a virtual directory by using IIS Manager

  1. In IIS Manager, expand the local computer and the Web site to which you want to add a virtual directory.
  2. Right-click the site or folder in which you want to create the virtual directory, click New, and then click Virtual Directory.
  3. In the Virtual Directory Creation Wizard, click Next.
  4. In the Alias box, type a name for the virtual directory and then click Next. Choose a short name that is easy to type, because users type this name to access the Web site.
  5. In the Path box, type or browse to the physical directory that contains the virtual directory, and then click Next.You can select an existing folder or create a new one to contain the content for the virtual directory.
  6. Select the check boxes for the access permissions that you want to assign to the users.By default, the Read and Run Scripts check boxes are selected. These permissions enable you to run ASP.NET pages for many common scenarios. For more information, see the next section in this topic.
  7. Click Next and then click Finish.

After creating a new virtual directory, you can configure security and authentication for the virtual directory. When you configure security, you specify permissions for an account or group. The following table shows the permissions settings that are available in IIS 5.0, IIS 5.1, and IIS 6.0.

Account or Group Permissions
An account or group that is allowed to browse the site if you disabled anonymous authentication when you created the virtual directory. Read & Execute
The account that is configured to access system resources for the ASP.NET current user context, such as the Network Service account (IIS 6.0) or the ASPNET account (IIS 5.0 and 5.1). Read & ExecuteList Folder Contents

Read

Write

To configure security and authentication for a virtual directory

  1. In IIS Manager, right-click node for the virtual directory that you want to configure, and then click Properties.
  2. Click the Directory Security tab, and then in the Authentication and access control section, click Edit.
  3. Select the check box for the authentication method or methods that you want to use for your virtual directory, and then click OK. By default, the Enable anonymous access and Windows Integrated Authentication check boxes are already selected.The two most common authentication scenarios are as follows:
    • Windows Integrated authentication for a local intranet site.
    • Forms authentication for an Internet or extranet site where users access the site through a firewall.

    To configure authentication for an Internet site, you must configure forms authentication. For more information about authentication options, see ASP.NET Authentication. For a walkthrough that describes how to create a site using Forms authentication, see How to: Implement Simple Forms Authentication.

  4. To configure authentication for an intranet or local development scenario, clear the Enable Anonymous access check box, and make sure that the Integrated Windows authentication check box is selected.
  5. In Windows Explorer, open the parent folder of the folder that will contain the pages for the site. Right-click the folder and then click Sharing and Security.The Properties dialog box for the folder is displayed.
  6. Click the Security tab.
  7. In the Group or user names list, select a group or user name.
    Note Note
    To add a new group or user name, click Add, and then click the Locations button. Select the local computer name from the list and then click OK. Then type the account name that you want to add into the text box. After typing the name, click Check Names to verify the account name. Click OK to add the account.
  8. In the Permissions list, select appropriate permissions for the group or user name.
  9. Click Apply.
  10. Click OK.See Also http://www.hkvstore.com/aspmaker/doc/aspprimer.htm


D. SAMPLE ASP CLASSIC

___________________________________________________
create file connect_ora.asp

<!--#include file="adovbs.inc"-->
<%
Dim GObjCon

set GObjCon = server.CreateObject("ADODB.Connection")
GObjCon.ConnectionString = "Provider=OraOLEDB.Oracle;User ID=ETM;Password=metatech;Data    Source=orcl"
GObjCon.open

%>

create file level.asp

<!-- #include file="includes/global/connect_ora.asp"-->
<!-- #include file="includes/global/authorization.asp"-->
<!-- #include file="includes/global/convert.asp" -->
<%
tmp=check_right("1810",true)
delid=request("delid")
if(not delid="") then
GObjCon.execute("insert into tbl_log_data (user_data,date_data,action_data,menu,sub_menu,id_data) values('" & Session.Contents("name") & "',SYSTIMESTAMP,'delete','SETTING','LEVEL','" & p_name(delid) & "')")
GObjCon.execute("update tbllevel set is_deleted='T' where pk_id="&delid&"")
end if

const intPageSize = 20
currpage = Request("currpage")
if currpage="" then
currpage=1
elseif not isnumeric(currpage) then
currpage=1
elseif cdbl(currpage)<1 then
currpage=1
end if
set rs = server.CreateObject("adodb.recordset")
rs.CursorLocation = adUseClient
rs.PageSize = intPageSize
rs.open "SELECT * FROM tbllevel where is_deleted<>'T' or is_deleted is null order by pk_id",GObjCon
strPageCount = rs.PageCount
if rs.PageCount < cdbl(strPage) then
currpage = rs.PageCount
response.Write strPage
end if
if not rs.EOF then
rs.AbsolutePage = currpage
end if
function p_name(id)
set rs2=GObjCon.execute("select name from tbllevel where pk_id='"& id &"'")
'showquery("select submit_date from marketing_req where pk_id='"& id &"'")
while(not rs2.eof)
p_name=rs2("name")
rs2.movenext
wend
end function
%>
<html>
<head>
<title>.: ETM :.</title>
<link href="text.css" rel="stylesheet" type="text/css">
</head>
<script language='javascript' src='js/openwindow.js'></script>
<script language="javascript">
function fmodal(pstatus,j_id){
if(pstatus=="new"){
show_modal('modal_level_add.asp','status:no;help:no;dialogWidth:635px;dialogHeight:120px');
document.form1.submit();
}else if(pstatus=="edit"){
show_modal('modal_level_edit.asp?pstatus=edit&p_id='+j_id,'status:no;help:no;dialogWidth:635px;dialogHeight:120px');
document.form1.submit();
}else if(pstatus=="distribute"){
show_modal('modal_level_distribute.asp?p_id='+j_id,'status:no;help:no;dialogWidth:635px;dialogHeight:400px');
}else if(pstatus=="rule"){
show_modal('modal_level_rule_list.asp?p_id='+j_id,'status:no;help:no;dialogWidth:635px;dialogHeight:400px');
}else{
show_modal('modal_level_menu.asp?p_id='+j_id,'status:no;help:no;dialogWidth:635px;dialogHeight:600px');
document.form1.submit();
}
}
function fdelete(j_id){
q=confirm("Are you sure to delete this level?");
if(q==true){
document.form1.delid.value=j_id;
document.form1.submit();
}
}
</script>
<body>
<form name="form1" method="post" action="level.asp">
<input type="hidden" name="delid">
<table cellpadding="0" cellspacing="1" border="0" width="100%" style="padding:0px 5px 0px 5px" align="center">
<tr bgcolor="#B2CCFF">
<td colspan="3" height="20">
<%if check_right("181010",false) then%>
<a href="#" onClick="fmodal('new','')"><img src="images/new.gif" align="absmiddle"> New Level</a>
<%end if%>
<span style="text-align:right;width:900px"><%paging_page%></span>
</td>
</tr>
<tr bgcolor="#9CBAFF" align="center">
<td width="200">Level</td>
<td width="600">Description</td>
<td>&nbsp;</td>
</tr>
<%
i=1
while not rs.eof and i <= intPageSize
%>
<tr bgcolor="#CCDDFF">
<td><%=convertToHTML(rs("name"))%></td>
<td><%=convertToHTML(rs("description"))%></td>
<td><nobr>
<%if check_right("181011",false) then%>
<a href="#" onClick="fmodal('edit','<%=rs("pk_id")%>')"><img src="images/edit.gif" border='0' align='absmiddle'>&nbsp;Edit</a>
<%end if%>
<%if check_right("181012",false) then%>
<a href="#" onClick="fmodal('setting','<%=rs("pk_id")%>')"><img src="images/menu.gif" border='0' align='absmiddle'>&nbsp;Menu</a>
<a href="#" onClick="fmodal('rule','<%=rs("pk_id")%>')"><img src="images/menu.gif" border='0' align='absmiddle'>&nbsp;Rule</a>
<%end if%>
<%'if check_right("181014",false) then%>
<a href="#" onClick="fmodal('distribute','<%=rs("pk_id")%>')"><img src="images/menu.gif" border='0' align='absmiddle'>&nbsp;Distribute</a>
<%'end if%>
<%if check_right("181013",false) then%>
<a href="#" onClick="fdelete('<%=rs("pk_id")%>')"><img src="images/false.gif" border='0' align='absmiddle'>&nbsp;Delete</a>
<%end if%></nobr>
</td>
</tr>
<%
i=i+1
rs.movenext
wend
%>
<tr bgcolor="#B2CCFF">
</tr>
</table>
</form>
</body>
</html>
<%
sub paging_page()
%>
<script language='javascript'>
function fpaging(pstatus,ppage){
if (pstatus == 'first' || pstatus == 'last'){
document.form1.currpage.value=ppage;
} else {
document.form1.currpage.value= parseInt(document.form1.currpage.value) + ppage;
if(document.form1.currpage.value><%=strPageCount%>) document.form1.currpage.value=<%=strPageCount%>;
}
document.form1.submit();
}
function cekpage(){
if(document.form1.currpage.value><%=strPageCount%>) document.form1.currpage.value=<%=strPageCount%>;
document.form1.submit();
}
</script>
<input type="hidden" name="paging_action">
<a href="#"><img src="images/page_nav_first_blue.gif" width="15" height="15" align='absmiddle' onClick="fpaging('first',1)" border="0"></a>
<a href="#"><img src="images/page_nav_prev_blue.gif" width="15" height="15" align='absmiddle' onClick="fpaging('prev',-1)" border="0"></a>
<a href="#"><img src="images/page_nav_next_blue.gif" width="15" height="15" align='absmiddle' onClick="fpaging('next',1)" border="0"></a>
<a href="#"><img src="images/page_nav_last_blue.gif" width="15" height="15" align='absmiddle' onClick="fpaging('last',<%=strPageCount%>)" border="0"></a>
Page <input type='text' name="currpage" style="height:18;font-size:10;width:25;color:#0000FF;background-color:#ffffff;border-color:#999999"  value="<%=currpage%>" onKeyPress="if(event.keyCode==13) cekpage()"> of <%=strPageCount%>
<%
end sub
%>

About berbagisolusi

Berbagi merupakan sebuah bentuk simbol keikhlasan untuk membantu dan menolong, sedangkan solusi adalah cara menyelesaikan masalah. Setiap manusia pasti mengalami masalah, tetapi kita tidak perlu mengalami masalah yang sama jika orang lain pernah mengalami dan kita tahu hal tersebut.

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 9 other followers

December 2011
M T W T F S S
« Nov   Jan »
 1234
567891011
12131415161718
19202122232425
262728293031  

Archives

Web Statistic

Blog Stats

  • 149,580 hits
%d bloggers like this: