Gentlemen,
I have trouble operating the SolidCP with IIS8.5 and Windows Server 2012 R2, when trying to create a web site has the following error message:
[9/10/2016 5:30:37 PM] ERROR: ‘Internet Information Services 8.0’ SiteIdExists
System.Runtime.InteropServices.COMException (0x8007000D): Invalid site name
at Microsoft.Web.Administration.Interop.IAppHostProperty.set_Value(Object value)
at Microsoft.Web.Administration.ConfigurationElementCollectionBase`1.FindElementWithCollectionKey(String elementName, String collectionKey, Object value)
at Microsoft.Web.Administration.SiteCollection.get_Item(String name)
at SolidCP.Providers.Web.Iis.WebObjects.WebObjectsModuleService.SiteExists(ServerManager srvman, String siteId)
at SolidCP.Providers.Web.IIs70.SiteExists(String siteId)
at SolidCP.Server.WebServer.SiteExists(String siteId)
I appreciate any help.
Thank you
Hello,
Just double checking something:
The fixes you make they have to work with the SolidCP Portal code aswell. (not just adjusted so they work with your frontend/ scripts)
As currently everything works for Portal / Enterprise / Server (and has to stay that way ofcourse).
the way to contribute is:
1) make sure you have a signed contributor license: https://solidcp.com/contributors/contributors-license-agreement/
2) In our Git make your own fork
3) Apply the fixes to your fork, and submit a merge request with our master
4) One of the management will check/ verify the code and accept the merge request
Regards,
Marco
Hello Marco,
I managed to solve the problem, I found the error in IIS7 class, I’ll post the solution below:
Problem
Error trying to create a new website through IIS8.5 get the error below, this does not apply in IIS6. I could not do a test on IIS7 to see if the problem extends to it.
Error
ERROR: ‘Internet Information Services 8.0’ SiteIdExists
System.Runtime.InteropServices.COMException (0x8007000D): Invalid site name
Scenario
Creation of a new website in IIS 8.5
Site Name: domain.com
IIS6
GetSiteId:[]
SiteExists:[False]
Result: OK
IIS8.5
GetSiteId:[]
SiteExists: Invalid site name
Result: ERROR
Solution
It was necessary to make a change in class: WebObjectsModuleService.cs, line: 453
FROM
public bool SiteExists(ServerManager srvman, string siteId)
{
return (srvman.Sites[siteId] != null);
}
TO
public bool SiteExists(ServerManager srvman, string siteId)
{
return (siteId == null ? false : srvman.Sites[siteId] != null);
}
SUMMARY
When a web site there is no GetSiteId function returns null when this occurs SiteExists function generates an error by looking for an element of the array that does not exist, to solve the problem just did a check before if the SiteName is null, we know that He does not exist.
Problem solved!!
Thankyou!
Hello Marco,
I will take the tests using the same functions IIS6 and post the result here.
Thank you for now.
Hello,
Ok i checked the code and for IIS 7 / 8 it uses:
public override bool SiteExists(string siteId)
{
using (ServerManager srvman = webObjectsSvc.GetServerManager())
{
return webObjectsSvc.SiteExists(srvman, siteId);
}
}
While for IIS 6 it uses:
public virtual bool SiteExists(string siteId)
{
return (wmi.ExecuteQuery(
String.Format(“SELECT * FROM IIsWebServerSetting WHERE Name='{0}'”, siteId)).Count > 0);
}
for IIS 7/8:
The SideID is domain.com , and if it doesn’t exist it should return a null value
Nothing more to it.
For IIS 6:
public string GetSiteId(string siteName)
{
string siteId = null;
ManagementObjectCollection objSites = wmi.ExecuteQuery(
String.Format(“SELECT * FROM IIsWebServerSetting WHERE ServerComment='{0}'”, siteName));
foreach (ManagementObject objSite in objSites)
siteId = (string)objSite.Properties[”Name”].Value;
return siteId;
}
Which might need to be adjusted into your code?
as the siteID is simply handled different compared to IIS 6,
Hi Marco,
That’s right! I see that at No SolidCP have modules only IIS8, I believe it is the same for 8.5.
Note that the return behavior of ID is:
When the domain name already exists in IIS => returns the domain name (domain.com)
When the domain does not exist in IIS => returns null
Stay calm when your check! I do not want to mess up your weekend. 🙂
Best Regards!
ah,
So your just using the soap calls on the SolidCP Server?
In that case i will have to check on changes to the IIS 8.5 module (there have been quite a few and still some on the making).
I guess it will take + – 72 hours before i can give a better answer on that (for the first time in ages i am more or less taking the weekend semi-off to relax some, so first chance i get to dig in this is monday).
One thing i can say straight off the bat: in 2003 the Website ID was an actual ID, while in 8.0 and up it’s just domain.com (no actual ID like before)