From 1f77f05f023f9ab45e9f8fd0109766a1fe151dba Mon Sep 17 00:00:00 2001 From: mores Date: Tue, 2 Nov 2010 21:46:45 -0400 Subject: [PATCH 1/3] Admin Server can now bind to a private ip address Signed-off-by: Melanie --- .../RemoteController/RemoteAdminPlugin.cs | 4 +++- OpenSim/Framework/MainServer.cs | 9 +++++++++ bin/OpenSim.ini.example | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 72ac3039d1..cbaa38b02b 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -116,7 +116,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController int port = m_config.GetInt("port", 0); m_application = openSim; - m_httpServer = MainServer.GetHttpServer((uint)port); + string bind_ip_address = m_config.GetString("bind_ip_address", "127.0.0.1"); + IPAddress ipaddr = IPAddress.Parse( bind_ip_address ); + m_httpServer = MainServer.GetHttpServer((uint)port,ipaddr); Dictionary availableMethods = new Dictionary(); availableMethods["admin_create_region"] = XmlRpcCreateRegionMethod; diff --git a/OpenSim/Framework/MainServer.cs b/OpenSim/Framework/MainServer.cs index 1f5f2088fc..8ccabece50 100644 --- a/OpenSim/Framework/MainServer.cs +++ b/OpenSim/Framework/MainServer.cs @@ -27,6 +27,7 @@ using System.Collections.Generic; using System.Reflection; +using System.Net; using log4net; using OpenSim.Framework.Servers.HttpServer; @@ -47,6 +48,11 @@ namespace OpenSim.Framework } public static IHttpServer GetHttpServer(uint port) + { + return GetHttpServer(port,null); + } + + public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr) { if (port == 0) return Instance; @@ -58,6 +64,9 @@ namespace OpenSim.Framework m_Servers[port] = new BaseHttpServer(port); + if (ipaddr != null ) + m_Servers[port].ListenIPAddress = ipaddr; + m_log.InfoFormat("[MAIN HTTP SERVER]: Starting main http server on port {0}", port); m_Servers[port].Start(); diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 9d348548c0..669f534afb 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -326,6 +326,9 @@ ;; Set this to a nonzero value to have remote admin use a different port ; port = 0 + ;; Set this to the ip address that you want the admin server to bind to + ; bind_ip_address = 127.0.0.1 + ;# {access_password} {enabled:true} {Password for the remote admin interface} {} ;; This password is required to make any XMLRPC call (should be set as ;; the "password" parameter) From e76980bc496b414908ced8a9451631ff21ba5a17 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 3 Nov 2010 01:09:42 +0000 Subject: [PATCH 2/3] Fix config items. Less used / expert items go in OpenSimDefaults.ini The default shown is always the hardcoded default --- bin/OpenSim.ini.example | 3 --- bin/OpenSimDefaults.ini | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 669f534afb..9d348548c0 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -326,9 +326,6 @@ ;; Set this to a nonzero value to have remote admin use a different port ; port = 0 - ;; Set this to the ip address that you want the admin server to bind to - ; bind_ip_address = 127.0.0.1 - ;# {access_password} {enabled:true} {Password for the remote admin interface} {} ;; This password is required to make any XMLRPC call (should be set as ;; the "password" parameter) diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index de7c44ccf4..f98689b613 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -624,6 +624,9 @@ ; Set this to a nonzero value to have remote admin use a different port port = 0 + ; Set this to the ip address that you want the admin server to bind to + bind_ip_address = "0.0.0.0" + ; This password is required to make any XMLRPC call (should be set as the "password" parameter) access_password = unknown From c25f84e31c9ce20b887d2aba638962984ef20941 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 3 Nov 2010 01:11:04 +0000 Subject: [PATCH 3/3] Change the default of the new bind_ip_address RemoteAdmin option to 0.0.0.0 so it reflects the prior default. We are not in the habot of changing default behavior without good reason and making localhost the default would break most current use cases. --- .../ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index cbaa38b02b..854307c1e8 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -116,7 +116,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController int port = m_config.GetInt("port", 0); m_application = openSim; - string bind_ip_address = m_config.GetString("bind_ip_address", "127.0.0.1"); + string bind_ip_address = m_config.GetString("bind_ip_address", "0.0.0.0"); IPAddress ipaddr = IPAddress.Parse( bind_ip_address ); m_httpServer = MainServer.GetHttpServer((uint)port,ipaddr);