@@ -354,7 +354,7 @@ def find_mimetypes():
354
354
WSGIChunkedRequest On
355
355
</IfDefine>
356
356
357
- <IfDefine WSGI_WITH_SSL >
357
+ <IfDefine WSGI_WITH_HTTPS >
358
358
<IfModule !ssl_module>
359
359
LoadModule ssl_module %(modules_directory)s/mod_ssl.so
360
360
</IfModule>
@@ -458,10 +458,10 @@ def find_mimetypes():
458
458
ServerName %(server_name)s
459
459
<IfDefine WSGI_SERVER_ALIAS>
460
460
ServerAlias %(server_aliases)s
461
+ </IfDefine>
461
462
RewriteEngine On
462
463
RewriteCond %%{HTTPS} off
463
464
RewriteRule (.*) https://%%{HTTP_HOST}%%{REQUEST_URI}
464
- </IfDefine>
465
465
</VirtualHost>
466
466
<IfDefine WSGI_REDIRECT_WWW>
467
467
<VirtualHost *:%(port)s>
@@ -477,17 +477,17 @@ def find_mimetypes():
477
477
478
478
<IfDefine WSGI_VIRTUAL_HOST>
479
479
480
- <IfDefine WSGI_WITH_SSL >
480
+ <IfDefine WSGI_WITH_HTTPS >
481
481
<IfDefine WSGI_LISTENER_HOST>
482
- Listen %(host)s:%(ssl_port )s
482
+ Listen %(host)s:%(https_port )s
483
483
</IfDefine>
484
484
<IfDefine !WSGI_LISTENER_HOST>
485
- Listen %(ssl_port )s
485
+ Listen %(https_port )s
486
486
</IfDefine>
487
487
<IfVersion < 2.4>
488
- NameVirtualHost *:%(ssl_port )s
488
+ NameVirtualHost *:%(https_port )s
489
489
</IfVersion>
490
- <VirtualHost _default_:%(ssl_port )s>
490
+ <VirtualHost _default_:%(https_port )s>
491
491
<Location />
492
492
Order deny,allow
493
493
Deny from all
@@ -499,7 +499,7 @@ def find_mimetypes():
499
499
SSLCertificateFile %(ssl_certificate)s.crt
500
500
SSLCertificateKeyFile %(ssl_certificate)s.key
501
501
</VirtualHost>
502
- <VirtualHost *:%(ssl_port )s>
502
+ <VirtualHost *:%(https_port )s>
503
503
ServerName %(server_name)s
504
504
<IfDefine WSGI_SERVER_ALIAS>
505
505
ServerAlias %(server_aliases)s
@@ -509,9 +509,9 @@ def find_mimetypes():
509
509
SSLCertificateKeyFile %(ssl_certificate)s.key
510
510
</VirtualHost>
511
511
<IfDefine WSGI_REDIRECT_WWW>
512
- <VirtualHost *:%(ssl_port )s>
512
+ <VirtualHost *:%(https_port )s>
513
513
ServerName %(parent_domain)s
514
- Redirect permanent / https://%(server_name)s:%(ssl_port )s/
514
+ Redirect permanent / https://%(server_name)s:%(https_port )s/
515
515
SSLEngine On
516
516
SSLCertificateFile %(ssl_certificate)s.crt
517
517
SSLCertificateKeyFile %(ssl_certificate)s.key
@@ -1356,7 +1356,7 @@ def generate_server_metrics_script(options):
1356
1356
LC_ALL='%(locale)s'
1357
1357
1358
1358
export LANG
1359
- export LOCALE
1359
+ export LC_ALL
1360
1360
1361
1361
ACMD="$1"
1362
1362
ARGV="$@"
@@ -1433,9 +1433,12 @@ def check_percentage(option, opt_str, value, parser):
1433
1433
metavar = 'NUMBER' , help = 'The specific port to bind to and '
1434
1434
'on which requests are to be accepted. Defaults to port 8000.' ),
1435
1435
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.' ),
1436
1439
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
+
1439
1442
optparse .make_option ('--ssl-certificate' , default = None ,
1440
1443
metavar = 'FILE-PATH' , help = 'Specify the path to the SSL '
1441
1444
'certificate files. It is expected that the files have \' .crt\' '
@@ -1444,9 +1447,9 @@ def check_percentage(option, opt_str, value, parser):
1444
1447
'the extension.' ),
1445
1448
optparse .make_option ('--https-only' , action = 'store_true' ,
1446
1449
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.' ),
1450
1453
1451
1454
optparse .make_option ('--server-name' , default = None , metavar = 'HOSTNAME' ,
1452
1455
help = 'The primary host name of the web server. If this name '
@@ -1737,13 +1740,13 @@ def check_percentage(option, opt_str, value, parser):
1737
1740
help = 'Specify an alternate script file for user defined web '
1738
1741
'server environment variables. Defaults to using the '
1739
1742
'\' 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' ,
1741
1744
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' ,
1744
1747
help = 'Specify the default natural language formatting style '
1745
1748
'as normally defined by the LC_ALL environment variable. '
1746
- 'Defaults to \' en_US .UTF-8\' .' ),
1749
+ 'Defaults to \' C .UTF-8\' .' ),
1747
1750
1748
1751
optparse .make_option ('--setenv' , action = 'append' , nargs = 2 ,
1749
1752
dest = 'setenv_variables' , metavar = 'KEY VALUE' , help = 'Specify '
@@ -2265,12 +2268,12 @@ def _cmd_setup_server(command, args, options):
2265
2268
else :
2266
2269
options ['url' ] = 'http://%s:%s/' % (host , options ['port' ])
2267
2270
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 ' ])
2272
2275
else :
2273
- options ['ssl_url ' ] = None
2276
+ options ['https_url ' ] = None
2274
2277
2275
2278
if options ['debug_mode' ]:
2276
2279
options ['httpd_arguments_list' ].append ('-DONE_PROCESS' )
@@ -2329,8 +2332,8 @@ def _cmd_setup_server(command, args, options):
2329
2332
options ['httpd_arguments_list' ].append ('-DWSGI_REDIRECT_WWW' )
2330
2333
options ['parent_domain' ] = options ['server_name' ][4 :]
2331
2334
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 ' )
2334
2337
if options ['https_only' ]:
2335
2338
options ['httpd_arguments_list' ].append ('-DWSGI_HTTPS_ONLY' )
2336
2339
@@ -2393,42 +2396,42 @@ def _cmd_setup_server(command, args, options):
2393
2396
generate_apache_config (options )
2394
2397
generate_control_scripts (options )
2395
2398
2396
- print ('Server URL :' , options ['url' ])
2399
+ print ('Server URL :' , options ['url' ])
2397
2400
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 ' ])
2400
2403
2401
2404
if options ['server_status' ]:
2402
- print ('Server Status :' , '%sserver-status' % options ['url' ])
2405
+ print ('Server Status :' , '%sserver-status' % options ['url' ])
2403
2406
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' ])
2406
2409
2407
- print ('Error Log File :' , options ['error_log_file' ])
2410
+ print ('Error Log File :' , options ['error_log_file' ])
2408
2411
2409
2412
if options ['access_log' ]:
2410
- print ('Access Log File :' , options ['access_log_file' ])
2413
+ print ('Access Log File :' , options ['access_log_file' ])
2411
2414
2412
2415
if options ['startup_log' ]:
2413
- print ('Startup Log File :' , options ['startup_log_file' ])
2416
+ print ('Startup Log File :' , options ['startup_log_file' ])
2414
2417
2415
2418
if options ['enable_coverage' ]:
2416
- print ('Coverage Output :' , os .path .join (
2419
+ print ('Coverage Output :' , os .path .join (
2417
2420
options ['coverage_directory' ], 'index.html' ))
2418
2421
2419
2422
if options ['enable_profiler' ]:
2420
- print ('Profiler Output :' , options ['profiler_directory' ])
2423
+ print ('Profiler Output :' , options ['profiler_directory' ])
2421
2424
2422
2425
if options ['enable_recorder' ]:
2423
- print ('Recorder Output :' , options ['recorder_directory' ])
2426
+ print ('Recorder Output :' , options ['recorder_directory' ])
2424
2427
2425
2428
if options ['envvars_script' ]:
2426
- print ('Environ Variables :' , options ['envvars_script' ])
2429
+ print ('Environ Variables :' , options ['envvars_script' ])
2427
2430
2428
2431
if command == 'setup-server' or options ['setup_only' ]:
2429
2432
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' )
2432
2435
2433
2436
return options
2434
2437
0 commit comments