Skip to content
This repository has been archived by the owner on Nov 19, 2022. It is now read-only.

Commit

Permalink
2009-12-02 Marek Habersack <mhabersack@novell.com>
Browse files Browse the repository at this point in the history
	* mod_mono.8.in: documented new directive MonoTargetFramework

2009-12-02  Marek Habersack  <mhabersack@novell.com>

	* mod_mono.c: added new directive MonoTargetFramework which allows
	one to select which framework backend to start (2.0, 3.5 and 4.0
	with the first two being aliases).

svn path=/trunk/mod_mono/; revision=147426
  • Loading branch information
grendello committed Dec 2, 2009
1 parent f3c4238 commit df77007
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 6 deletions.
4 changes: 4 additions & 0 deletions man/ChangeLog
@@ -1,3 +1,7 @@
2009-12-02 Marek Habersack <mhabersack@novell.com>

* mod_mono.8.in: documented new directive MonoTargetFramework

2009-09-21 Marek Habersack <mhabersack@novell.com>

* mod_mono.8.in: documented MonoCheckHiddenFiles
Expand Down
6 changes: 6 additions & 0 deletions man/mod_mono.8.in
Expand Up @@ -98,6 +98,12 @@ Default value: ""
The full path to the mod-mono-server script.
Default value: "/usr/bin/mod-mono-server"
.TP
.I "MonoTargetFramework"
If MonoRunXSP is True, this option selects the .NET framework version to use. This
affects the backend that is started to service the requests. The MonoServerPath option
takes precedence over this setting. Available values are "2.0", "3.5" and "4.0".
Default value: "2.0"
.TP
.I "MonoWapiDir"
The directory where mono runtime will create the ".wapi" directory
used to emulate windows I/O. It's used to set MONO_SHARED_DIR.
Expand Down
6 changes: 6 additions & 0 deletions src/ChangeLog
@@ -1,3 +1,9 @@
2009-12-02 Marek Habersack <mhabersack@novell.com>

* mod_mono.c: added new directive MonoTargetFramework which allows
one to select which framework backend to start (2.0, 3.5 and 4.0
with the first two being aliases).

2009-11-09 Marek Habersack <mhabersack@novell.com>

* mod_mono.c: implemented a list of URLs in the control panel,
Expand Down
43 changes: 38 additions & 5 deletions src/mod_mono.c
Expand Up @@ -113,6 +113,7 @@ typedef struct xsp_data {
char *executable_path;
char *path;
char *server_path;
char *target_framework;
char *applications;
char *wapidir;
char *document_root;
Expand Down Expand Up @@ -588,7 +589,8 @@ add_xsp_server (apr_pool_t *pool, const char *alias, module_cfg *config, int is_
server->run_xsp = "True";
/* (Obsolete) server->executable_path = EXECUTABLE_PATH; */
server->path = NULL;
server->server_path = MODMONO_SERVER_PATH;
server->server_path = NULL;
server->target_framework = NULL;
server->applications = NULL;
server->wapidir = WAPIDIR;
server->document_root = DOCUMENT_ROOT;
Expand Down Expand Up @@ -715,8 +717,9 @@ store_config_xsp (cmd_parms *cmd, void *notused, const char *first, const char *
return NULL;
}
alias = "default";
if (cmd->server->is_virtual)
if (cmd->server->is_virtual && cmd->server->server_hostname)
alias = cmd->server->server_hostname;

value = first;
is_default = 1;
} else {
Expand All @@ -726,7 +729,7 @@ store_config_xsp (cmd_parms *cmd, void *notused, const char *first, const char *
value = second;
is_default = (!strcmp (alias, "default"));
}

/* Disable autoapp if there's any other application. MonoDebug is excluded. */
if (!config->auto_app_set)
config->auto_app = FALSE;
Expand Down Expand Up @@ -1489,6 +1492,7 @@ fork_mod_mono_server (apr_pool_t *pool, xsp_data *config)
char *path;
char *tmp;
char *serverdir;
char *server_path;
char *wapidir;
int max_memory = 0;
int max_cpu_time = 0;
Expand Down Expand Up @@ -1634,7 +1638,30 @@ fork_mod_mono_server (apr_pool_t *pool, xsp_data *config)
if (tmp == NULL)
tmp = "";

serverdir = get_directory (pool, config->server_path);
if (config->server_path && config->server_path [0])
server_path = config->server_path;
else if (config->target_framework && config->target_framework [0]) {
switch (config->target_framework [0]) {
case '2':
case '3':
server_path = MODMONO_SERVER_PATH;
break;

case '4':
server_path = MODMONO_SERVER_BASEPATH "4";
break;

default:
ap_log_error (APLOG_MARK, APLOG_ERR, STATUS_AND_SERVER,
"Unsupported target framework version: %s",
config->target_framework);
exit (1);
}

} else
server_path = MODMONO_SERVER_PATH;

serverdir = get_directory (pool, server_path);
DEBUG_PRINT (1, "serverdir: %s", serverdir);
path = apr_pcalloc (pool, strlen (tmp) + strlen (serverdir) + 2);
sprintf (path, "%s:%s", serverdir, tmp);
Expand Down Expand Up @@ -1664,7 +1691,7 @@ fork_mod_mono_server (apr_pool_t *pool, xsp_data *config)
#endif
memset (argv, 0, sizeof (char *) * MAXARGS);
argi = 0;
argv [argi++] = config->server_path;
argv [argi++] = server_path;
if (config->listen_port != NULL) {
char *la;

Expand Down Expand Up @@ -2917,6 +2944,12 @@ static const command_rec mono_cmds [] = {
"Default: " MODMONO_SERVER_PATH
),

MAKE_CMD12 (MonoTargetFramework, target_framework,
"If MonoRunXSP is True, this option selects the .NET framework version to use. This "
"affects the backend that is started to service the requests. The MonoServerPath option "
"takes precedence over this setting. Default: " MONO_DEFAULT_FRAMEWORK
),

MAKE_CMD12 (MonoApplications, applications,
"Comma separated list with virtual directories and real directories. "
"One ASP.NET application will be created for each pair. Default: \"\" "
Expand Down
4 changes: 3 additions & 1 deletion src/mod_mono.h
Expand Up @@ -89,7 +89,9 @@
#define DIRECTORY_SEPARATOR "/"
#endif

#define MODMONO_SERVER_PATH MONO_PREFIX "/bin/mod-mono-server"
#define MODMONO_SERVER_BASEPATH MONO_PREFIX "/bin/mod-mono-server"
#define MONO_DEFAULT_FRAMEWORK "2.0"
#define MODMONO_SERVER_PATH MODMONO_SERVER_BASEPATH "2"
#define WAPIDIR "/tmp"
#define DOCUMENT_ROOT NULL
#define APPCONFIG_FILE NULL
Expand Down

0 comments on commit df77007

Please sign in to comment.