github.com/ddev/ddev@v1.23.2-0.20240519125000-d824ffe36ff3/pkg/ddevapp/webserver_config_assets/apache_second_docroot_example-site-php.conf (about)

     1  # ddev generic/default/php config for apache2
     2  
     3  #ddev-generated
     4  # If you want to take over this file and customize it, remove the line above
     5  # and ddev will respect it and won't overwrite the file.
     6  # See https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#custom-apache-configuration
     7  <VirtualHost *:80>
     8      RewriteEngine On
     9      RewriteCond %{HTTP:X-Forwarded-Proto} =https
    10      RewriteCond    %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
    11      RewriteRule    ^(.+[^/])$           https://%{HTTP_HOST}$1/ [redirect,last]
    12  
    13      SetEnvIf X-Forwarded-Proto "https" HTTPS=on
    14  
    15      ServerName seconddocroot.ddev.site
    16      DocumentRoot /var/www/html/seconddocroot
    17      <Directory "/var/www/html/seconddocroot/">
    18        AllowOverride All
    19        Allow from All
    20      </Directory>
    21      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    22      # error, crit, alert, emerg.
    23      # It is also possible to configure the loglevel for particular
    24      # modules, e.g.
    25      #LogLevel info ssl:warn
    26  
    27      ErrorLog /dev/stdout
    28      CustomLog ${APACHE_LOG_DIR}/access.log combined
    29  
    30      # For most configuration files from conf-available/, which are
    31      # enabled or disabled at a global level, it is possible to
    32      # include a line for only one particular virtual host. For example the
    33      # following line enables the CGI configuration for this host only
    34      # after it has been globally disabled with "a2disconf".
    35      #Include conf-available/serve-cgi-bin.conf
    36      # Simple ddev technique to get a phpstatus
    37      Alias "/phpstatus" "/var/www/phpstatus.php"
    38  
    39  </VirtualHost>
    40  
    41  <VirtualHost *:443>
    42      SSLEngine on
    43      SSLCertificateFile /etc/ssl/certs/master.crt
    44      SSLCertificateKeyFile /etc/ssl/certs/master.key
    45  
    46      # Workaround from https://mail-archives.apache.org/mod_mbox/httpd-users/201403.mbox/%3C49404A24C7FAD94BB7B45E86A9305F6214D04652@MSGEXSV21103.ent.wfb.bank.corp%3E
    47      # See also https://gist.github.com/nurtext/b6ac07ac7d8c372bc8eb
    48  
    49      RewriteEngine On
    50      RewriteCond %{HTTP:X-Forwarded-Proto} =https
    51      RewriteCond    %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
    52      RewriteRule    ^(.+[^/])$           https://%{HTTP_HOST}$1/ [redirect,last]
    53  
    54      SetEnvIf X-Forwarded-Proto "https" HTTPS=on
    55  
    56      ServerName seconddocroot.ddev.site
    57      DocumentRoot /var/www/html/seconddocroot
    58      <Directory "/var/www/html/seconddocroot/">
    59        AllowOverride All
    60        Allow from All
    61      </Directory>
    62      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    63      # error, crit, alert, emerg.
    64      # It is also possible to configure the loglevel for particular
    65      # modules, e.g.
    66      #LogLevel info ssl:warn
    67  
    68      ErrorLog /dev/stdout
    69      CustomLog ${APACHE_LOG_DIR}/access.log combined
    70  
    71      # For most configuration files from conf-available/, which are
    72      # enabled or disabled at a global level, it is possible to
    73      # include a line for only one particular virtual host. For example the
    74      # following line enables the CGI configuration for this host only
    75      # after it has been globally disabled with "a2disconf".
    76      #Include conf-available/serve-cgi-bin.conf
    77      # Simple ddev technique to get a phpstatus
    78      Alias "/phpstatus" "/var/www/phpstatus.php"
    79  
    80  </VirtualHost>
    81  # vim: syntax=apache ts=4 sw=4 sts=4 sr noet