# Defined Type: php::apache_vhost

Defined in:
  manifests/apache_vhost.pp

## Overview

Configures an apache vhost for php

=== Parameters

[vhost] The vhost address

[docroot] The vhost docroot

[port] The vhost port

[default_vhost] defines if vhost is the default vhost

[fastcgi_socket] address of the fastcgi socket

Parameters:

- vhost (`Any`) (defaults to: `'example.com'`)
- docroot (`Any`) (defaults to: `'/var/www'`)
- port (`Any`) (defaults to: `80`)
- default_vhost (`Any`) (defaults to: `true`)
- fastcgi_socket (`Any`) (defaults to: `'fcgi://127.0.0.1:9000/$1'`)

    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    # File 'manifests/apache_vhost.pp', line 20

    define php::apache_vhost(
      $vhost          = 'example.com',
      $docroot        = '/var/www',
      $port           = 80,
      $default_vhost  = true,
      $fastcgi_socket = 'fcgi://127.0.0.1:9000/$1'
    ) {

      ::apache::vhost { $vhost:
        docroot         => $docroot,
        default_vhost   => $default_vhost,
        port            => $port,
        override        => 'all',
        custom_fragment => "ProxyPassMatch ^/(.*\\.php(/.*)?)$ ${fastcgi_socket}",
      }
    }