[Rt-commit] r18485 - rt/3.8/trunk/etc

ruz at bestpractical.com ruz at bestpractical.com
Thu Feb 19 22:23:43 EST 2009


Author: ruz
Date: Thu Feb 19 22:23:43 2009
New Revision: 18485

Modified:
   rt/3.8/trunk/etc/RT_Config.pm.in

Log:
* move WebDomain and WebPort above WebPath, these
  three are only options you usually need to setup paths
* calculate scheme in WebBaseURL using WebPort value
* don't add port to WebBaseURL if it's standard

Modified: rt/3.8/trunk/etc/RT_Config.pm.in
==============================================================================
--- rt/3.8/trunk/etc/RT_Config.pm.in	(original)
+++ rt/3.8/trunk/etc/RT_Config.pm.in	Thu Feb 19 22:23:43 2009
@@ -761,46 +761,61 @@
 
 Set($UsernameFormat, 'concise');
 
+=item C<$WebDomain>
 
-=item C<$WebPath>
-
-If you're putting the web ui somewhere other than at the root of
-your server, you should set C<$WebPath> to the path you'll be 
-serving RT at.
-
-C<$WebPath> requires a leading / but no trailing /.
-
-In most cases, you should leave C<$WebPath> set to '' (an empty value).
+Domain name of the RT server, eg 'www.example.com'. It should not contain
+anything else, but server name.
 
 =cut
 
-Set($WebPath, "");
+Set( $WebDomain, 'localhost' );
 
 =item C<$WebPort>
 
 If we're running as a superuser, run on port 80
 Otherwise, pick a high port for this user.
 
+443 is default port for https protocol.
+
 =cut
 
 Set($WebPort, 80);# + ($< * 7274) % 32766 + ($< && 1024));
 
-=item C<$WebDomain>
+=item C<$WebPath>
+
+If you're putting the web ui somewhere other than at the root of
+your server, you should set C<$WebPath> to the path you'll be 
+serving RT at.
 
-you know what domain name is, right? ;)
+C<$WebPath> requires a leading / but no trailing /, or it can be blank.
+
+In most cases, you should leave C<$WebPath> set to '' (an empty value).
 
 =cut
 
-Set( $WebDomain, 'localhost' );
+Set($WebPath, "");
 
 =item C<$WebBaseURL>, C<$WebURL>
 
-This is the Scheme, server and port for constructing urls to webrt
-C<$WebBaseURL> doesn't need a trailing /
+Usually you don't want to set these options. The only obviouse reason is
+RT accessible via https protocol on non standard port, eg
+'https://rt.example.com:9999'. In all other cases these options are computed
+using C<$WebDomain>, C<$WebPort> and C<$WebPath>.
+
+C<$WebBaseURL> is the scheme, server and port (eg 'http://rt.example.com')
+for constructing urls to the web UI. C<$WebBaseURL> doesn't need a trailing /.
+
+C<$WebURL> is the C<$WebBaseURL>, C<$WebPath> and trailing /, for example:
+'http://www.example.com/rt/'.
 
 =cut
 
-Set($WebBaseURL, 'http://' . RT->Config->Get('WebDomain') . ':' . RT->Config->Get('WebPort'));
+my $port = RT->Config->Get('WebPort');
+Set($WebBaseURL,
+    ($port == 443? 'https': 'http') .'://'
+    . RT->Config->Get('WebDomain')
+    . ($port != 80 && $port != 443? ":$port" : '')
+);
 
 Set($WebURL, RT->Config->Get('WebBaseURL') . RT->Config->Get('WebPath') . "/");
 


More information about the Rt-commit mailing list