@@ -354,7 +354,7 @@ def find_mimetypes():
354354WSGIChunkedRequest On
355355</IfDefine>
356356
357- <IfDefine WSGI_WITH_SSL >
357+ <IfDefine WSGI_WITH_HTTPS >
358358<IfModule !ssl_module>
359359LoadModule ssl_module %(modules_directory)s/mod_ssl.so
360360</IfModule>
@@ -458,10 +458,10 @@ def find_mimetypes():
458458ServerName %(server_name)s
459459<IfDefine WSGI_SERVER_ALIAS>
460460ServerAlias %(server_aliases)s
461+ </IfDefine>
461462RewriteEngine On
462463RewriteCond %%{HTTPS} off
463464RewriteRule (.*) https://%%{HTTP_HOST}%%{REQUEST_URI}
464- </IfDefine>
465465</VirtualHost>
466466<IfDefine WSGI_REDIRECT_WWW>
467467<VirtualHost *:%(port)s>
@@ -477,17 +477,17 @@ def find_mimetypes():
477477
478478<IfDefine WSGI_VIRTUAL_HOST>
479479
480- <IfDefine WSGI_WITH_SSL >
480+ <IfDefine WSGI_WITH_HTTPS >
481481<IfDefine WSGI_LISTENER_HOST>
482- Listen %(host)s:%(ssl_port )s
482+ Listen %(host)s:%(https_port )s
483483</IfDefine>
484484<IfDefine !WSGI_LISTENER_HOST>
485- Listen %(ssl_port )s
485+ Listen %(https_port )s
486486</IfDefine>
487487<IfVersion < 2.4>
488- NameVirtualHost *:%(ssl_port )s
488+ NameVirtualHost *:%(https_port )s
489489</IfVersion>
490- <VirtualHost _default_:%(ssl_port )s>
490+ <VirtualHost _default_:%(https_port )s>
491491<Location />
492492Order deny,allow
493493Deny from all
@@ -499,7 +499,7 @@ def find_mimetypes():
499499SSLCertificateFile %(ssl_certificate)s.crt
500500SSLCertificateKeyFile %(ssl_certificate)s.key
501501</VirtualHost>
502- <VirtualHost *:%(ssl_port )s>
502+ <VirtualHost *:%(https_port )s>
503503ServerName %(server_name)s
504504<IfDefine WSGI_SERVER_ALIAS>
505505ServerAlias %(server_aliases)s
@@ -509,9 +509,9 @@ def find_mimetypes():
509509SSLCertificateKeyFile %(ssl_certificate)s.key
510510</VirtualHost>
511511<IfDefine WSGI_REDIRECT_WWW>
512- <VirtualHost *:%(ssl_port )s>
512+ <VirtualHost *:%(https_port )s>
513513ServerName %(parent_domain)s
514- Redirect permanent / https://%(server_name)s:%(ssl_port )s/
514+ Redirect permanent / https://%(server_name)s:%(https_port )s/
515515SSLEngine On
516516SSLCertificateFile %(ssl_certificate)s.crt
517517SSLCertificateKeyFile %(ssl_certificate)s.key
@@ -1356,7 +1356,7 @@ def generate_server_metrics_script(options):
13561356LC_ALL='%(locale)s'
13571357
13581358export LANG
1359- export LOCALE
1359+ export LC_ALL
13601360
13611361ACMD="$1"
13621362ARGV="$@"
@@ -1433,9 +1433,12 @@ def check_percentage(option, opt_str, value, parser):
14331433 metavar = 'NUMBER' , help = 'The specific port to bind to and '
14341434 'on which requests are to be accepted. Defaults to port 8000.' ),
14351435
1436+ optparse .make_option ('--https-port' , type = 'int' , metavar = 'NUMBER' ,
1437+ help = 'The specific port to bind to and on which secure '
1438+ 'requests are to be accepted.' ),
14361439 optparse .make_option ('--ssl-port' , type = 'int' , metavar = 'NUMBER' ,
1437- help = 'The specific port to bind to and on which requests are '
1438- 'to be accepted for SSL connections.' ),
1440+ dest = 'https_port' , help = optparse . SUPPRESS_HELP ),
1441+
14391442 optparse .make_option ('--ssl-certificate' , default = None ,
14401443 metavar = 'FILE-PATH' , help = 'Specify the path to the SSL '
14411444 'certificate files. It is expected that the files have \' .crt\' '
@@ -1444,9 +1447,9 @@ def check_percentage(option, opt_str, value, parser):
14441447 'the extension.' ),
14451448 optparse .make_option ('--https-only' , action = 'store_true' ,
14461449 default = False , help = 'Flag indicating whether any requests '
1447- 'made using a HTTP request over the non SSL connection should '
1448- ' be redirected automatically to use a HTTPS request over the '
1449- 'SSL connection.' ),
1450+ 'made using a HTTP request over the non connection connection '
1451+ 'should be redirected automatically to use a HTTPS request '
1452+ 'over the secure connection.' ),
14501453
14511454 optparse .make_option ('--server-name' , default = None , metavar = 'HOSTNAME' ,
14521455 help = 'The primary host name of the web server. If this name '
@@ -1737,13 +1740,13 @@ def check_percentage(option, opt_str, value, parser):
17371740 help = 'Specify an alternate script file for user defined web '
17381741 'server environment variables. Defaults to using the '
17391742 '\' envvars\' stored under the server root directory.' ),
1740- optparse .make_option ('--lang' , default = 'en_US .UTF-8' , metavar = 'NAME' ,
1743+ optparse .make_option ('--lang' , default = 'C .UTF-8' , metavar = 'NAME' ,
17411744 help = 'Specify the default language locale as normally defined '
1742- 'by the LANG environment variable. Defaults to \' en_US .UTF-8\' .' ),
1743- optparse .make_option ('--locale' , default = 'en_US .UTF-8' , metavar = 'NAME' ,
1745+ 'by the LANG environment variable. Defaults to \' C .UTF-8\' .' ),
1746+ optparse .make_option ('--locale' , default = 'C .UTF-8' , metavar = 'NAME' ,
17441747 help = 'Specify the default natural language formatting style '
17451748 'as normally defined by the LC_ALL environment variable. '
1746- 'Defaults to \' en_US .UTF-8\' .' ),
1749+ 'Defaults to \' C .UTF-8\' .' ),
17471750
17481751 optparse .make_option ('--setenv' , action = 'append' , nargs = 2 ,
17491752 dest = 'setenv_variables' , metavar = 'KEY VALUE' , help = 'Specify '
@@ -2265,12 +2268,12 @@ def _cmd_setup_server(command, args, options):
22652268 else :
22662269 options ['url' ] = 'http://%s:%s/' % (host , options ['port' ])
22672270
2268- if options ['ssl_port ' ] == 443 :
2269- options ['ssl_url ' ] = 'https://%s/' % host
2270- elif options ['ssl_port ' ] is not None :
2271- options ['ssl_url ' ] = 'https://%s:%s/' % (host , options ['ssl_port ' ])
2271+ if options ['https_port ' ] == 443 :
2272+ options ['https_url ' ] = 'https://%s/' % host
2273+ elif options ['https_port ' ] is not None :
2274+ options ['https_url ' ] = 'https://%s:%s/' % (host , options ['https_port ' ])
22722275 else :
2273- options ['ssl_url ' ] = None
2276+ options ['https_url ' ] = None
22742277
22752278 if options ['debug_mode' ]:
22762279 options ['httpd_arguments_list' ].append ('-DONE_PROCESS' )
@@ -2329,8 +2332,8 @@ def _cmd_setup_server(command, args, options):
23292332 options ['httpd_arguments_list' ].append ('-DWSGI_REDIRECT_WWW' )
23302333 options ['parent_domain' ] = options ['server_name' ][4 :]
23312334
2332- if options ['ssl_port ' ] and options ['ssl_certificate' ]:
2333- options ['httpd_arguments_list' ].append ('-DWSGI_WITH_SSL ' )
2335+ if options ['https_port ' ] and options ['ssl_certificate' ]:
2336+ options ['httpd_arguments_list' ].append ('-DWSGI_WITH_HTTPS ' )
23342337 if options ['https_only' ]:
23352338 options ['httpd_arguments_list' ].append ('-DWSGI_HTTPS_ONLY' )
23362339
@@ -2393,42 +2396,42 @@ def _cmd_setup_server(command, args, options):
23932396 generate_apache_config (options )
23942397 generate_control_scripts (options )
23952398
2396- print ('Server URL :' , options ['url' ])
2399+ print ('Server URL :' , options ['url' ])
23972400
2398- if options ['ssl_url ' ]:
2399- print ('Server URL (SSL) :' , options ['ssl_url ' ])
2401+ if options ['https_url ' ]:
2402+ print ('Server URL (HTTPS) :' , options ['https_url ' ])
24002403
24012404 if options ['server_status' ]:
2402- print ('Server Status :' , '%sserver-status' % options ['url' ])
2405+ print ('Server Status :' , '%sserver-status' % options ['url' ])
24032406
2404- print ('Server Root :' , options ['server_root' ])
2405- print ('Server Conf :' , options ['httpd_conf' ])
2407+ print ('Server Root :' , options ['server_root' ])
2408+ print ('Server Conf :' , options ['httpd_conf' ])
24062409
2407- print ('Error Log File :' , options ['error_log_file' ])
2410+ print ('Error Log File :' , options ['error_log_file' ])
24082411
24092412 if options ['access_log' ]:
2410- print ('Access Log File :' , options ['access_log_file' ])
2413+ print ('Access Log File :' , options ['access_log_file' ])
24112414
24122415 if options ['startup_log' ]:
2413- print ('Startup Log File :' , options ['startup_log_file' ])
2416+ print ('Startup Log File :' , options ['startup_log_file' ])
24142417
24152418 if options ['enable_coverage' ]:
2416- print ('Coverage Output :' , os .path .join (
2419+ print ('Coverage Output :' , os .path .join (
24172420 options ['coverage_directory' ], 'index.html' ))
24182421
24192422 if options ['enable_profiler' ]:
2420- print ('Profiler Output :' , options ['profiler_directory' ])
2423+ print ('Profiler Output :' , options ['profiler_directory' ])
24212424
24222425 if options ['enable_recorder' ]:
2423- print ('Recorder Output :' , options ['recorder_directory' ])
2426+ print ('Recorder Output :' , options ['recorder_directory' ])
24242427
24252428 if options ['envvars_script' ]:
2426- print ('Environ Variables :' , options ['envvars_script' ])
2429+ print ('Environ Variables :' , options ['envvars_script' ])
24272430
24282431 if command == 'setup-server' or options ['setup_only' ]:
24292432 if not options ['envvars_script' ]:
2430- print ('Environ Variables :' , options ['server_root' ] + '/envvars' )
2431- print ('Control Script :' , options ['server_root' ] + '/apachectl' )
2433+ print ('Environ Variables :' , options ['server_root' ] + '/envvars' )
2434+ print ('Control Script :' , options ['server_root' ] + '/apachectl' )
24322435
24332436 return options
24342437
0 commit comments