@@ -173,10 +173,10 @@ LoadModule unique_id_module modules/mod_unique_id.so
173173
174174<Directory "${ROOTDIR}/system/public_html/default" >
175175 AllowOverride None
176- Options + Indexes
176+ Options - Indexes
177177 Require all granted
178178 <IfModule ssl_module >
179- <FilesMatch "\.(cgi |shtml|phtml|php |pl)$" >
179+ <FilesMatch "\.(php |shtml|phtml|cgi |pl)$" >
180180 SSLOptions +StdEnvVars
181181 </FilesMatch >
182182 </IfModule >
@@ -344,7 +344,7 @@ Include "${SRVROOT}/conf/errors.conf"
344344</IfModule >
345345
346346<IfModule dir_module >
347- DirectoryIndex index.html index.htm index.shtml index.php
347+ DirectoryIndex index.html index.htm index.shtml
348348</IfModule >
349349
350350Include "${SRVROOT}/conf/autoindex.conf"
@@ -411,8 +411,8 @@ AddDefaultCharset utf-8
411411# Virtual Host Macros
412412# -----------------------------------------------------------------------------------
413413
414- <Macro Host_Default $ip >
415- <VirtualHost $ip >
414+ <Macro Host_Default $bind_ip >
415+ <VirtualHost $bind_ip >
416416 ServerName default
417417 <Location /apacheerror/ >
418418 Require all granted
@@ -444,13 +444,13 @@ AddDefaultCharset utf-8
444444 </VirtualHost >
445445</Macro >
446446
447- <Macro Host_Default_SSL $ip $ssl_cert_file $ssl_key_file >
447+ <Macro Host_Default_SSL $bind_ip $tls_cert_file $tls_key_file >
448448 <IfModule ssl_module >
449- <VirtualHost $ip >
449+ <VirtualHost $bind_ip >
450450 ServerName default
451451 SSLEngine on
452- SSLCertificateFile "$ssl_cert_file "
453- SSLCertificateKeyFile "$ssl_key_file "
452+ SSLCertificateFile "$tls_cert_file "
453+ SSLCertificateKeyFile "$tls_key_file "
454454 <Location /apacheerror/ >
455455 Require all granted
456456 </Location >
@@ -482,9 +482,9 @@ AddDefaultCharset utf-8
482482 </IfModule >
483483</Macro >
484484
485- <Macro Host_Static $host $ip $aliases $base_dir $public_dir >
486- <VirtualHost $ip >
487- <Directory "$public_dir " >
485+ <Macro Host_Static $host $bind_ip $server_aliases $base_dir $web_root >
486+ <VirtualHost $bind_ip >
487+ <Directory "$web_root " >
488488 AllowOverride All
489489 Options +Indexes
490490 Require all granted
@@ -498,30 +498,29 @@ AddDefaultCharset utf-8
498498 </IfModule >
499499 </Directory >
500500 ServerName $host
501- ServerAlias $aliases
502- DocumentRoot "$public_dir "
501+ ServerAlias $server_aliases
502+ DocumentRoot "$web_root "
503503 CustomLog "${ROOTDIR}/logs/domains/$host_access.log" combined
504504 ErrorLog "${ROOTDIR}/logs/domains/$host_error.log"
505505 # SetEnvIf status 404 log_404
506506 # CustomLog "${ROOTDIR}/logs/domains/$host_404.log" combined env=log_404
507507
508- IncludeOptional "${SRVROOT}/conf/env/$host.conf"
509508 IncludeOptional "$base_dir/.osp/apache/$host.conf"
510509 </VirtualHost >
511510</Macro >
512511
513- <Macro Host_Static_SSL $host $ip $aliases $base_dir $public_dir $ssl_cert_file $ssl_key_file $protocols >
512+ <Macro Host_Static_SSL $host $bind_ip $server_aliases $base_dir $web_root $tls_cert_file $tls_key_file $protocols >
514513 <IfModule ssl_module >
515- <VirtualHost $ip >
514+ <VirtualHost $bind_ip >
516515 <IfModule http2_module >
517516 Protocols $protocols
518517 </IfModule >
519518 ServerName $host
520- ServerAlias $aliases
519+ ServerAlias $server_aliases
521520 SSLEngine on
522- SSLCertificateFile "$ssl_cert_file "
523- SSLCertificateKeyFile "$ssl_key_file "
524- <Directory "$public_dir " >
521+ SSLCertificateFile "$tls_cert_file "
522+ SSLCertificateKeyFile "$tls_key_file "
523+ <Directory "$web_root " >
525524 AllowOverride All
526525 Options +Indexes
527526 Require all granted
@@ -533,25 +532,24 @@ AddDefaultCharset utf-8
533532 Options +ExecCGI
534533 </FilesMatch >
535534 </IfModule >
536- <FilesMatch "\.(cgi |shtml|phtml|php |pl)$" >
535+ <FilesMatch "\.(php |shtml|phtml|cgi |pl)$" >
537536 SSLOptions +StdEnvVars
538537 </FilesMatch >
539538 </Directory >
540- DocumentRoot "$public_dir "
539+ DocumentRoot "$web_root "
541540 CustomLog "${ROOTDIR}/logs/domains/$host_access.log" combined
542541 ErrorLog "${ROOTDIR}/logs/domains/$host_error.log"
543542 # SetEnvIf status 404 log_404
544543 # CustomLog "${ROOTDIR}/logs/domains/$host_404.log" combined env=log_404
545544
546- IncludeOptional "${SRVROOT}/conf/env/$host.conf"
547545 IncludeOptional "$base_dir/.osp/apache/$host.conf"
548546 </VirtualHost >
549547 </IfModule >
550548</Macro >
551549
552- <Macro Host_PHP $host $ip $aliases $base_dir $public_dir $backend_ip $backend_port >
553- <VirtualHost $ip >
554- <Directory "$public_dir " >
550+ <Macro Host_PHP $host $bind_ip $server_aliases $base_dir $web_root $backend_ip $backend_port >
551+ <VirtualHost $bind_ip >
552+ <Directory "$web_root " >
555553 AllowOverride All
556554 Options +Indexes
557555 Require all granted
@@ -565,48 +563,52 @@ AddDefaultCharset utf-8
565563 </IfModule >
566564 </Directory >
567565 ServerName $host
568- ServerAlias $aliases
569- DocumentRoot "$public_dir "
566+ ServerAlias $server_aliases
567+ DocumentRoot "$web_root "
570568 CustomLog "${ROOTDIR}/logs/domains/$host_access.log" combined
571569 ErrorLog "${ROOTDIR}/logs/domains/$host_error.log"
572570 # SetEnvIf status 404 log_404
573571 # CustomLog "${ROOTDIR}/logs/domains/$host_404.log" combined env=log_404
574572
573+ <IfModule dir_module >
574+ DirectoryIndex index.php index.html index.htm index.shtml
575+ </IfModule >
576+
575577 <IfModule proxy_module >
576578 <IfModule proxy_fcgi_module >
577579 <FilesMatch "\.(php|phtml)$" >
578580 SetHandler "proxy:fcgi://$backend_ip:$backend_port/"
579581 ProxyFCGISetEnvIf "true" PHP_VALUE "error_log=${ROOTDIR}/logs/domains/$host_php_error.log"
580- ProxyFCGISetEnvIf "true" DOCUMENT_ROOT "$public_dir "
582+ ProxyFCGISetEnvIf "true" DOCUMENT_ROOT "$web_root "
581583 ProxyFCGISetEnvIf "true" !HTTPS
582- ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "$public_dir %{reqenv:SCRIPT_NAME }"
584+ ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "$web_root %{reqenv:SCRIPT_NAME }"
583585 # ProxyFCGISetEnvIf "%{reqenv:COUNTRY_CODE} != ''" COUNTRY_CODE "%{reqenv:COUNTRY_CODE}"
584586 # ProxyFCGISetEnvIf "%{reqenv:COUNTRY_NAME} != ''" COUNTRY_NAME "%{reqenv:COUNTRY_NAME}"
585587 Include "${SRVROOT}/conf/fastcgi.conf"
586588 ProxyFCGISetEnvIf "reqenv('HTTP_X_FORWARDED_PROTO') = 'https'" HTTPS "on "
587589 ProxyFCGISetEnvIf "reqenv('HTTP_X_FORWARDED_PROTO') = 'https'" REQUEST_SCHEME "https"
588590 ProxyFCGISetEnvIf "reqenv('HTTP_X_FORWARDED_PROTO') = 'http'" REQUEST_SCHEME "http"
591+ IncludeOptional "${SRVROOT}/conf/env/$host.conf"
589592 </FilesMatch >
590593 </IfModule >
591594 </IfModule >
592595
593- IncludeOptional "${SRVROOT}/conf/env/$host.conf"
594596 IncludeOptional "$base_dir/.osp/apache/$host.conf"
595597 </VirtualHost >
596598</Macro >
597599
598- <Macro Host_PHP_SSL $host $ip $aliases $base_dir $public_dir $ssl_cert_file $ssl_key_file $protocols $backend_ip $backend_port >
600+ <Macro Host_PHP_SSL $host $bind_ip $server_aliases $base_dir $web_root $tls_cert_file $tls_key_file $protocols $backend_ip $backend_port >
599601 <IfModule ssl_module >
600- <VirtualHost $ip >
602+ <VirtualHost $bind_ip >
601603 <IfModule http2_module >
602604 Protocols $protocols
603605 </IfModule >
604606 ServerName $host
605- ServerAlias $aliases
607+ ServerAlias $server_aliases
606608 SSLEngine on
607- SSLCertificateFile "$ssl_cert_file "
608- SSLCertificateKeyFile "$ssl_key_file "
609- <Directory "$public_dir " >
609+ SSLCertificateFile "$tls_cert_file "
610+ SSLCertificateKeyFile "$tls_key_file "
611+ <Directory "$web_root " >
610612 AllowOverride All
611613 Options +Indexes
612614 Require all granted
@@ -618,40 +620,44 @@ AddDefaultCharset utf-8
618620 Options +ExecCGI
619621 </FilesMatch >
620622 </IfModule >
621- <FilesMatch "\.(cgi |shtml|phtml|php |pl)$" >
623+ <FilesMatch "\.(php |shtml|phtml|cgi |pl)$" >
622624 SSLOptions +StdEnvVars
623625 </FilesMatch >
624626 </Directory >
625- DocumentRoot "$public_dir "
627+ DocumentRoot "$web_root "
626628 CustomLog "${ROOTDIR}/logs/domains/$host_access.log" combined
627629 ErrorLog "${ROOTDIR}/logs/domains/$host_error.log"
628630 # SetEnvIf status 404 log_404
629631 # CustomLog "${ROOTDIR}/logs/domains/$host_404.log" combined env=log_404
630632
633+ <IfModule dir_module >
634+ DirectoryIndex index.php index.html index.htm index.shtml
635+ </IfModule >
636+
631637 <IfModule proxy_module >
632638 <IfModule proxy_fcgi_module >
633639 <FilesMatch "\.(php|phtml)$" >
634640 SetHandler "proxy:fcgi://$backend_ip:$backend_port/"
635641 ProxyFCGISetEnvIf "true" PHP_VALUE "error_log=${ROOTDIR}/logs/domains/$host_php_error.log"
636- ProxyFCGISetEnvIf "true" DOCUMENT_ROOT "$public_dir "
642+ ProxyFCGISetEnvIf "true" DOCUMENT_ROOT "$web_root "
637643 ProxyFCGISetEnvIf "true" HTTPS "on "
638- ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "$public_dir %{reqenv:SCRIPT_NAME }"
644+ ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "$web_root %{reqenv:SCRIPT_NAME }"
639645 # ProxyFCGISetEnvIf "%{reqenv:COUNTRY_CODE} != ''" COUNTRY_CODE "%{reqenv:COUNTRY_CODE}"
640646 # ProxyFCGISetEnvIf "%{reqenv:COUNTRY_NAME} != ''" COUNTRY_NAME "%{reqenv:COUNTRY_NAME}"
641647 Include "${SRVROOT}/conf/fastcgi.conf"
648+ IncludeOptional "${SRVROOT}/conf/env/$host.conf"
642649 </FilesMatch >
643650 </IfModule >
644651 </IfModule >
645652
646- IncludeOptional "${SRVROOT}/conf/env/$host.conf"
647653 IncludeOptional "$base_dir/.osp/apache/$host.conf"
648654 </VirtualHost >
649655 </IfModule >
650656</Macro >
651657
652- <Macro Host_Proxy $host $ip $aliases $base_dir $public_dir $backend_ip $backend_port >
653- <VirtualHost $ip >
654- <Directory "$public_dir " >
658+ <Macro Host_Proxy $host $bind_ip $server_aliases $base_dir $web_root $backend_ip $backend_port >
659+ <VirtualHost $bind_ip >
660+ <Directory "$web_root " >
655661 AllowOverride All
656662 Options +Indexes
657663 Require all granted
@@ -665,8 +671,8 @@ AddDefaultCharset utf-8
665671 </IfModule >
666672 </Directory >
667673 ServerName $host
668- ServerAlias $aliases
669- DocumentRoot "$public_dir "
674+ ServerAlias $server_aliases
675+ DocumentRoot "$web_root "
670676 CustomLog "${ROOTDIR}/logs/domains/$host_access.log" combined
671677 ErrorLog "${ROOTDIR}/logs/domains/$host_error.log"
672678 # SetEnvIf status 404 log_404
@@ -690,23 +696,22 @@ AddDefaultCharset utf-8
690696 </IfModule >
691697 </IfModule >
692698
693- IncludeOptional "${SRVROOT}/conf/env/$host.conf"
694699 IncludeOptional "$base_dir/.osp/apache/$host.conf"
695700 </VirtualHost >
696701</Macro >
697702
698- <Macro Host_Proxy_SSL $host $ip $aliases $base_dir $public_dir $ssl_cert_file $ssl_key_file $protocols $backend_ip $backend_port >
703+ <Macro Host_Proxy_SSL $host $bind_ip $server_aliases $base_dir $web_root $tls_cert_file $tls_key_file $protocols $backend_ip $backend_port >
699704 <IfModule ssl_module >
700- <VirtualHost $ip >
705+ <VirtualHost $bind_ip >
701706 <IfModule http2_module >
702707 Protocols $protocols
703708 </IfModule >
704709 ServerName $host
705- ServerAlias $aliases
710+ ServerAlias $server_aliases
706711 SSLEngine on
707- SSLCertificateFile "$ssl_cert_file "
708- SSLCertificateKeyFile "$ssl_key_file "
709- <Directory "$public_dir " >
712+ SSLCertificateFile "$tls_cert_file "
713+ SSLCertificateKeyFile "$tls_key_file "
714+ <Directory "$web_root " >
710715 AllowOverride All
711716 Options +Indexes
712717 Require all granted
@@ -718,11 +723,11 @@ AddDefaultCharset utf-8
718723 Options +ExecCGI
719724 </FilesMatch >
720725 </IfModule >
721- <FilesMatch "\.(cgi |shtml|phtml|php |pl)$" >
726+ <FilesMatch "\.(php |shtml|phtml|cgi |pl)$" >
722727 SSLOptions +StdEnvVars
723728 </FilesMatch >
724729 </Directory >
725- DocumentRoot "$public_dir "
730+ DocumentRoot "$web_root "
726731 CustomLog "${ROOTDIR}/logs/domains/$host_access.log" combined
727732 ErrorLog "${ROOTDIR}/logs/domains/$host_error.log"
728733 # SetEnvIf status 404 log_404
@@ -745,8 +750,7 @@ AddDefaultCharset utf-8
745750 </IfModule >
746751 </IfModule >
747752 </IfModule >
748-
749- IncludeOptional "${SRVROOT}/conf/env/$host.conf"
753+
750754 IncludeOptional "$base_dir/.osp/apache/$host.conf"
751755 </VirtualHost >
752756 </IfModule >
0 commit comments