locked
create a website? RRS feed

  • Question

  • User-201541639 posted
    I can create a virtual dictory, but I want to create a website now , how can i do?
    Tuesday, November 18, 2003 12:07 AM

All replies

  • User-1174460629 posted
    If you have Windows 2000 server or Windows 2003 server then you can right-click the computer name and add a new web site that way. As far as I know Win2K Pro and WinXP can not have multiple web sites.
    Tuesday, November 18, 2003 1:47 AM
  • User-201541639 posted
    thanks in advance for your reply,I know I can create a website in w2k server , perhaps I had not say clearly my question, I want to create a website using System.DirectoryServices.DirectoryEntry class
    Tuesday, November 18, 2003 8:18 PM
  • User574113055 posted
    Hi! Dont worry! I have the code for u to create website using asp.net Public Function CreateWebsite(ByVal webSiteName As String, ByVal pathToRoot As String) As Integer Dim root As System.DirectoryServices.DirectoryEntry = New System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC") Dim siteID As Integer = 1 Dim e As System.DirectoryServices.DirectoryEntry For Each e In root.Children If e.SchemaClassName = "IIsWebServer" Then Dim ID = Convert.ToInt32(e.Name) If ID >= siteID Then siteID = ID + 1 End If End If Next Dim site As System.DirectoryServices.DirectoryEntry = CType(root.Invoke("Create", "IIsWebServer", siteID), System.DirectoryServices.DirectoryEntry) site.Invoke("Put", "ServerComment", webSiteName) site.Invoke("Put", "KeyType", "IIsWebServer") site.Invoke("Put", "ServerBindings", ":80:") site.Invoke("Put", "ServerState", 2) site.Invoke("Put", "FrontPageWeb", 1) site.Invoke("Put", "DefaultDoc", "Default.aspx") site.Invoke("Put", "SecureBindings", ":443:") site.Invoke("Put", "ServerAutoStart", 1) site.Invoke("Put", "ServerSize", 1) site.Invoke("SetInfo") site.CommitChanges() Return siteID End Function enjoy! ak raj
    Monday, December 1, 2003 1:04 PM
  • User-1520202181 posted
    ¿how can i set the Path propertie, if in your code I add the line "site.Invoke("Put", "Path", "C:\")", crash the page. thanks MAYC
    Saturday, February 28, 2004 3:59 AM
  • User1668022544 posted
    What's the error for your crash? try: site.Invoke("Put", "Path", @"C:\") or: site.Invoke("Put", "Path", "C:\\") A backslash shoud be escaped.
    Sunday, February 29, 2004 3:22 PM
  • User-1520202181 posted
    I was tried both options and continue crashing. I don't know the solution Tanks MAYC the error is Exception HRESULT: 0x80005006. [COMException (0x80005006): Excepción de HRESULT: 0x80005006.] [TargetInvocationException: Se inició una excepción en el destino de la invocación.] System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0 System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473 System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29 System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args) intranet.pruebasdns.iis() in c:\inetpub\wwwroot\intranet\administracion\pruebasdns.aspx.vb:156 intranet.pruebasdns.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\intranet\administracion\pruebasdns.aspx.vb:32 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain()
    Monday, March 1, 2004 10:56 AM
  • User1241903888 posted
    The error still is existent! follow as: the error is Exception HRESULT: 0x80005006. [COMException (0x80005006): Excepción de HRESULT: 0x80005006.] [TargetInvocationException: Se inició una excepción en el destino de la invocación.] System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0 System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473 System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29 System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args) intranet.pruebasdns.iis() in c:\inetpub\wwwroot\intranet\administracion\pruebasdns.aspx.vb:156 intranet.pruebasdns.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\intranet\administracion\pruebasdns.aspx.vb:32 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain()
    Monday, March 14, 2005 1:29 PM
  • User188852043 posted

    I am updating the property values to the website and was getting the error

    objDirectoryEntry = new DirectoryEntry(metabasePath + "/Root");

    tried variuos ways:

    objDirectoryEntry.Invoke("Put", "AcccessSSL", ob1);  -- getting error : Exception has been thrown by the target of an invocation.

    objDirectoryEntry.Properties["AcccessSSL"].Add(ob1);  -- getting Exception from HRESULT: 0x80005006

    Suggestions

     

    Friday, May 22, 2009 4:23 AM
  • User854688209 posted

    If you have Windows 2000 server or Windows 2003 server then you can right-click the computer name and add a new web site that way.

    As far as I know Win2K Pro and WinXP can not have multiple web sites.

    Hi russnem,

    Don't take it otherwise.
    All versions of Windows 2000 comes with IIS 5.0, Windows 2003 come with IIS 6.0. So we can't create multiple website in Windows 2000 as it IIS 5.0.

    We can use Windows 2000 server domain with IIS 6.0


    Only IIS 6.0 have the option to have multiple websites, in IIS 5.0 only one website with multiple virtual directories.

    I can create a virtual dictory, but I want to create a website now , how can i do?

    titan1980,

    Why are you trying to achieve your goal using code? Do you want to create the website at runtime?

    You can create multiple website in IIS 5.0 also but it won't provide you any of the feature of IIS 6.0.

    Refer below url to create multiple website in IIS 6.0.

    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/9b74f316-071b-4eab-b5d2-c3ad7feb46ca.mspx?mfr=true

    Refer below url to create multiple website in IIS 5.0 and IIS 5.1. You won't get feature of IIS 6.0 though

    http://www.xoc.net/works/tips/multiple-iis-sites-professional.asp

     

    Friday, May 22, 2009 5:11 AM
  • User-1809278083 posted

    I tried the code at the top of the post...it creates a site perfectly fine until to go to access it in IIS...it says "the system cannot find specified path"...and i cannot edit the entry at all

    Tuesday, August 25, 2009 9:52 AM