Fixed: Web Sites: Add IP Address to binding when using dedicated ip addresses
This commit is contained in:
parent
b04e862a86
commit
fe89ed6609
2 changed files with 31 additions and 4 deletions
|
@ -223,7 +223,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
StringDictionary webSettings = ServerController.GetServiceSettings(serviceId);
|
StringDictionary webSettings = ServerController.GetServiceSettings(serviceId);
|
||||||
int addressId = Utils.ParseInt(webSettings["SharedIP"], 0);
|
int addressId = Utils.ParseInt(webSettings["SharedIP"], 0);
|
||||||
|
|
||||||
|
bool dedicatedIp = false;
|
||||||
if (packageAddressId != 0)
|
if (packageAddressId != 0)
|
||||||
{
|
{
|
||||||
// dedicated IP
|
// dedicated IP
|
||||||
|
@ -231,6 +231,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
if (packageIp != null)
|
if (packageIp != null)
|
||||||
{
|
{
|
||||||
addressId = packageIp.AddressID;
|
addressId = packageIp.AddressID;
|
||||||
|
dedicatedIp = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,6 +259,12 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return BusinessErrorCodes.ERROR_WEB_SITE_ALREADY_EXISTS;
|
return BusinessErrorCodes.ERROR_WEB_SITE_ALREADY_EXISTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dedicatedIp)
|
||||||
|
{
|
||||||
|
// DEDICATED IP
|
||||||
|
bindings.Add(new ServerBinding(ipAddr, "80", ""));
|
||||||
|
}
|
||||||
|
|
||||||
UserInfo user = PackageController.GetPackageOwner(packageId);
|
UserInfo user = PackageController.GetPackageOwner(packageId);
|
||||||
UserSettings webPolicy = UserController.GetUserSettings(user.UserId, UserSettings.WEB_POLICY);
|
UserSettings webPolicy = UserController.GetUserSettings(user.UserId, UserSettings.WEB_POLICY);
|
||||||
|
|
||||||
|
@ -628,7 +635,6 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
if (addressId != 0)
|
if (addressId != 0)
|
||||||
ServerController.AddItemIPAddress(siteItemId, addressId);
|
ServerController.AddItemIPAddress(siteItemId, addressId);
|
||||||
|
|
||||||
|
|
||||||
DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName);
|
DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName);
|
||||||
|
|
||||||
AddWebSitePointer(siteItemId,
|
AddWebSitePointer(siteItemId,
|
||||||
|
@ -644,6 +650,27 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
, ZoneInfo.DomainId, true, true, true);
|
, ZoneInfo.DomainId, true, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
WebServer web = new WebServer();
|
||||||
|
ServiceProviderProxy.Init(web, siteItem.ServiceId);
|
||||||
|
WebSite site = web.GetSite(siteItem.SiteId);
|
||||||
|
|
||||||
|
List<ServerBinding> newBindings = new List<ServerBinding>();
|
||||||
|
foreach (ServerBinding b in site.Bindings)
|
||||||
|
{
|
||||||
|
newBindings.Add(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
// load web site IP address
|
||||||
|
IPAddressInfo ip = ServerController.GetIPAddress(siteItem.SiteIPAddressId);
|
||||||
|
string ipAddr = "*";
|
||||||
|
if (ip != null)
|
||||||
|
ipAddr = !String.IsNullOrEmpty(ip.InternalIP) ? ip.InternalIP : ip.ExternalIP;
|
||||||
|
|
||||||
|
newBindings.Add(new ServerBinding(ipAddr, "80", ""));
|
||||||
|
|
||||||
|
web.UpdateSiteBindings(siteItem.SiteId, newBindings.ToArray(), false);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
</configSections>
|
</configSections>
|
||||||
<!-- Connection strings -->
|
<!-- Connection strings -->
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="EnterpriseServer" connectionString="Server=(local)\SQLExpress;Database=WebsitePanel;uid=sa;pwd=Password12" providerName="System.Data.SqlClient" />
|
<add name="EnterpriseServer" connectionString="server=HSTPROV01;database=WebsitePanelMerge;uid=WebsitePanel;pwd=aj7ep6fyhmw3b5qeth7c;" providerName="System.Data.SqlClient" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<!-- Encryption util settings -->
|
<!-- Encryption util settings -->
|
||||||
<add key="WebsitePanel.CryptoKey" value="1234567890" />
|
<add key="WebsitePanel.CryptoKey" value="3x7eqt7zabc5n5afs6dg" />
|
||||||
<!-- A1D4KDHUE83NKHddF -->
|
<!-- A1D4KDHUE83NKHddF -->
|
||||||
<add key="WebsitePanel.EncryptionEnabled" value="true" />
|
<add key="WebsitePanel.EncryptionEnabled" value="true" />
|
||||||
<!-- Web Applications -->
|
<!-- Web Applications -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue